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 BF2E4A04B1; Thu, 27 Aug 2020 09:35:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D54D61C0B0; Thu, 27 Aug 2020 09:35:24 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 94E0B1B951 for ; Thu, 27 Aug 2020 09:35:20 +0200 (CEST) IronPort-SDR: 0Sf/VsH5zk1oF8/gjXrTznQ1fwnW4i0bqMw3scltlDnt0yA8vKeGlysdqC/548puAUAaNV7l+B eWzMNM9TexKQ== X-IronPort-AV: E=McAfee;i="6000,8403,9725"; a="156442301" X-IronPort-AV: E=Sophos;i="5.76,359,1592895600"; d="scan'208";a="156442301" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2020 00:35:18 -0700 IronPort-SDR: 01Mi77PEOukCeujZRITiwtCafwlgKJmCk8g7TJLBgdhaowMB8TfkzzulkvnDRToSdNdrYv4cy6 IES5l+Eix7cw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,359,1592895600"; d="scan'208";a="313147069" Received: from shwdenpg235.ccr.corp.intel.com ([10.240.182.60]) by orsmga002.jf.intel.com with ESMTP; 27 Aug 2020 00:35:16 -0700 From: alvinx.zhang@intel.com To: jia.guo@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, Alvin Zhang Date: Thu, 27 Aug 2020 15:31:20 +0800 Message-Id: <20200827073120.48772-2-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200827073120.48772-1-alvinx.zhang@intel.com> References: <20200827073120.48772-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 --- drivers/net/iavf/iavf_generic_flow.c | 36 +++++++++++ drivers/net/iavf/iavf_generic_flow.h | 8 +++ drivers/net/iavf/iavf_hash.c | 122 ++++++++++++++++++++++++++++++++++- 3 files changed, 164 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c index 321a4dc..44fab4d 100644 --- a/drivers/net/iavf/iavf_generic_flow.c +++ b/drivers/net/iavf/iavf_generic_flow.c @@ -315,6 +315,24 @@ 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, +}; + +enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_gtpc[] = { + RTE_FLOW_ITEM_TYPE_ETH, + RTE_FLOW_ITEM_TYPE_VLAN, + 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 +351,24 @@ 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, +}; + +enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_gtpc[] = { + RTE_FLOW_ITEM_TYPE_ETH, + RTE_FLOW_ITEM_TYPE_VLAN, + 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..eb466f9 100644 --- a/drivers/net/iavf/iavf_generic_flow.h +++ b/drivers/net/iavf/iavf_generic_flow.h @@ -182,10 +182,18 @@ 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[]; +extern enum rte_flow_item_type iavf_pattern_eth_vlan_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[]; +extern enum rte_flow_item_type iavf_pattern_eth_vlan_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 c06b52e..7bc32b0 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,12 @@ 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_eth_vlan_ipv4_gtpc, IAVF_INSET_NONE, + &phint_eth_ipv4_gtpc}, + {iavf_pattern_eth_vlan_ipv6_gtpc, IAVF_INSET_NONE, + &phint_eth_ipv6_gtpc}, {iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty}, }; @@ -290,6 +302,7 @@ struct iavf_hash_flow_cfg { #define PROTO_COUNT_ONE 1 #define PROTO_COUNT_TWO 2 #define PROTO_COUNT_THREE 3 +#define PROTO_COUNT_FOUR 4 #define BUFF_NOUSED 0 #define FIELD_FOR_PROTO_ONLY 0 @@ -445,6 +458,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 +787,37 @@ 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} +}; + +struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv4_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan, + proto_hint_ipv4, proto_hint_udp_only, proto_hint_gtpc_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv4_dst_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan, + proto_hint_ipv4_dst, proto_hint_udp_only, proto_hint_gtpc_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv4_src_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan, + 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 +939,37 @@ 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} +}; + +struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv6_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan, + proto_hint_ipv6, proto_hint_udp_only, proto_hint_gtpc_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv6_dst_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan, + proto_hint_ipv6_dst, proto_hint_udp_only, proto_hint_gtpc_only} +}; + +struct virtchnl_proto_hdrs hdrs_hint_cvlan_ipv6_src_gtpc = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_FOUR, {proto_hint_cvlan, + 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 = { @@ -2267,7 +2346,44 @@ 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_IPV4 | + ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv4_src_gtpc, IAVF_PHINT_IPV4_GTPC}, + {ETH_RSS_C_VLAN | + ETH_RSS_IPV4, + &hdrs_hint_cvlan_ipv4_gtpc, IAVF_PHINT_IPV4_GTPC}, + {ETH_RSS_C_VLAN | + ETH_RSS_IPV4 | ETH_RSS_L3_DST_ONLY, + &hdrs_hint_cvlan_ipv4_dst_gtpc, IAVF_PHINT_IPV4_GTPC}, + {ETH_RSS_C_VLAN | + ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_cvlan_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_IPV6 | + ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv6_src_gtpc, IAVF_PHINT_IPV6_GTPC}, + {ETH_RSS_C_VLAN | + ETH_RSS_IPV6, + &hdrs_hint_cvlan_ipv6_gtpc, IAVF_PHINT_IPV6_GTPC}, + {ETH_RSS_C_VLAN | + ETH_RSS_IPV6 | ETH_RSS_L3_DST_ONLY, + &hdrs_hint_cvlan_ipv6_dst_gtpc, IAVF_PHINT_IPV6_GTPC}, + {ETH_RSS_C_VLAN | + ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_cvlan_ipv6_src_gtpc, IAVF_PHINT_IPV6_GTPC}, + /* GTPU IP */ /* IPv4 GTPU IP IPv4*/ {ETH_RSS_IPV4 | @@ -3841,7 +3957,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