From patchwork Tue Aug 4 12:39:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junfeng Guo X-Patchwork-Id: 75159 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 E8D85A053A; Tue, 4 Aug 2020 06:42:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B2C701C037; Tue, 4 Aug 2020 06:42:23 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id AFA5E1BFFA for ; Tue, 4 Aug 2020 06:42:21 +0200 (CEST) IronPort-SDR: cgUVlN5lnCFUK66qNmh5FBeY1tnVaNHH3/K80DqfKGe6y4+AY+8gfHlZvnh+Kwf4LIQfg8kFF/ 6KFtNyyPCm/A== X-IronPort-AV: E=McAfee;i="6000,8403,9702"; a="170335129" X-IronPort-AV: E=Sophos;i="5.75,432,1589266800"; d="scan'208";a="170335129" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2020 21:42:21 -0700 IronPort-SDR: hrsMj3c3UXzkftw40A0ZRmmsBxTCVkhOVidkkGTQ6MUizCa6o6kQ1hlINcyDkuHyYqDQmXa2Q6 KrWs3YJMdN/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,432,1589266800"; d="scan'208";a="315184052" Received: from dpdk-junfengguo-v1.sh.intel.com ([10.67.119.59]) by fmsmga004.fm.intel.com with ESMTP; 03 Aug 2020 21:42:19 -0700 From: Junfeng Guo To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, junfeng.guo@intel.com Date: Tue, 4 Aug 2020 12:39:19 +0000 Message-Id: <20200804123920.485253-3-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200804123920.485253-1-junfeng.guo@intel.com> References: <20200803102814.3081903-1-junfeng.guo@intel.com> <20200804123920.485253-1-junfeng.guo@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 2/3] net/iavf: support RSS for IPv6 prefix 64bit 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" RSS for IPv6 prefix 64bit fields are supported in this patch, so that we can use prefix instead of full IPv6 address for RSS. The prefix here only includes the first 64 bits of both SRC and DST IPv6 address. Signed-off-by: Junfeng Guo --- drivers/net/iavf/iavf_hash.c | 232 +++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index e2eebd2d3..3dc96d0f6 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -445,6 +445,41 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = { FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST) | \ FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED } } +/* IPV6 Prefix 64 for L3 */ +#define proto_hint_ipv6_pre64 { \ + VIRTCHNL_PROTO_HDR_IPV6, \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_SRC) | \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_DST), {BUFF_NOUSED } } + +#define proto_hint_ipv6_pre64_src { \ + VIRTCHNL_PROTO_HDR_IPV6, \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_SRC), {BUFF_NOUSED } } + +#define proto_hint_ipv6_pre64_dst { \ + VIRTCHNL_PROTO_HDR_IPV6, \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_DST), {BUFF_NOUSED } } + +/* IPV6 Prefix 64 for L4 */ +#define proto_hint_ipv6_pre64_prot { \ + VIRTCHNL_PROTO_HDR_IPV6, \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_SRC) | \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_DST) | \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED } } + +#define proto_hint_ipv6_pre64_src_prot { \ + VIRTCHNL_PROTO_HDR_IPV6, \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_SRC) | \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED } } + +#define proto_hint_ipv6_pre64_dst_prot { \ + VIRTCHNL_PROTO_HDR_IPV6, \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_DST) | \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED } } + +#define proto_hint_ipv6_pre64_only_prot { \ + VIRTCHNL_PROTO_HDR_IPV6, \ + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED } } + #define proto_hint_gtpu_ip_teid { \ VIRTCHNL_PROTO_HDR_GTPU_IP, \ FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_GTPU_IP_TEID), {BUFF_NOUSED } } @@ -1999,6 +2034,139 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv6_udp_esp = { proto_hint_udp_only, proto_hint_esp } }; +/* IPV6 Prefix 64 */ +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64 = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_pre64 } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_src = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_pre64_src } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_dst = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_pre64_dst } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_prot = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_pre64_prot } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_src_prot = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_pre64_src_prot } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_dst_prot = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_ipv6_pre64_dst_prot } +}; + +/* IPV6 Prefix 64 UDP */ +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_udp = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_prot, + proto_hint_udp } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_src_udp_src_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_src_prot, + proto_hint_udp_src_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_src_udp_dst_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_src_prot, + proto_hint_udp_dst_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_dst_udp_src_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_dst_prot, + proto_hint_udp_src_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_dst_udp_dst_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_dst_prot, + proto_hint_udp_dst_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_udp_src_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_only_prot, + proto_hint_udp_src_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_udp_dst_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_only_prot, + proto_hint_udp_dst_port } +}; + +/* IPV6 Prefix 64 TCP */ +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_tcp = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_prot, + proto_hint_tcp } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_src_tcp_src_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_src_prot, + proto_hint_tcp_src_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_src_tcp_dst_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_src_prot, + proto_hint_tcp_dst_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_dst_tcp_src_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_dst_prot, + proto_hint_tcp_src_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_dst_tcp_dst_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_dst_prot, + proto_hint_tcp_dst_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_tcp_src_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_only_prot, + proto_hint_tcp_src_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_tcp_dst_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_only_prot, + proto_hint_tcp_dst_port } +}; + +/* IPV6 Prefix 64 SCTP */ +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_sctp = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_prot, + proto_hint_sctp } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_src_sctp_src_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_src_prot, + proto_hint_sctp_src_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_src_sctp_dst_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_src_prot, + proto_hint_sctp_dst_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_dst_sctp_src_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_dst_prot, + proto_hint_sctp_src_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_dst_sctp_dst_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_dst_prot, + proto_hint_sctp_dst_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_sctp_src_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_only_prot, + proto_hint_sctp_src_port } +}; + +struct virtchnl_proto_hdrs hdrs_hint_ipv6_pre64_sctp_dst_port = { + TUNNEL_LEVEL_OUTER, PROTO_COUNT_TWO, {proto_hint_ipv6_pre64_only_prot, + proto_hint_sctp_dst_port } +}; + struct iavf_hash_match_type iavf_hash_map_list[] = { /* IPV4 */ {ETH_RSS_L2_SRC_ONLY, @@ -2151,6 +2319,13 @@ struct iavf_hash_match_type iavf_hash_map_list[] = { &hdrs_hint_ipv6_ah, IAVF_PHINT_IPV6}, {ETH_RSS_L2TPV3, &hdrs_hint_ipv6_l2tpv3, IAVF_PHINT_IPV6}, + /* IPV6 Prefix 64 */ + {ETH_RSS_IPV6_PRE64, + &hdrs_hint_ipv6_pre64, IAVF_PHINT_IPV6}, + {ETH_RSS_IPV6_PRE64 | ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv6_pre64_src, IAVF_PHINT_IPV6}, + {ETH_RSS_IPV6_PRE64 | ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv6_pre64_dst, IAVF_PHINT_IPV6}, /* IPV6 UDP */ {ETH_RSS_L2_SRC_ONLY, &hdrs_hint_eth_src_ipv6_udp, IAVF_PHINT_IPV6_UDP}, @@ -2186,6 +2361,25 @@ struct iavf_hash_match_type iavf_hash_map_list[] = { &hdrs_hint_ipv6_udp_esp, IAVF_PHINT_IPV6_UDP}, {ETH_RSS_NONFRAG_IPV6_UDP, &hdrs_hint_ipv6_udp, IAVF_PHINT_IPV6_UDP}, + /* IPV6 Prefix 64 UDP */ + {ETH_RSS_IPV6_PRE64_UDP, + &hdrs_hint_ipv6_pre64_udp, IAVF_PHINT_IPV6_UDP}, + {ETH_RSS_IPV6_PRE64_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY, + &hdrs_hint_ipv6_pre64_src_udp_src_port, IAVF_PHINT_IPV6_UDP}, + {ETH_RSS_IPV6_PRE64_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY, + &hdrs_hint_ipv6_pre64_src_udp_dst_port, IAVF_PHINT_IPV6_UDP}, + {ETH_RSS_IPV6_PRE64_UDP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY, + &hdrs_hint_ipv6_pre64_dst_udp_src_port, IAVF_PHINT_IPV6_UDP}, + {ETH_RSS_IPV6_PRE64_UDP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY, + &hdrs_hint_ipv6_pre64_dst_udp_dst_port, IAVF_PHINT_IPV6_UDP}, + {ETH_RSS_IPV6_PRE64_UDP | ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv6_pre64_src_prot, IAVF_PHINT_IPV6_UDP}, + {ETH_RSS_IPV6_PRE64_UDP | ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv6_pre64_dst_prot, IAVF_PHINT_IPV6_UDP}, + {ETH_RSS_IPV6_PRE64_UDP | ETH_RSS_L4_SRC_ONLY, + &hdrs_hint_ipv6_pre64_udp_src_port, IAVF_PHINT_IPV6_UDP}, + {ETH_RSS_IPV6_PRE64_UDP | ETH_RSS_L4_DST_ONLY, + &hdrs_hint_ipv6_pre64_udp_dst_port, IAVF_PHINT_IPV6_UDP}, /* IPV6 TCP */ {ETH_RSS_L2_SRC_ONLY, &hdrs_hint_eth_src_ipv6_tcp, IAVF_PHINT_IPV6_TCP}, @@ -2217,6 +2411,25 @@ struct iavf_hash_match_type iavf_hash_map_list[] = { &hdrs_hint_ipv6_tcp_dst_port, IAVF_PHINT_IPV6_TCP}, {ETH_RSS_NONFRAG_IPV6_TCP, &hdrs_hint_ipv6_tcp, IAVF_PHINT_IPV6_TCP}, + /* IPV6 Prefix 64 TCP */ + {ETH_RSS_IPV6_PRE64_TCP, + &hdrs_hint_ipv6_pre64_tcp, IAVF_PHINT_IPV6_TCP}, + {ETH_RSS_IPV6_PRE64_TCP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY, + &hdrs_hint_ipv6_pre64_src_tcp_src_port, IAVF_PHINT_IPV6_TCP}, + {ETH_RSS_IPV6_PRE64_TCP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY, + &hdrs_hint_ipv6_pre64_src_tcp_dst_port, IAVF_PHINT_IPV6_TCP}, + {ETH_RSS_IPV6_PRE64_TCP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY, + &hdrs_hint_ipv6_pre64_dst_tcp_src_port, IAVF_PHINT_IPV6_TCP}, + {ETH_RSS_IPV6_PRE64_TCP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY, + &hdrs_hint_ipv6_pre64_dst_tcp_dst_port, IAVF_PHINT_IPV6_TCP}, + {ETH_RSS_IPV6_PRE64_TCP | ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv6_pre64_src_prot, IAVF_PHINT_IPV6_TCP}, + {ETH_RSS_IPV6_PRE64_TCP | ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv6_pre64_dst_prot, IAVF_PHINT_IPV6_TCP}, + {ETH_RSS_IPV6_PRE64_TCP | ETH_RSS_L4_SRC_ONLY, + &hdrs_hint_ipv6_pre64_tcp_src_port, IAVF_PHINT_IPV6_TCP}, + {ETH_RSS_IPV6_PRE64_TCP | ETH_RSS_L4_DST_ONLY, + &hdrs_hint_ipv6_pre64_tcp_dst_port, IAVF_PHINT_IPV6_TCP}, /* IPV6 SCTP */ {ETH_RSS_L2_SRC_ONLY, &hdrs_hint_eth_src_ipv6_sctp, IAVF_PHINT_IPV6_SCTP}, @@ -2264,6 +2477,25 @@ struct iavf_hash_match_type iavf_hash_map_list[] = { &hdrs_hint_cvlan_ipv6_tcp, IAVF_PHINT_IPV6_TCP}, {ETH_RSS_C_VLAN, &hdrs_hint_cvlan_ipv6_sctp, IAVF_PHINT_IPV6_SCTP}, + /* IPV6 Prefix 64 SCTP */ + {ETH_RSS_IPV6_PRE64_SCTP, + &hdrs_hint_ipv6_pre64_sctp, IAVF_PHINT_IPV6_SCTP}, + {ETH_RSS_IPV6_PRE64_SCTP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY, + &hdrs_hint_ipv6_pre64_src_sctp_src_port, IAVF_PHINT_IPV6_SCTP}, + {ETH_RSS_IPV6_PRE64_SCTP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY, + &hdrs_hint_ipv6_pre64_src_sctp_dst_port, IAVF_PHINT_IPV6_SCTP}, + {ETH_RSS_IPV6_PRE64_SCTP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY, + &hdrs_hint_ipv6_pre64_dst_sctp_src_port, IAVF_PHINT_IPV6_SCTP}, + {ETH_RSS_IPV6_PRE64_SCTP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY, + &hdrs_hint_ipv6_pre64_dst_sctp_dst_port, IAVF_PHINT_IPV6_SCTP}, + {ETH_RSS_IPV6_PRE64_SCTP | ETH_RSS_L3_SRC_ONLY, + &hdrs_hint_ipv6_pre64_src_prot, IAVF_PHINT_IPV6_SCTP}, + {ETH_RSS_IPV6_PRE64_SCTP | ETH_RSS_L3_DST_ONLY, + &hdrs_hint_ipv6_pre64_dst_prot, IAVF_PHINT_IPV6_SCTP}, + {ETH_RSS_IPV6_PRE64_SCTP | ETH_RSS_L4_SRC_ONLY, + &hdrs_hint_ipv6_pre64_sctp_src_port, IAVF_PHINT_IPV6_SCTP}, + {ETH_RSS_IPV6_PRE64_SCTP | ETH_RSS_L4_DST_ONLY, + &hdrs_hint_ipv6_pre64_sctp_dst_port, IAVF_PHINT_IPV6_SCTP}, }; struct iavf_hash_match_type iavf_gtpu_hash_map_list[] = {