Skip to contentSkip to conversation

net: microchip: vcap: initialize the top address of every VCAP

PATCH Applied Daniel Machon 3 participants 4 messages Nov 23 – Nov 29

Subsystems (4)
lore
Share & tools
lore

Daniel Machon

author maintainer
#0 lore raw

PATCH 1/1 net: microchip: vcap: initialize the top address of every VCAP

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.

---
 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(-)
drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c +1 -1
index eb28df80b2818..c0bd831a32a88 100644
@@ -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,
drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c +1 -1
index 2dee2ce19fce7..b2e76bec8edba 100644
@@ -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,

Signature · 1 line
Daniel Machon <[email protected]>
#1 lore raw
This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:

Hi!

This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:

- How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan.

- Whether the issue was actually triggered, or is only theoretical (e.g. found by LLM and not proven at runtime). If it was triggered please include the symptoms, like the stack trace or kernel messages.

- What hardware the change was tested on. For driver fixes please mention the device (and if relevant firmware version) used for testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include the relevant info in the cover letter or commit messages.

Signature · 2 lines
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
author maintainer
#2 lore raw
Quoted 21 lines

Hi!

This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:

- How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan.

- Whether the issue was actually triggered, or is only theoretical (e.g. found by LLM and not proven at runtime). If it was triggered please include the symptoms, like the stack trace or kernel messages.

- What hardware the change was tested on. For driver fixes please mention the device (and if relevant firmware version) used for testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account.

Quoted 5 lines

*IMPORTANT*: If you do repost (for other reasons) - please include the relevant info in the cover letter or commit messages. --
The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.

Found by an AI code review agent and verified against the datasheet. Not triggered at runtime, and hardly a fix that matters for stable, hence net-next without a Fixes tag.

Regression tested only.

#3 lore raw
In reply to Daniel Machon
This patch was applied to netdev/net-next.git (main) by Willem de Bruijn <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Willem de Bruijn <[email protected]>:

Quoted 11 lines · On Mon, 23 Nov 2026 15:55:04 +0100 you wrote:

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.

[...]

Here is the summary with links:
- [net-next] net: microchip: vcap: initialize the top address of every VCAP

    https://git.kernel.org/netdev/net-next/c/9b9cf2aa834e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html