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 28786A04C7; Tue, 15 Sep 2020 10:20:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 903471C0CF; Tue, 15 Sep 2020 10:20:19 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 23A341BFC5 for ; Tue, 15 Sep 2020 10:20:15 +0200 (CEST) IronPort-SDR: Dtn8mLZWTEc+Ct6pa2WH0W7qdDav7xg81nnB8SGZQTKQXMI1utzDL3amyTHcBRtdv2Gu7dggXf Pa2EI3H9lrpQ== X-IronPort-AV: E=McAfee;i="6000,8403,9744"; a="159266462" X-IronPort-AV: E=Sophos;i="5.76,429,1592895600"; d="scan'208";a="159266462" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2020 01:20:15 -0700 IronPort-SDR: ouW7ngRC6/JtF6vf6stn5Fsf+BUGGv3QPe+RoqmXMi+H0IxhELDHW/lxvDqattPigWv/wzmSMq j4k+lhnHUDEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,429,1592895600"; d="scan'208";a="287905866" Received: from dpdk-junfengguo-v3.sh.intel.com ([10.67.119.146]) by fmsmga008.fm.intel.com with ESMTP; 15 Sep 2020 01:20:13 -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, 15 Sep 2020 16:17:59 +0800 Message-Id: <20200915081759.4072947-3-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200915081759.4072947-1-junfeng.guo@intel.com> References: <20200915062609.3786061-1-junfeng.guo@intel.com> <20200915081759.4072947-1-junfeng.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 2/2] 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 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index d8a4dc8bf..61466c072 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -541,6 +541,11 @@ iavf_hash_parse_pattern(struct iavf_pattern_match_item *pattern_match_item, #define REFINE_PROTO_FLD(op, fld) \ VIRTCHNL_##op##_PROTO_HDR_FIELD(hdr, VIRTCHNL_PROTO_HDR_##fld) +#define REPALCE_PROTO_FLD(fld_1, fld_2) \ +do { \ + REFINE_PROTO_FLD(DEL, fld_1); \ + REFINE_PROTO_FLD(ADD, fld_2); \ +} while (0) /* refine proto hdrs base on l2, l3, l4 rss type */ static void @@ -596,6 +601,14 @@ iavf_refine_proto_hdrs_l234(struct virtchnl_proto_hdrs *proto_hdrs, } else { hdr->field_selector = 0; } + if (rss_type & RTE_ETH_RSS_L3_PRE64) { + if (REFINE_PROTO_FLD(TEST, IPV6_SRC)) + REPALCE_PROTO_FLD(IPV6_SRC, + IPV6_PREFIX64_SRC); + if (REFINE_PROTO_FLD(TEST, IPV6_DST)) + REPALCE_PROTO_FLD(IPV6_DST, + IPV6_PREFIX64_DST); + } break; case VIRTCHNL_PROTO_HDR_UDP: if (rss_type & @@ -764,6 +777,16 @@ iavf_any_invalid_rss_type(uint64_t rss_type, uint64_t allow_rss_type) return true; } + /* current ipv6 prefix only supports prefix 64 bits*/ +#define _invalid_prefix_ (RTE_ETH_RSS_L3_PRE32 | \ + RTE_ETH_RSS_L3_PRE40 | \ + RTE_ETH_RSS_L3_PRE48 | \ + RTE_ETH_RSS_L3_PRE56 | \ + RTE_ETH_RSS_L3_PRE96) + + if (rss_type & _invalid_prefix_) + return true; + /* check not allowed RSS type */ #define _RSS_ATTR_ (ETH_RSS_L3_SRC_ONLY | \ ETH_RSS_L3_DST_ONLY | \ -- 2.25.1