Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] net: microchip: vcap: initialize the top address of every VCAP
@ 2026-11-23 14:55 Daniel Machon
  2026-11-23 14:58 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Machon @ 2026-11-23 14:55 UTC (permalink / raw)
  To: Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Steen Hegelund
  Cc: netdev, linux-arm-kernel

The sparx5 and lan966x block init helpers initialize the address range
of each VCAP instance, from first_valid_addr to last_valid_addr, with
the VCAP initialize command. They pass the range as a count of
last_valid_addr - first_valid_addr addresses.

The range is inclusive at both ends and holds one more address than
that, so the top address is never initialized. It keeps whatever the
TCAM held after reset, where it can match traffic until a rule is placed
there.

Pass the full count to initialize the whole range.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
 drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c | 2 +-
 drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c b/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c
index eb28df80b2818..c0bd831a32a88 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c
@@ -659,7 +659,7 @@ static void lan966x_vcap_block_init(struct lan966x *lan966x,
 
 	__lan966x_vcap_range_init(lan966x, admin, admin->first_valid_addr,
 				  admin->last_valid_addr -
-					admin->first_valid_addr);
+					admin->first_valid_addr + 1);
 }
 
 static void lan966x_vcap_port_key_deselection(struct lan966x *lan966x,
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c
index 2dee2ce19fce7..b2e76bec8edba 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c
@@ -250,7 +250,7 @@ static void sparx5_vcap_block_init(struct sparx5 *sparx5,
 {
 	_sparx5_vcap_range_init(sparx5, admin, admin->first_valid_addr,
 				admin->last_valid_addr -
-					admin->first_valid_addr);
+					admin->first_valid_addr + 1);
 }
 
 /* Get the keyset name from the sparx5 VCAP model */

---
base-commit: eb6d6c80d35449c27471b1874f13066c09a8964d
change-id: 20261123-microchip-vcap-top-address-84e0326c8e3d

Best regards,
-- 
Daniel Machon <daniel.machon@microchip.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-23 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 14:55 [PATCH net-next] net: microchip: vcap: initialize the top address of every VCAP Daniel Machon
2026-11-23 14:58 ` netdev-bot+sinfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox