DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anurag Mandal <anurag.mandal@intel.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com,
	Anurag Mandal <anurag.mandal@intel.com>,
	stable@dpdk.org
Subject: [PATCH] net/i40e: fix symmetric toeplitz hashing for SCTP
Date: Tue, 14 Oct 2025 21:37:18 +0530	[thread overview]
Message-ID: <20251014160718.92171-1-anurag.mandal@intel.com> (raw)

When symmetric toeplitz is configured for SCTP, packets belonging
to the same SCTP session are getting distributed to multiple queues
due to improper hash computation.

Removed SCTP Verification Tag from hash computation of symmetric toeplitz
as it changes for same SCTP session.

Tested the following with the fix & enabling symmetric toeplitz for SCTP:-
1. Packets belonging to the same SCTP session getting into the same queue.
2. Packets belonging to the different SCTP sessions getting distributed
to multiple queues.

Fixes: 0e4ae6c7e864 ("net/i40e: fix symmetric toeplitz hashing for SCTP")
Cc: stable@dpdk.org

Signed-off-by: Anurag Mandal <anurag.mandal@intel.com>
---
 .mailmap                           |  1 +
 drivers/net/intel/i40e/i40e_hash.c | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index 0b043cb0c0..1f1265fe20 100644
--- a/.mailmap
+++ b/.mailmap
@@ -136,6 +136,7 @@ Anthony Harivel <aharivel@redhat.com>
 Antonio Fischetti <antonio.fischetti@intel.com>
 Anup Prabhu <aprabhu@marvell.com>
 Anupam Kapoor <anupam.kapoor@gmail.com>
+Anurag Mandal <anurag.mandal@intel.com>
 Apeksha Gupta <apeksha.gupta@nxp.com>
 Archana Muniganti <marchana@marvell.com> <muniganti.archana@caviumnetworks.com>
 Archit Pandey <architpandeynitk@gmail.com>
diff --git a/drivers/net/intel/i40e/i40e_hash.c b/drivers/net/intel/i40e/i40e_hash.c
index 02e1457d80..661215d777 100644
--- a/drivers/net/intel/i40e/i40e_hash.c
+++ b/drivers/net/intel/i40e/i40e_hash.c
@@ -561,7 +561,7 @@ i40e_hash_get_pattern_pctypes(const struct rte_eth_dev *dev,
 }
 
 static uint64_t
-i40e_hash_get_inset(uint64_t rss_types)
+i40e_hash_get_inset(uint64_t rss_types, bool symmetric_enable)
 {
 	uint64_t mask, inset = 0;
 	int i;
@@ -608,6 +608,17 @@ i40e_hash_get_inset(uint64_t rss_types)
 				 I40E_INSET_IPV4_SRC | I40E_INSET_IPV6_SRC);
 	}
 
+	/* SCTP Verification Tag is not required in hash computation for SYMMETRIC_TOEPLITZ */
+	if (symmetric_enable) {
+		mask = rss_types & RTE_ETH_RSS_NONFRAG_IPV4_SCTP;
+		if (mask == RTE_ETH_RSS_NONFRAG_IPV4_SCTP)
+			inset &= ~I40E_INSET_SCTP_VT;
+
+		mask = rss_types & RTE_ETH_RSS_NONFRAG_IPV6_SCTP;
+		if (mask == RTE_ETH_RSS_NONFRAG_IPV6_SCTP)
+			inset &= ~I40E_INSET_SCTP_VT;
+        }
+
 	return inset;
 }
 
@@ -1113,6 +1124,7 @@ i40e_hash_parse_pattern_act(const struct rte_eth_dev *dev,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
 					  NULL,
 					  "RSS Queues not supported when pattern specified");
+	rss_conf->symmetric_enable = false;  /* by default, symmetric is disabled */
 
 	switch (rss_act->func) {
 	case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
@@ -1140,7 +1152,7 @@ i40e_hash_parse_pattern_act(const struct rte_eth_dev *dev,
 
 	rss_conf->conf.func = rss_act->func;
 	rss_conf->conf.types = rss_act->types;
-	rss_conf->inset = i40e_hash_get_inset(rss_act->types);
+	rss_conf->inset = i40e_hash_get_inset(rss_act->types, rss_conf->symmetric_enable);
 
 	return i40e_hash_get_pattern_pctypes(dev, pattern, rss_act,
 					     rss_conf, error);
-- 
2.39.1


             reply	other threads:[~2025-10-14 16:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14 16:07 Anurag Mandal [this message]
2025-10-15 18:11 ` [PATCH v2] " Anurag Mandal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251014160718.92171-1-anurag.mandal@intel.com \
    --to=anurag.mandal@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).