Netdev List
 help / color / mirror / Atom feed
* [PATCH net] octeontx2-af: fix inner LC ltype match for RSS flowkey
@ 2026-10-23  7:19 kmahammadraf
  2026-10-23  7:22 ` netdev-bot+sinfo
  2026-10-27  7:56 ` netdev-bot+sashiko
  0 siblings, 2 replies; 3+ messages in thread
From: kmahammadraf @ 2026-10-23  7:19 UTC (permalink / raw)
  To: linux-kernel, netdev
  Cc: Sunil Goutham, Ratheesh Kannoth, Geetha sowjanya,
	Subbaraya Sundeep, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Kiran Kumar K, kmahammadraf

From: Kiran Kumar K <kirankumark@marvell.com>

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.

Signed-off-by: kmahammadraf <kmahammadraf@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
---
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
index 95f782d47927..9cace7c4c9e1 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
@@ -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:
-- 
2.25.1


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

* Re: [PATCH net] octeontx2-af: fix inner LC ltype match for RSS flowkey
  2026-10-23  7:19 [PATCH net] octeontx2-af: fix inner LC ltype match for RSS flowkey kmahammadraf
@ 2026-10-23  7:22 ` netdev-bot+sinfo
  2026-10-27  7:56 ` netdev-bot+sashiko
  1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-10-23  7:22 UTC (permalink / raw)
  To: kmahammadraf
  Cc: linux-kernel, netdev, Sunil Goutham, Ratheesh Kannoth,
	Geetha sowjanya, Subbaraya Sundeep, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Kiran Kumar K

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.

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

* Re: [PATCH net] octeontx2-af: fix inner LC ltype match for RSS flowkey
  2026-10-23  7:19 [PATCH net] octeontx2-af: fix inner LC ltype match for RSS flowkey kmahammadraf
  2026-10-23  7:22 ` netdev-bot+sinfo
@ 2026-10-27  7:56 ` netdev-bot+sashiko
  1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sashiko @ 2026-10-27  7:56 UTC (permalink / raw)
  To: kmahammadraf
  Cc: linux-kernel, netdev, sgoutham, rkannoth, gakula, sbhatta,
	andrew+netdev, davem, edumazet, kuba, pabeni, kirankumark

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.

> 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?

> This fixes inner-tunnel RSS key calculation and prevents mismatches in
> inner IP flow classification.
>
> Signed-off-by: kmahammadraf <kmahammadraf@marvell.com>
> Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>

[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?

Fixes: 60795bbf0476 ("octeontx2-af: fix issue with IPv4 match for RSS")
Fixes: e23ac1095b9e ("octeontx2-af: fix issue with IPv6 ext match for RSS")

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261023071905.2922825-1-kmahammadraf%40marvell.com

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

end of thread, other threads:[~2026-10-27  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-23  7:19 [PATCH net] octeontx2-af: fix inner LC ltype match for RSS flowkey kmahammadraf
2026-10-23  7:22 ` netdev-bot+sinfo
2026-10-27  7:56 ` netdev-bot+sashiko

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