DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v3] net/iavf: fix PROT filed for rss hash
@ 2020-11-03  9:41 Jeff Guo
  2020-11-04 10:08 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Guo @ 2020-11-03  9:41 UTC (permalink / raw)
  To: jingjing.wu, qi.z.zhang, beilei.xing; +Cc: dev, jia.guo

Add PROT field into IPv4 and IPv6 protocol headers for rss hash.

Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
v3:
handle unexpected PROT clearing when refine l2 hdrs

v2:
add prot into the new hdr replace of function modify
---
 drivers/net/iavf/iavf_hash.c | 56 ++++++++++++++++++++++++------------
 1 file changed, 38 insertions(+), 18 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index b56152c5b8..8a5a6bb5a4 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -101,11 +101,23 @@ iavf_hash_parse_pattern_action(struct iavf_adapter *ad,
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST), {BUFF_NOUSED} }
 
+#define proto_hdr_ipv4_with_prot { \
+	VIRTCHNL_PROTO_HDR_IPV4, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT), {BUFF_NOUSED} }
+
 #define proto_hdr_ipv6 { \
 	VIRTCHNL_PROTO_HDR_IPV6, \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC) | \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST), {BUFF_NOUSED} }
 
+#define proto_hdr_ipv6_with_prot { \
+	VIRTCHNL_PROTO_HDR_IPV6, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED} }
+
 #define proto_hdr_udp { \
 	VIRTCHNL_PROTO_HDR_UDP, \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT) | \
@@ -151,13 +163,15 @@ struct virtchnl_proto_hdrs outer_ipv4_tmplt = {
 
 struct virtchnl_proto_hdrs outer_ipv4_udp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 5,
-	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv4,
+	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
+	 proto_hdr_ipv4_with_prot,
 	 proto_hdr_udp}
 };
 
 struct virtchnl_proto_hdrs outer_ipv4_tcp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 5,
-	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv4,
+	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
+	 proto_hdr_ipv4_with_prot,
 	 proto_hdr_tcp}
 };
 
@@ -174,13 +188,15 @@ struct virtchnl_proto_hdrs outer_ipv6_tmplt = {
 
 struct virtchnl_proto_hdrs outer_ipv6_udp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 5,
-	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv6,
+	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
+	 proto_hdr_ipv6_with_prot,
 	 proto_hdr_udp}
 };
 
 struct virtchnl_proto_hdrs outer_ipv6_tcp_tmplt = {
 	TUNNEL_LEVEL_OUTER, 5,
-	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan, proto_hdr_ipv6,
+	{proto_hdr_eth, proto_hdr_svlan, proto_hdr_cvlan,
+	 proto_hdr_ipv6_with_prot,
 	 proto_hdr_tcp}
 };
 
@@ -195,11 +211,11 @@ struct virtchnl_proto_hdrs inner_ipv4_tmplt = {
 };
 
 struct virtchnl_proto_hdrs inner_ipv4_udp_tmplt = {
-	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4, proto_hdr_udp}
+	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4_with_prot, proto_hdr_udp}
 };
 
 struct virtchnl_proto_hdrs inner_ipv4_tcp_tmplt = {
-	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4, proto_hdr_tcp}
+	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv4_with_prot, proto_hdr_tcp}
 };
 
 struct virtchnl_proto_hdrs inner_ipv4_sctp_tmplt = {
@@ -211,11 +227,11 @@ struct virtchnl_proto_hdrs inner_ipv6_tmplt = {
 };
 
 struct virtchnl_proto_hdrs inner_ipv6_udp_tmplt = {
-	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6, proto_hdr_udp}
+	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6_with_prot, proto_hdr_udp}
 };
 
 struct virtchnl_proto_hdrs inner_ipv6_tcp_tmplt = {
-	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6, proto_hdr_tcp}
+	TUNNEL_LEVEL_INNER, 2, {proto_hdr_ipv6_with_prot, proto_hdr_tcp}
 };
 
 struct virtchnl_proto_hdrs inner_ipv6_sctp_tmplt = {
@@ -581,14 +597,16 @@ iavf_refine_proto_hdrs_l234(struct virtchnl_proto_hdrs *proto_hdrs,
 			     ETH_RSS_NONFRAG_IPV4_UDP |
 			     ETH_RSS_NONFRAG_IPV4_TCP |
 			     ETH_RSS_NONFRAG_IPV4_SCTP)) {
-				if (rss_type & ETH_RSS_L3_SRC_ONLY)
+				if (rss_type & ETH_RSS_L3_SRC_ONLY) {
 					REFINE_PROTO_FLD(DEL, IPV4_DST);
-				else if (rss_type & ETH_RSS_L3_DST_ONLY)
+				} else if (rss_type & ETH_RSS_L3_DST_ONLY) {
 					REFINE_PROTO_FLD(DEL, IPV4_SRC);
-				else if (rss_type &
+				} else if (rss_type &
 					 (ETH_RSS_L4_SRC_ONLY |
-					  ETH_RSS_L4_DST_ONLY))
-					hdr->field_selector = 0;
+					  ETH_RSS_L4_DST_ONLY)) {
+					REFINE_PROTO_FLD(DEL, IPV4_DST);
+					REFINE_PROTO_FLD(DEL, IPV4_SRC);
+				}
 			} else {
 				hdr->field_selector = 0;
 			}
@@ -599,14 +617,16 @@ iavf_refine_proto_hdrs_l234(struct virtchnl_proto_hdrs *proto_hdrs,
 			     ETH_RSS_NONFRAG_IPV6_UDP |
 			     ETH_RSS_NONFRAG_IPV6_TCP |
 			     ETH_RSS_NONFRAG_IPV6_SCTP)) {
-				if (rss_type & ETH_RSS_L3_SRC_ONLY)
+				if (rss_type & ETH_RSS_L3_SRC_ONLY) {
 					REFINE_PROTO_FLD(DEL, IPV6_DST);
-				else if (rss_type & ETH_RSS_L3_DST_ONLY)
+				} else if (rss_type & ETH_RSS_L3_DST_ONLY) {
 					REFINE_PROTO_FLD(DEL, IPV6_SRC);
-				else if (rss_type &
+				} else if (rss_type &
 					 (ETH_RSS_L4_SRC_ONLY |
-					  ETH_RSS_L4_DST_ONLY))
-					hdr->field_selector = 0;
+					  ETH_RSS_L4_DST_ONLY)) {
+					REFINE_PROTO_FLD(DEL, IPV6_DST);
+					REFINE_PROTO_FLD(DEL, IPV6_SRC);
+				}
 			} else {
 				hdr->field_selector = 0;
 			}
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/iavf: fix PROT filed for rss hash
  2020-11-03  9:41 [dpdk-dev] [PATCH v3] net/iavf: fix PROT filed for rss hash Jeff Guo
@ 2020-11-04 10:08 ` Zhang, Qi Z
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2020-11-04 10:08 UTC (permalink / raw)
  To: Guo, Jia, Wu, Jingjing, Xing, Beilei; +Cc: dev



> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Tuesday, November 3, 2020 5:42 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Guo, Jia <jia.guo@intel.com>
> Subject: [PATCH v3] net/iavf: fix PROT filed for rss hash
> 
> Add PROT field into IPv4 and IPv6 protocol headers for rss hash.
> 
> Fixes: 91f27b2e39ab ("net/iavf: refactor RSS")
> Signed-off-by: Jeff Guo <jia.guo@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-04 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03  9:41 [dpdk-dev] [PATCH v3] net/iavf: fix PROT filed for rss hash Jeff Guo
2020-11-04 10:08 ` Zhang, Qi Z

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git