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 32DC8A04AB; Mon, 31 Aug 2020 08:36:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 06B94137D; Mon, 31 Aug 2020 08:36:18 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B5B21137D for ; Mon, 31 Aug 2020 08:36:16 +0200 (CEST) IronPort-SDR: 4RqbE9ciZKp0CyFOHwOQLJ3WIfyXpWuCp/tkV+dgeIapDibOjdTjbQtH6efwvB5eoNkEZstuDl VrD0z3fCjdsg== X-IronPort-AV: E=McAfee;i="6000,8403,9729"; a="154448456" X-IronPort-AV: E=Sophos;i="5.76,374,1592895600"; d="scan'208";a="154448456" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2020 23:36:15 -0700 IronPort-SDR: mwO1Myf2OrWet4IVIrH11GbLJtVnHurBp9aMX2G1qZQzWV08QJ47e682BAN4Jbz98oWpvf3AA3 8FzHQRp8ES+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,374,1592895600"; d="scan'208";a="314250944" Received: from shwdenpg235.ccr.corp.intel.com ([10.240.182.60]) by orsmga002.jf.intel.com with ESMTP; 30 Aug 2020 23:36:05 -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:32:10 +0800 Message-Id: <20200831063210.50764-2-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200831063210.50764-1-alvinx.zhang@intel.com> References: <20200827073120.48772-1-alvinx.zhang@intel.com> <20200831063210.50764-1-alvinx.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/2] net/iavf: support outer IP hash for GTPC 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 GTPC, now outer IP hash can be configured as input set for GTPC packet. Signed-off-by: Alvin Zhang --- v2: - Remove VLAN as input sets. drivers/net/iavf/iavf_generic_flow.c | 18 +++++++++ drivers/net/iavf/iavf_generic_flow.h | 6 +++ drivers/net/iavf/iavf_hash.c | 77 +++++++++++++++++++++++++++++++++++- 3 files changed, 99 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c index 321a4dc..aaa7c97 100644 --- a/drivers/net/iavf/iavf_generic_flow.c +++ b/drivers/net/iavf/iavf_generic_flow.c @@ -315,6 +315,15 @@ enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[] = { RTE_FLOW_ITEM_TYPE_END, }; +/* IPV4 GTPC */ +enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpc[] = { + RTE_FLOW_ITEM_TYPE_ETH, + RTE_FLOW_ITEM_TYPE_IPV4, + RTE_FLOW_ITEM_TYPE_UDP, + RTE_FLOW_ITEM_TYPE_GTPC, + RTE_FLOW_ITEM_TYPE_END, +}; + /* IPV4 GTPU (EH) */ enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[] = { RTE_FLOW_ITEM_TYPE_ETH, @@ -333,6 +342,15 @@ enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[] = { RTE_FLOW_ITEM_TYPE_END, }; +/* IPV6 GTPC */ +enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpc[] = { + RTE_FLOW_ITEM_TYPE_ETH, + RTE_FLOW_ITEM_TYPE_IPV6, + RTE_FLOW_ITEM_TYPE_UDP, + RTE_FLOW_ITEM_TYPE_GTPC, + RTE_FLOW_ITEM_TYPE_END, +}; + /* IPV6 GTPU (EH) */ enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[] = { RTE_FLOW_ITEM_TYPE_ETH, diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h index f365cc3..c756a08 100644 --- a/drivers/net/iavf/iavf_generic_flow.h +++ b/drivers/net/iavf/iavf_generic_flow.h @@ -182,10 +182,16 @@ extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_icmp6[]; extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[]; +/* IPV4 GTPC */ +extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpc[]; + /* IPv4 GTPU (EH) */ extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[]; extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[]; +/* IPV4 GTPC */ +extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpc[]; + /* IPv6 GTPU (EH) */ extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[]; extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh[]; diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index dfc6822..3658895 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -41,6 +41,8 @@ enum iavf_pattern_hint_type { IAVF_PHINT_IPV6_GTPU_EH = 0x00002000, IAVF_PHINT_IPV6_GTPU_EH_DWNLINK = 0x00004000, IAVF_PHINT_IPV6_GTPU_EH_UPLINK = 0x00008000, + IAVF_PHINT_IPV4_GTPC = 0x00010000, + IAVF_PHINT_IPV6_GTPC = 0x00020000, }; #define IAVF_GTPU_EH_DWNLINK 0 @@ -189,6 +191,10 @@ struct iavf_hash_flow_cfg { IAVF_PHINT_IPV6_TCP}; static struct iavf_pattern_match_type phint_eth_vlan_ipv6_sctp = { IAVF_PHINT_IPV6_SCTP}; +static struct iavf_pattern_match_type phint_eth_ipv4_gtpc = { + IAVF_PHINT_IPV4_GTPC }; +static struct iavf_pattern_match_type phint_eth_ipv6_gtpc = { + IAVF_PHINT_IPV6_GTPC }; /** * Supported pattern for hash. @@ -281,6 +287,8 @@ struct iavf_hash_flow_cfg { &phint_eth_vlan_ipv6_tcp}, {iavf_pattern_eth_vlan_ipv6_sctp, IAVF_INSET_NONE, &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_empty, IAVF_INSET_NONE, &phint_empty}, }; @@ -445,6 +453,10 @@ struct iavf_hash_flow_cfg { FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST) | \ FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED } } +#define proto_hint_gtpc_only { \ + VIRTCHNL_PROTO_HDR_GTPC, \ + FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } } + #define proto_hint_gtpu_ip_teid { \ VIRTCHNL_PROTO_HDR_GTPU_IP, \ FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_GTPU_IP_TEID), {BUFF_NOUSED } } @@ -770,6 +782,22 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_esp = { proto_hint_udp_only, proto_hint_esp } }; +/* IPv4 GTPC */ +struct virtchnl_proto_hdrs hdrs_hint_ipv4_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4, + proto_hint_udp_only, proto_hint_gtpc_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4_dst, + proto_hint_udp_only, proto_hint_gtpc_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv4_src, + proto_hint_udp_only, proto_hint_gtpc_only} +}; + /* IPv4 GTPU IP */ struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_ip = { @@ -891,6 +919,22 @@ struct virtchnl_proto_hdrs hdrs_hint_teid_gtpu_ip = { TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_ip_teid} }; +/* IPv6 GTPC */ +struct virtchnl_proto_hdrs hdrs_hint_ipv6_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6, + proto_hint_udp_only, proto_hint_gtpc_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_dst_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6_dst, + proto_hint_udp_only, proto_hint_gtpc_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_THREE, {proto_hint_ipv6_src, + proto_hint_udp_only, proto_hint_gtpc_only} +}; + /* IPv6 GTPU IP */ struct virtchnl_proto_hdrs hdrs_hint_ipv6_src_gtpu_ip = { @@ -2371,7 +2415,34 @@ struct iavf_hash_match_type iavf_hash_map_list[] = { }; struct iavf_hash_match_type iavf_gtpu_hash_map_list[] = { - /* GTPU */ + /* IPv4 GTPC */ + {ETH_RSS_IPV4, + &hdrs_hint_ipv4_gtpc, IAVF_PHINT_IPV4_GTPC}, + {ETH_RSS_IPV4 | + ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv4_dst_gtpc, IAVF_PHINT_IPV4_GTPC}, + {ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv4_dst_gtpc, IAVF_PHINT_IPV4_GTPC}, + {ETH_RSS_IPV4 | + ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv4_src_gtpc, IAVF_PHINT_IPV4_GTPC}, + {ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv4_src_gtpc, IAVF_PHINT_IPV4_GTPC}, + + /* IPv6 GTPC */ + {ETH_RSS_IPV6, + &hdrs_hint_ipv6_gtpc, IAVF_PHINT_IPV6_GTPC}, + {ETH_RSS_IPV6 | + ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv6_dst_gtpc, IAVF_PHINT_IPV6_GTPC}, + {ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv6_dst_gtpc, IAVF_PHINT_IPV6_GTPC}, + {ETH_RSS_IPV6 | + ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv6_src_gtpc, IAVF_PHINT_IPV6_GTPC}, + {ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv6_src_gtpc, IAVF_PHINT_IPV6_GTPC}, + /* GTPU IP */ /* IPv4 GTPU IP IPv4*/ {ETH_RSS_L3_SRC_ONLY, @@ -4200,7 +4271,9 @@ struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = { (pattern_hint & IAVF_PHINT_IPV6_GTPU_IP) || (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH) || (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH_UPLINK) || - (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH_DWNLINK)) { + (pattern_hint & IAVF_PHINT_IPV6_GTPU_EH_DWNLINK) || + (pattern_hint & IAVF_PHINT_IPV4_GTPC) || + (pattern_hint & IAVF_PHINT_IPV6_GTPC)) { hash_map_list = iavf_gtpu_hash_map_list; mlist_len = RTE_DIM(iavf_gtpu_hash_map_list); } else { -- 1.8.3.1