net/ice: fix wrong IP RSS configuration template
PATCH 1/1 net/ice: fix wrong IP RSS configuration template
To enable IP fragment RSS hash, ICE_FLOW_SEG_HDR_IPV_FRAG is added to the IP RSS configuration template, together with ICE_FLOW_SEG_HDR_IPV_OTHER. It will cause error when associating flow profile. And packet id field for RSS is not correctly added when IP fragment is enabled. To fix this issue, this patch only selects one of the above two segment header types based on rss types.
--- drivers/net/ice/ice_hash.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/net/ice/ice_hash.c +11 -10
@@ -111,7 +111,6 @@ ice_hash_parse_pattern_action(struct ice_adapter *ad,/* Rss configuration template */ struct ice_rss_hash_cfg ipv4_tmplt = {ICE_FLOW_SEG_HDR_ETH |ICE_FLOW_SEG_HDR_IPV4 | -ICE_FLOW_SEG_HDR_IPV_FRAG |ICE_FLOW_SEG_HDR_IPV_OTHER ,ICE_FLOW_HASH_ETH |ICE_FLOW_HASH_IPV4 ,ICE_RSS_OUTER_HEADERS ,
@@ -152,8 +151,7 @@ struct ice_rss_hash_cfg ipv6_tmplt = {struct ice_rss_hash_cfg ipv6_frag_tmplt = {ICE_FLOW_SEG_HDR_ETH |ICE_FLOW_SEG_HDR_IPV6 | -ICE_FLOW_SEG_HDR_IPV_FRAG | -ICE_FLOW_SEG_HDR_IPV_OTHER , +ICE_FLOW_SEG_HDR_IPV_FRAG ,ICE_FLOW_HASH_ETH |ICE_FLOW_HASH_IPV6 ,ICE_RSS_ANY_HEADERS ,0
@@ -657,10 +655,13 @@ ice_refine_hash_cfg_l234(struct ice_rss_hash_cfg *hash_cfg, ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_NONFRAG_IPV4_SCTP)) { -if (rss_type Ð_RSS_FRAG_IPV4 ) - *hash_flds &= - ~(BIT_ULL (ICE_FLOW_FIELD_IDX_IPV4_ID )); -else if (rss_type Ð_RSS_L3_SRC_ONLY ) +if (rss_type Ð_RSS_FRAG_IPV4 ) { + *addl_hdrs |=ICE_FLOW_SEG_HDR_IPV_FRAG ; + *addl_hdrs &= ~(ICE_FLOW_SEG_HDR_IPV_OTHER ); + *hash_flds |= +BIT_ULL (ICE_FLOW_FIELD_IDX_IPV4_ID ); + } +if (rss_type Ð_RSS_L3_SRC_ONLY ) *hash_flds &= ~(BIT_ULL (ICE_FLOW_FIELD_IDX_IPV4_DA ));else if (rss_type Ð_RSS_L3_DST_ONLY ) *hash_flds &= ~(BIT_ULL (ICE_FLOW_FIELD_IDX_IPV4_SA ));
@@ -680,9 +681,9 @@ ice_refine_hash_cfg_l234(struct ice_rss_hash_cfg *hash_cfg, ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_NONFRAG_IPV6_SCTP)) {if (rss_type Ð_RSS_FRAG_IPV6 ) - *hash_flds &= - ~(BIT_ULL (ICE_FLOW_FIELD_IDX_IPV6_ID )); -else if (rss_type Ð_RSS_L3_SRC_ONLY ) + *hash_flds |= +BIT_ULL (ICE_FLOW_FIELD_IDX_IPV6_ID ); +if (rss_type Ð_RSS_L3_SRC_ONLY ) *hash_flds &= ~(BIT_ULL (ICE_FLOW_FIELD_IDX_IPV6_DA ));else if (rss_type Ð_RSS_L3_DST_ONLY ) *hash_flds &= ~(BIT_ULL (ICE_FLOW_FIELD_IDX_IPV6_SA ));
Signature · 1 line
2.17.1
Quoted 17 lines
-----Original Message-----
From: Xu, Ting <[email protected]>
Sent: Saturday, May 8, 2021 3:12 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Xu, Ting <[email protected]>; [email protected]
Subject: [PATCH v1] net/ice: fix wrong IP RSS configuration templateTo enable IP fragment RSS hash,
ICE_FLOW_SEG_HDR_IPV_FRAGis added to the IP RSS configuration template, together withICE_FLOW_SEG_HDR_IPV_OTHER.
It will cause error when associating flow profile. And packet id field for RSS is not correctly added when IP fragment is enabled. To fix this issue, this patch only selects one of the above two segment header types based on rss types.
Quoted 4 lines
Fixes 672f321d09ed ("net/ice: support RSS hash for IP fragment")Signed-off-by Ting Xu <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi