From: Jeff Guo <jia.guo@intel.com>
To: qi.z.zhang@intel.com, qiming.yang@intel.com
Cc: dev@dpdk.org, simei.su@intel.com, jia.guo@intel.com
Subject: [dpdk-dev] [dpdk-dev v1] net/ice: fix gtpu teid hash
Date: Tue, 28 Jul 2020 17:20:57 +0800 [thread overview]
Message-ID: <20200728092057.93973-1-jia.guo@intel.com> (raw)
Refine gtpu teid hash rule mapping for GTPU_IP/GTPU_EH/GTPU_DWN/GTPU_UP.
Fixes: 37e444b77814 ("net/ice: support hash for GTPU protocols")
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
drivers/net/ice/ice_hash.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index fdfaff7f6..60183bb38 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -479,6 +479,8 @@ struct ice_hash_match_type ice_hash_type_list[] = {
BIT_ULL(ICE_FLOW_FIELD_IDX_L2TPV3_SESS_ID)},
{ETH_RSS_PFCP,
BIT_ULL(ICE_FLOW_FIELD_IDX_PFCP_SEID)},
+ {ETH_RSS_GTPU,
+ BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_IP_TEID)},
/* IPV4 */
{ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY,
BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)},
@@ -1148,21 +1150,25 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
BIT_ULL(ICE_FLOW_FIELD_IDX_NAT_T_ESP_SPI);
}
- /* update hash field for gtpu-ip and gtpu-eh. */
- if (rss_type != ETH_RSS_GTPU)
- break;
- else if (hash_meta->pkt_hdr & ICE_FLOW_SEG_HDR_GTPU_IP)
- hash_meta->hash_flds |=
- BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_IP_TEID);
- else if (hash_meta->pkt_hdr & ICE_FLOW_SEG_HDR_GTPU_EH)
+ /* update hash field for gtpu eh/gtpu dwn/gtpu up. */
+ if (hash_meta->pkt_hdr & ICE_FLOW_SEG_HDR_GTPU_EH) {
+ hash_meta->hash_flds &=
+ ~(BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_IP_TEID));
hash_meta->hash_flds |=
BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_EH_TEID);
- else if (hash_meta->pkt_hdr & ICE_FLOW_SEG_HDR_GTPU_DWN)
+ } else if (hash_meta->pkt_hdr &
+ ICE_FLOW_SEG_HDR_GTPU_DWN) {
+ hash_meta->hash_flds &=
+ ~(BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_IP_TEID));
hash_meta->hash_flds |=
BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_DWN_TEID);
- else if (hash_meta->pkt_hdr & ICE_FLOW_SEG_HDR_GTPU_UP)
+ } else if (hash_meta->pkt_hdr &
+ ICE_FLOW_SEG_HDR_GTPU_UP) {
+ hash_meta->hash_flds &=
+ ~(BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_IP_TEID));
hash_meta->hash_flds |=
BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_UP_TEID);
+ }
break;
--
2.20.1
next reply other threads:[~2020-07-28 9:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-28 9:20 Jeff Guo [this message]
2020-07-29 13:13 ` Zhang, Qi Z
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=20200728092057.93973-1-jia.guo@intel.com \
--to=jia.guo@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=simei.su@intel.com \
/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).