From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3EA7EA052B; Tue, 28 Jul 2020 11:24:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 159011BFF3; Tue, 28 Jul 2020 11:24:34 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1C13910A3 for ; Tue, 28 Jul 2020 11:24:31 +0200 (CEST) IronPort-SDR: j0W1sxkFCXv07F7EUw7nPcObpIN4H5A5DWVBLd0TjdEC41k1befAcTEo1JG66hL/9dH4TW9Dgo ogrZX4RT/EOA== X-IronPort-AV: E=McAfee;i="6000,8403,9695"; a="215703762" X-IronPort-AV: E=Sophos;i="5.75,405,1589266800"; d="scan'208";a="215703762" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2020 02:24:30 -0700 IronPort-SDR: RK7tebXyYmvBKRHkWdNjzoA9jdvc9SD2xcDNMfUgyWtDju22Io5nTrd6xLrUvjlu8XSuqBUfkW AlnAQ+6JJHCw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,405,1589266800"; d="scan'208";a="312550187" Received: from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128]) by fmsmga004.fm.intel.com with ESMTP; 28 Jul 2020 02:24:28 -0700 From: Jeff Guo To: qi.z.zhang@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, simei.su@intel.com, jia.guo@intel.com Date: Tue, 28 Jul 2020 17:20:57 +0800 Message-Id: <20200728092057.93973-1-jia.guo@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [dpdk-dev v1] net/ice: fix gtpu teid hash X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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