From patchwork Mon Aug 31 06:43:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alvin Zhang X-Patchwork-Id: 76173 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C9857A04AB; Mon, 31 Aug 2020 08:47:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 23942137D; Mon, 31 Aug 2020 08:47:28 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 0681FCF3 for ; Mon, 31 Aug 2020 08:47:25 +0200 (CEST) IronPort-SDR: fNa9D/9IVmlZTHFzKc598QK2u6xeuJjPKY9YPVGx308Ls79AVcPdLolCZSui+FLgh+TsPR8+UA 8pTRQXVn2YlA== X-IronPort-AV: E=McAfee;i="6000,8403,9729"; a="144599260" X-IronPort-AV: E=Sophos;i="5.76,374,1592895600"; d="scan'208";a="144599260" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2020 23:47:24 -0700 IronPort-SDR: gi8BvJxcxxRE7s+tWcWAs/sR/dek1+lW0gSSoCQbrBb0bWl13ASSnjqxyCp6C/WM+DskXzPG0x prhr5tr4z6LQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,374,1592895600"; d="scan'208";a="314253243" Received: from shwdenpg235.ccr.corp.intel.com ([10.240.182.60]) by orsmga002.jf.intel.com with ESMTP; 30 Aug 2020 23:47:22 -0700 From: alvinx.zhang@intel.com To: jia.guo@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, Alvin Zhang Date: Mon, 31 Aug 2020 14:43:28 +0800 Message-Id: <20200831064328.44412-1-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200828080306.48916-1-alvinx.zhang@intel.com> References: <20200828080306.48916-1-alvinx.zhang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2] net/iavf: support outer IP hash for GTPU 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" From: Alvin Zhang Add patterns for GTPU, now outer IP hash can be configured as input set for GTPU packet. Signed-off-by: Alvin Zhang --- v2: - Remove VLAN as input sets. drivers/net/iavf/iavf_hash.c | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index 3658895..29b76f9 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -195,6 +195,10 @@ struct iavf_hash_flow_cfg { IAVF_PHINT_IPV4_GTPC }; static struct iavf_pattern_match_type phint_eth_ipv6_gtpc = { IAVF_PHINT_IPV6_GTPC }; +static struct iavf_pattern_match_type phint_eth_ipv4_gtpu = { + IAVF_PHINT_IPV4_GTPU_IP }; +static struct iavf_pattern_match_type phint_eth_ipv6_gtpu = { + IAVF_PHINT_IPV6_GTPU_IP }; /** * Supported pattern for hash. @@ -289,6 +293,8 @@ struct iavf_hash_flow_cfg { &phint_eth_vlan_ipv6_sctp}, {iavf_pattern_eth_ipv4_gtpc, IAVF_INSET_NONE, &phint_eth_ipv4_gtpc}, {iavf_pattern_eth_ipv6_gtpc, IAVF_INSET_NONE, &phint_eth_ipv6_gtpc}, + {iavf_pattern_eth_ipv4_gtpu, IAVF_INSET_NONE, &phint_eth_ipv4_gtpu}, + {iavf_pattern_eth_ipv6_gtpu, IAVF_INSET_NONE, &phint_eth_ipv6_gtpu}, {iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty}, }; @@ -798,6 +804,22 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpc = { proto_hint_udp_only, proto_hint_gtpc_only} }; +/* IPv4 GTPU */ +struct virtchnl_proto_hdrs hdrs_hint_ipv4_gtpu = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4, + proto_hint_udp_only, proto_hint_gtpu_ip_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpu = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4_dst, + proto_hint_udp_only, proto_hint_gtpu_ip_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4_src, + proto_hint_udp_only, proto_hint_gtpu_ip_only} +}; + /* IPv4 GTPU IP */ struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_ip = { @@ -935,6 +957,22 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_gtpc = { proto_hint_udp_only, proto_hint_gtpc_only} }; +/* IPv6 GTPU */ +struct virtchnl_proto_hdrs hdrs_hint_ipv6_gtpu = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6, + proto_hint_udp_only, proto_hint_gtpu_ip_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_gtpu = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6_dst, + proto_hint_udp_only, proto_hint_gtpu_ip_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_gtpu = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6_src, + proto_hint_udp_only, proto_hint_gtpu_ip_only} +}; + /* IPv6 GTPU IP */ struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_gtpu_ip = { @@ -2443,6 +2481,34 @@ struct iavf_hash_match_type iavf_gtpu_hash_map_list[] = { {ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src_gtpc, IAVF_PHINT_IPV6_GTPC}, + /* IPv4 GTPU */ + {ETH_RSS_IPV4, + &hdrs_hint_ipv4_gtpu, IAVF_PHINT_IPV4_GTPU_IP}, + {ETH_RSS_IPV4 | + ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv4_dst_gtpu, IAVF_PHINT_IPV4_GTPU_IP}, + {ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv4_dst_gtpu, IAVF_PHINT_IPV4_GTPU_IP}, + {ETH_RSS_IPV4 | + ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv4_src_gtpu, IAVF_PHINT_IPV4_GTPU_IP}, + {ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv4_src_gtpu, IAVF_PHINT_IPV4_GTPU_IP}, + + /* IPv6 GTPU */ + {ETH_RSS_IPV6, + &hdrs_hint_ipv6_gtpu, IAVF_PHINT_IPV6_GTPU_IP}, + {ETH_RSS_IPV6 | + ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv6_dst_gtpu, IAVF_PHINT_IPV6_GTPU_IP}, + {ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv6_dst_gtpu, IAVF_PHINT_IPV6_GTPU_IP}, + {ETH_RSS_IPV6 | + ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv6_src_gtpu, IAVF_PHINT_IPV6_GTPU_IP}, + {ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv6_src_gtpu, IAVF_PHINT_IPV6_GTPU_IP}, + /* GTPU IP */ /* IPv4 GTPU IP IPv4*/ {ETH_RSS_L3_SRC_ONLY,