net/i40e: fix symmetric toeplitz hashing for SCTP
PATCH 1/1 net/i40e: fix symmetric toeplitz hashing for SCTP
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.
--- .mailmap | 1 + drivers/net/intel/i40e/i40e_hash.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-)
.mailmap +1 -0
@@ -136,6 +136,7 @@ Anthony Harivel <[email protected]> Antonio Fischetti <[email protected]> Anup Prabhu <[email protected]> Anupam Kapoor <[email protected]> +Anurag Mandal <[email protected]> Apeksha Gupta <[email protected]> Archana Muniganti <[email protected]> <[email protected]> Archit Pandey <[email protected]>
drivers/net/intel/i40e/i40e_hash.c +14 -2
@@ -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);
Signature · 1 line
2.39.1
PATCH v2 1/1 net/i40e: fix symmetric toeplitz hashing for SCTP
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.
--- .mailmap | 1 + drivers/net/intel/i40e/i40e_hash.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-)
.mailmap +1 -0
@@ -136,6 +136,7 @@ Anthony Harivel <[email protected]> Antonio Fischetti <[email protected]> Anup Prabhu <[email protected]> Anupam Kapoor <[email protected]> +Anurag Mandal <[email protected]> Apeksha Gupta <[email protected]> Archana Muniganti <[email protected]> <[email protected]> Archit Pandey <[email protected]>
drivers/net/intel/i40e/i40e_hash.c +14 -2
@@ -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);
Signature · 1 line
2.39.1
Quoted 4 lines · Anurag Mandal
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.
Quoted 8 lines
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.
Quoted 3 lines
Signed-off-by Anurag Mandal <[email protected]>
Applied to dpdk-next-net-intel
Thanks,
/Bruce