DPDK patches and discussions
 help / color / mirror / Atom feed
From: Junfeng Guo <junfeng.guo@intel.com>
To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com
Cc: dev@dpdk.org, junfeng.guo@intel.com
Subject: [dpdk-dev] [PATCH v4 2/2] net/iavf: support RSS for IPv6 prefix 64bit
Date: Tue, 15 Sep 2020 16:17:59 +0800	[thread overview]
Message-ID: <20200915081759.4072947-3-junfeng.guo@intel.com> (raw)
In-Reply-To: <20200915081759.4072947-1-junfeng.guo@intel.com>

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 <junfeng.guo@intel.com>
---
 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


  parent reply	other threads:[~2020-09-15  8:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 10:28 [dpdk-dev] [PATCH 0/2] add AVF RSS support for IPv6 prefix Junfeng Guo
2020-08-03 10:28 ` [dpdk-dev] [PATCH 1/2] common/iavf: support virtual channel " Junfeng Guo
2020-08-03 10:28 ` [dpdk-dev] [PATCH 2/2] net/iavf: support RSS for IPv6 prefix 64bit Junfeng Guo
2020-08-04 12:39 ` [dpdk-dev] [PATCH v2 0/3] add AVF RSS support for IPv6 prefix Junfeng Guo
2020-08-04 12:39   ` [dpdk-dev] [PATCH v2 1/3] common/iavf: support virtual channel " Junfeng Guo
2020-08-04 12:39   ` [dpdk-dev] [PATCH v2 2/3] net/iavf: support RSS for IPv6 prefix 64bit Junfeng Guo
2020-08-04 12:39   ` [dpdk-dev] [PATCH v2 3/3] net/iavf: support RSS for GTPU " Junfeng Guo
2020-09-15  6:26   ` [dpdk-dev] [PATCH v3 0/2] add AVF RSS support for IPv6 prefix Junfeng Guo
2020-09-15  6:26     ` [dpdk-dev] [PATCH v3 1/2] net/iavf: replace function name with macro Junfeng Guo
2020-09-15  6:26     ` [dpdk-dev] [PATCH v3 2/2] net/iavf: support RSS for IPv6 prefix 64bit Junfeng Guo
2020-09-15  8:17     ` [dpdk-dev] [PATCH v4 0/2] add AVF RSS support for IPv6 prefix Junfeng Guo
2020-09-15  8:17       ` [dpdk-dev] [PATCH v4 1/2] net/iavf: replace function name with macro Junfeng Guo
2020-09-15  8:17       ` Junfeng Guo [this message]
2020-09-15  8:40       ` [dpdk-dev] [PATCH v4 0/2] add AVF RSS support for IPv6 prefix Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200915081759.4072947-3-junfeng.guo@intel.com \
    --to=junfeng.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).