octeontx2-af: fix inner LC ltype match for RSS flowkey
PATCH 1/1 octeontx2-af: fix inner LC ltype match for RSS flowkey
From: Kiran Kumar K <[email protected]>
Inner LC ltypes differ from outer LC ltypes, but RSS flowkey programming was using outer LC IP/IP6 ltype masks for inner IP keys.
For inner IPv4/IPv6, match only the base IP ltype and do not include extension-header matches. Keep existing outer LC masks unchanged.
This fixes inner-tunnel RSS key calculation and prevents mismatches in inner IP flow classification.
---
--- drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +6 -2
@@ -4112,9 +4112,12 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg)case NIX_FLOW_KEY_TYPE_INNR_IPV4 : field->lid =NPC_LID_LC ; field->ltype_match =NPC_LT_LC_IP ; + field->ltype_mask =NPC_LT_LC_IP_MATCH_MSK ; +if (key_type ==NIX_FLOW_KEY_TYPE_INNR_IPV4 ) { field->lid =NPC_LID_LG ; field->ltype_match =NPC_LT_LG_TU_IP ; + field->ltype_mask =0xF ; } field->hdr_offset =12 ;/* SIP offset */ field->bytesm1 =7 ;/* SIP + DIP, 8 bytes */
@@ -4133,16 +4136,18 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg) field->bytesm1 =3 ;/* DIP, 4 bytes */ } } - field->ltype_mask =NPC_LT_LC_IP_MATCH_MSK ; keyoff_marker = false;break ;case NIX_FLOW_KEY_TYPE_IPV6 :case NIX_FLOW_KEY_TYPE_INNR_IPV6 : field->lid =NPC_LID_LC ; field->ltype_match =NPC_LT_LC_IP6 ; + field->ltype_mask =NPC_LT_LC_IP6_MATCH_MSK ; +if (key_type ==NIX_FLOW_KEY_TYPE_INNR_IPV6 ) { field->lid =NPC_LID_LG ; field->ltype_match =NPC_LT_LG_TU_IP6 ; + field->ltype_mask =0xF ; } field->hdr_offset =8 ;/* SIP offset */ field->bytesm1 =31 ;/* SIP + DIP, 32 bytes */
@@ -4162,7 +4167,6 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg) field->bytesm1 =15 ;/* DIP,16 bytes */ } } - field->ltype_mask =NPC_LT_LC_IP6_MATCH_MSK ;break ;case NIX_FLOW_KEY_TYPE_TCP :case NIX_FLOW_KEY_TYPE_UDP :
Signature · 1 line
2.25.1
[email protected]
AI reviewThis 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 code inspection). If it was triggered please include the symptoms, like the stack trace or error 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. If the series needs another revision for other reasons, please include the information in the commit messages then.
The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).
- [Medium] The patch fixes an RSS regression but has no Fixes: tag.
- [Low] The commit message gets the layer and the failure mode wrong.
--
octeontx2-af: fix inner LC ltype match for RSS flowkey
This commit changes set_flowkey_fields() in rvu_nix.c so that the inner IPv4 and IPv6 RSS flowkey fields use an exact ltype mask of 0xF instead of NPC_LT_LC_IP_MATCH_MSK and NPC_LT_LC_IP6_MATCH_MSK. The outer IPv4 and IPv6 masks stay the same.
Quoted 7 lines
octeontx2-af: fix inner LC ltype match for RSS flowkey
Inner LC ltypes differ from outer LC ltypes, but RSS flowkey programming was using outer LC IP/IP6 ltype masks for inner IP keys.
For inner IPv4/IPv6, match only the base IP ltype and do not include extension-header matches. Keep existing outer LC masks unchanged.
[Severity: Low]
Is this description accurate? In set_flowkey_fields(), the inner IP keys are on layer LG, not LC:
if (key_type == NIX_FLOW_KEY_TYPE_INNR_IPV6) {
field->lid = NPC_LID_LG;
field->ltype_match = NPC_LT_LG_TU_IP6;LG also has no extension-header ltypes that could be included:
drivers/net/ethernet/marvell/octeontx2/af/npc.h:
enum npc_kpu_lg_ltype {
NPC_LT_LG_TU_IP = 1,
NPC_LT_LG_TU_IP6,
NPC_LT_LG_TU_ARP,
NPC_LT_LG_TU_ETHER_IN_NSH,
NPC_LT_LG_CUSTOM0 = 0xE,
NPC_LT_LG_CUSTOM1 = 0xF,
};NPC_LT_LC_IP_MATCH_MSK and NPC_LT_LC_IP6_MATCH_MSK both evaluate to 0xE.
With match 2 and mask 0xE, INNR_IPV6 also matches NPC_LT_LG_TU_ARP (3). The default KPU profile emits that ltype. As a result, tunnelled inner ARP packets get 32 bytes at offset 8 of the ARP header hashed as an IPv6 SIP/DIP.
With match 1 and mask 0xE, INNR_IPV4 either aliases with LG ltype 0 (no inner layer) or never matches. Which one happens depends on how the hardware applies the mask to LTYPE_MATCH. The hash code in rvu_npc_hash.c compares (ltype & ltype_mask) against the match value, which points to the never-match case.
Could the subject and body name the LG layer and describe these effects, so it is clear which traffic was mis-hashed?
Quoted 5 lines
This fixes inner-tunnel RSS key calculation and prevents mismatches in inner IP flow classification.
Signed-off-by kmahammadraf <[email protected]>Signed-off-by Kiran Kumar K <[email protected]>
[Severity: Medium]
Should this patch carry Fixes: tags?
Before July 2024, set_flowkey_fields() set field->ltype_mask = 0xF after the INNR_* override. The inner keys therefore matched NPC_LT_LG_TU_IP and NPC_LT_LG_TU_IP6 exactly.
Two commits then changed that trailing assignment:
e23ac1095b9e ("octeontx2-af: fix issue with IPv6 ext match for RSS") 60795bbf0476 ("octeontx2-af: fix issue with IPv4 match for RSS")
They switched it to NPC_LT_LC_IP6_MATCH_MSK and NPC_LT_LC_IP_MATCH_MSK. The assignment runs after the INNR_* override, so the 0xE mask was also applied to the LG inner IP keys. This patch puts 0xF back for the inner keys only, which reverses that regression.
Both commits carry Fixes: 41a7aa7b800d, so they are probably in stable trees already. Would adding the following tags let this fix reach those trees?
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261023071905.2922825-1-kmahammadraf%40marvell.com
This patch was applied to netdev/net.git (main) by Dave Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main) by Dave Miller <[email protected]>:
Quoted 9 lines · On Fri, 23 Oct 2026 07:19:05 +0000 you wrote:
From: Kiran Kumar K <[email protected]>
Inner LC ltypes differ from outer LC ltypes, but RSS flowkey programming was using outer LC IP/IP6 ltype masks for inner IP keys.
For inner IPv4/IPv6, match only the base IP ltype and do not include extension-header matches. Keep existing outer LC masks unchanged.
[...]
Here is the summary with links:
- [net] octeontx2-af: fix inner LC ltype match for RSS flowkey
https://git.kernel.org/netdev/net/c/22dd6bb2bafd
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html