<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-next.git/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c, branch master</title>
<subtitle>Linux kernel latest source</subtitle>
<id>http://mirrors.hust.edu.cn/git/linux-next.git/atom?h=master</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/linux-next.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/'/>
<updated>2026-07-05T07:18:47+00:00</updated>
<entry>
<title>net: microchip: vcap: fix races on the shared Super VCAP block</title>
<updated>2026-07-05T07:18:47+00:00</updated>
<author>
<name>Jens Emil Schulz Østergaard</name>
<email>jensemil.schulzostergaard@microchip.com</email>
</author>
<published>2026-06-30T12:20:13+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=d7a8d500d7e42837bd8dce40cb52c97c6e8706a9'/>
<id>urn:sha1:d7a8d500d7e42837bd8dce40cb52c97c6e8706a9</id>
<content type='text'>
The VCAP instances on a chip are not independent, yet they are locked
independently. On sparx5 and lan969x the IS0 and IS2 instances are
backed by the same Super VCAP hardware block and share its cache and
command registers: every access drives the shared VCAP_SUPER_CTRL
register and moves data through the shared cache registers.

Accessing one instance therefore races with accessing another. The
per-instance admin-&gt;lock cannot prevent this, as each instance takes a
different lock.

The locking issue is mostly disguised by the fact that the core usage of
the vcap api runs under rtnl. However, the full rule dump in debugfs
decodes rules straight from hardware (a READ command followed by a cache
read) and runs outside rtnl, so it races a concurrent tc-flower rule
write to another Super VCAP instance.

Besides corrupting the dump, the read repopulates the shared cache
between the writers cache fill and its write command, so the writer
commits the wrong data and corrupts the hardware entry.

Introduce vcap_lock() and vcap_unlock() helpers and route every rule
lock site in the VCAP API and its debugfs code through them. Replace the
per-instance admin-&gt;lock with a single mutex in struct vcap_control that
serializes access to all instances. The helpers reach it through a new
admin-&gt;vctrl back-pointer, and the clients initialise and destroy the
control lock instead of a per-instance one.

No path holds more than one instance lock, so collapsing them onto a
single mutex cannot self-deadlock.

Fixes: 71c9de995260 ("net: microchip: sparx5: Add VCAP locking to protect rules")
Signed-off-by: Jens Emil Schulz Østergaard &lt;jensemil.schulzostergaard@microchip.com&gt;
Link: https://patch.msgid.link/20260630-microchip_fix_vcap_locking-v1-1-f60a4596734d@microchip.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: microchip: Constify struct vcap_operations</title>
<updated>2024-06-18T13:26:39+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2024-06-16T07:57:56+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=8c379e3ce404347acf35fbb4cf8694dd8d35f2a0'/>
<id>urn:sha1:8c379e3ce404347acf35fbb4cf8694dd8d35f2a0</id>
<content type='text'>
"struct vcap_operations" are not modified in these drivers.

Constifying this structure moves some data to a read-only section, so
increase overall security.

In order to do it, "struct vcap_control" also needs to be adjusted to this
new const qualifier.

As an example, on a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  15176	   1094	     16	  16286	   3f9e	drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  15268	    998	     16	  16282	   3f9a	drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.o

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Reviewed-by: Daniel Machon &lt;daniel.machon@microchip.com&gt;
Link: https://lore.kernel.org/r/d8e76094d2e98ebb5bfc8205799b3a9db0b46220.1718524644.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;

</content>
</entry>
<entry>
<title>net: lan966x: Add IS1 VCAP model</title>
<updated>2023-03-11T00:44:24+00:00</updated>
<author>
<name>Horatiu Vultur</name>
<email>horatiu.vultur@microchip.com</email>
</author>
<published>2023-03-07T22:09:25+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=99ce286d2d30a31eba4171036bc3f32eeb59e5f3'/>
<id>urn:sha1:99ce286d2d30a31eba4171036bc3f32eeb59e5f3</id>
<content type='text'>
Provide IS1 (ingress stage 1) VCAP model for lan966x.
This provides classification actions for lan966x.

Signed-off-by: Horatiu Vultur &lt;horatiu.vultur@microchip.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Add ES0 VCAP model and updated KUNIT VCAP model</title>
<updated>2023-02-16T07:59:48+00:00</updated>
<author>
<name>Steen Hegelund</name>
<email>steen.hegelund@microchip.com</email>
</author>
<published>2023-02-14T10:40:45+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=a5cc98adf3cbb187a7b9063ccb2b1c7065a05401'/>
<id>urn:sha1:a5cc98adf3cbb187a7b9063ccb2b1c7065a05401</id>
<content type='text'>
This provides the VCAP model for the Sparx5 ES0 (Egress Stage 0) VCAP.

This VCAP provides rewriting functionality in the egress path.

Signed-off-by: Steen Hegelund &lt;steen.hegelund@microchip.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Add ingress information to VCAP instance</title>
<updated>2023-01-30T07:36:22+00:00</updated>
<author>
<name>Steen Hegelund</name>
<email>steen.hegelund@microchip.com</email>
</author>
<published>2023-01-27T13:08:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=e7e3f514713e87a2c09d774aec88c2a9b117e76f'/>
<id>urn:sha1:e7e3f514713e87a2c09d774aec88c2a9b117e76f</id>
<content type='text'>
This allows the check of the goto action to be specific to the ingress and
egress VCAP instances.

The debugfs support is also updated to show this information.

Signed-off-by: Steen Hegelund &lt;steen.hegelund@microchip.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Add lock initialization to the KUNIT tests</title>
<updated>2023-01-18T14:31:43+00:00</updated>
<author>
<name>Steen Hegelund</name>
<email>steen.hegelund@microchip.com</email>
</author>
<published>2023-01-17T08:55:44+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=595655e081746f6fca8263154fd6fb5f2b22da24'/>
<id>urn:sha1:595655e081746f6fca8263154fd6fb5f2b22da24</id>
<content type='text'>
Ensure that the KUNIT tests lock instance is initialized before the test is
executed.

Signed-off-by: Steen Hegelund &lt;steen.hegelund@microchip.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: microchip: vcap api: Add a storage state to a VCAP rule</title>
<updated>2023-01-16T13:45:17+00:00</updated>
<author>
<name>Steen Hegelund</name>
<email>steen.hegelund@microchip.com</email>
</author>
<published>2023-01-14T13:42:41+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=814e7693207f1bd936d600f9b5467f133e3d6e40'/>
<id>urn:sha1:814e7693207f1bd936d600f9b5467f133e3d6e40</id>
<content type='text'>
This allows a VCAP rule to be in one of 3 states:

- permanently stored in the VCAP HW (for rules that must always be present)
- enabled (stored in HW) when the corresponding lookup has been enabled
- disabled (stored in SW) when the lookup is disabled

This way important VCAP rules can be added even before the user enables the
VCAP lookups using a TC matchall filter.

Signed-off-by: Horatiu Vultur &lt;horatiu.vultur@microchip.com&gt;
Signed-off-by: Steen Hegelund &lt;steen.hegelund@microchip.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: microchip: vcap api: Always enable VCAP lookups</title>
<updated>2023-01-16T13:45:16+00:00</updated>
<author>
<name>Steen Hegelund</name>
<email>steen.hegelund@microchip.com</email>
</author>
<published>2023-01-14T13:42:37+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=01ef75a257fa82cd0f8577fb9cda847415d2f748'/>
<id>urn:sha1:01ef75a257fa82cd0f8577fb9cda847415d2f748</id>
<content type='text'>
This changes the VCAP lookups state to always be enabled so that it is
possible to add "internal" VCAP rules that must be available even though
the user has not yet enabled the VCAP chains via a TC matchall filter.

The API callback to enable and disable VCAP lookups is therefore removed.

Signed-off-by: Horatiu Vultur &lt;horatiu.vultur@microchip.com&gt;
Signed-off-by: Steen Hegelund &lt;steen.hegelund@microchip.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Support for displaying a list of keysets</title>
<updated>2022-11-25T09:42:14+00:00</updated>
<author>
<name>Steen Hegelund</name>
<email>steen.hegelund@microchip.com</email>
</author>
<published>2022-11-23T15:25:44+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=14b639caa6e4016a10112e0a1f6fcb5fdad4374c'/>
<id>urn:sha1:14b639caa6e4016a10112e0a1f6fcb5fdad4374c</id>
<content type='text'>
This will display a list of keyset in case the type_id field in the VCAP
rule has been wildcarded.

Signed-off-by: Steen Hegelund &lt;steen.hegelund@microchip.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Add VCAP debugfs KUNIT test</title>
<updated>2022-11-21T11:33:02+00:00</updated>
<author>
<name>Steen Hegelund</name>
<email>steen.hegelund@microchip.com</email>
</author>
<published>2022-11-17T21:31:14+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=552b7d131aa01bcb046fb635d66e256c3e7e13ee'/>
<id>urn:sha1:552b7d131aa01bcb046fb635d66e256c3e7e13ee</id>
<content type='text'>
This tests the functionality of the debugFS support:

- finding valid keyset on an address
- raw VCAP output
- full rule VCAP output

Signed-off-by: Steen Hegelund &lt;steen.hegelund@microchip.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
