DPDK patches and discussions
 help / color / mirror / Atom feed
From: Visa Hankala <visa@hankala.org>
To: dev@dpdk.org
Cc: Qiming Yang <qiming.yang@intel.com>, Qi Zhang <qi.z.zhang@intel.com>
Subject: [PATCH] net/ice: omit IP protocol id from IP/TCP/UDP RSS
Date: Sun, 20 Aug 2023 10:51:01 +0000	[thread overview]
Message-ID: <pLaaGlbA9NXixga5@hankala.org> (raw)

Omit the IP protocol id from the IP/TCP/UDP RSS templates so that
the hash computation uses only the source and destination addresses,
and ports. Otherwise, the hash input set would contain an extra
IP protocol id word at the start, giving RSS hashes that do not match
the usual 2-tuple and 4-tuple RSS hash algorithms.

In principle, the IP protocol id could be dropped from the hash config
in ice_refine_hash_cfg_l234(). However, it is not obvious which
combination of RTE_ETH_RSS_* flags would preserve the id. Therefore,
remove the id from the templates completely.

Fixes: 38d632cbdc88 ("net/ice: refactor PF RSS")

Signed-off-by: Visa Hankala <visa@hankala.org>
---
 drivers/net/ice/ice_hash.c | 31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index 52646e9408..ab2eab8fdf 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -37,9 +37,6 @@
 #define ICE_GTPU_EH_DWNLINK	0
 #define ICE_GTPU_EH_UPLINK	1
 
-#define ICE_IPV4_PROT		BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)
-#define ICE_IPV6_PROT		BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PROT)
-
 #define VALID_RSS_IPV4_L4	(RTE_ETH_RSS_NONFRAG_IPV4_UDP	| \
 				 RTE_ETH_RSS_NONFRAG_IPV4_TCP	| \
 				 RTE_ETH_RSS_NONFRAG_IPV4_SCTP)
@@ -122,7 +119,7 @@ struct ice_rss_hash_cfg ipv4_tmplt = {
 struct ice_rss_hash_cfg ipv4_udp_tmplt = {
 	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV4 |
 	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_UDP,
-	ICE_FLOW_HASH_ETH | ICE_HASH_UDP_IPV4 | ICE_IPV4_PROT,
+	ICE_FLOW_HASH_ETH | ICE_HASH_UDP_IPV4,
 	ICE_RSS_OUTER_HEADERS,
 	0
 };
@@ -130,7 +127,7 @@ struct ice_rss_hash_cfg ipv4_udp_tmplt = {
 struct ice_rss_hash_cfg ipv4_tcp_tmplt = {
 	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV4 |
 	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_TCP,
-	ICE_FLOW_HASH_ETH | ICE_HASH_TCP_IPV4 | ICE_IPV4_PROT,
+	ICE_FLOW_HASH_ETH | ICE_HASH_TCP_IPV4,
 	ICE_RSS_OUTER_HEADERS,
 	0
 };
@@ -138,7 +135,7 @@ struct ice_rss_hash_cfg ipv4_tcp_tmplt = {
 struct ice_rss_hash_cfg ipv4_sctp_tmplt = {
 	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV4 |
 	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_SCTP,
-	ICE_FLOW_HASH_ETH | ICE_HASH_SCTP_IPV4 | ICE_IPV4_PROT,
+	ICE_FLOW_HASH_ETH | ICE_HASH_SCTP_IPV4,
 	ICE_RSS_OUTER_HEADERS,
 	0
 };
@@ -162,7 +159,7 @@ struct ice_rss_hash_cfg ipv6_frag_tmplt = {
 struct ice_rss_hash_cfg ipv6_udp_tmplt = {
 	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV6 |
 	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_UDP,
-	ICE_FLOW_HASH_ETH | ICE_HASH_UDP_IPV6 | ICE_IPV6_PROT,
+	ICE_FLOW_HASH_ETH | ICE_HASH_UDP_IPV6,
 	ICE_RSS_OUTER_HEADERS,
 	0
 };
@@ -170,7 +167,7 @@ struct ice_rss_hash_cfg ipv6_udp_tmplt = {
 struct ice_rss_hash_cfg ipv6_tcp_tmplt = {
 	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV6 |
 	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_TCP,
-	ICE_FLOW_HASH_ETH | ICE_HASH_TCP_IPV6 | ICE_IPV6_PROT,
+	ICE_FLOW_HASH_ETH | ICE_HASH_TCP_IPV6,
 	ICE_RSS_OUTER_HEADERS,
 	0
 };
@@ -178,7 +175,7 @@ struct ice_rss_hash_cfg ipv6_tcp_tmplt = {
 struct ice_rss_hash_cfg ipv6_sctp_tmplt = {
 	ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_IPV6 |
 	ICE_FLOW_SEG_HDR_IPV_OTHER | ICE_FLOW_SEG_HDR_SCTP,
-	ICE_FLOW_HASH_ETH | ICE_HASH_SCTP_IPV6 | ICE_IPV6_PROT,
+	ICE_FLOW_HASH_ETH | ICE_HASH_SCTP_IPV6,
 	ICE_RSS_OUTER_HEADERS,
 	0
 };
@@ -192,7 +189,7 @@ struct ice_rss_hash_cfg outer_ipv4_inner_ipv4_tmplt = {
 struct ice_rss_hash_cfg outer_ipv4_inner_ipv4_udp_tmplt = {
 	ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
 	ICE_FLOW_SEG_HDR_UDP,
-	ICE_HASH_UDP_IPV4 | ICE_IPV4_PROT,
+	ICE_HASH_UDP_IPV4,
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV4,
 	0
 };
@@ -200,7 +197,7 @@ struct ice_rss_hash_cfg outer_ipv4_inner_ipv4_udp_tmplt = {
 struct ice_rss_hash_cfg outer_ipv4_inner_ipv4_tcp_tmplt = {
 	ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
 	ICE_FLOW_SEG_HDR_TCP,
-	ICE_HASH_TCP_IPV4 | ICE_IPV4_PROT,
+	ICE_HASH_TCP_IPV4,
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV4,
 	0
 };
@@ -215,7 +212,7 @@ struct ice_rss_hash_cfg outer_ipv6_inner_ipv4_tmplt = {
 struct ice_rss_hash_cfg outer_ipv6_inner_ipv4_udp_tmplt = {
 	ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
 	ICE_FLOW_SEG_HDR_UDP,
-	ICE_HASH_UDP_IPV4 | ICE_IPV4_PROT,
+	ICE_HASH_UDP_IPV4,
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV6,
 	0
 };
@@ -223,7 +220,7 @@ struct ice_rss_hash_cfg outer_ipv6_inner_ipv4_udp_tmplt = {
 struct ice_rss_hash_cfg outer_ipv6_inner_ipv4_tcp_tmplt = {
 	ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |
 	ICE_FLOW_SEG_HDR_TCP,
-	ICE_HASH_TCP_IPV4 | ICE_IPV4_PROT,
+	ICE_HASH_TCP_IPV4,
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV6,
 	0
 };
@@ -238,7 +235,7 @@ struct ice_rss_hash_cfg outer_ipv4_inner_ipv6_tmplt = {
 struct ice_rss_hash_cfg outer_ipv4_inner_ipv6_udp_tmplt = {
 	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
 	ICE_FLOW_SEG_HDR_UDP,
-	ICE_HASH_UDP_IPV6 | ICE_IPV6_PROT,
+	ICE_HASH_UDP_IPV6,
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV4,
 	0
 };
@@ -246,7 +243,7 @@ struct ice_rss_hash_cfg outer_ipv4_inner_ipv6_udp_tmplt = {
 struct ice_rss_hash_cfg outer_ipv4_inner_ipv6_tcp_tmplt = {
 	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
 	ICE_FLOW_SEG_HDR_TCP,
-	ICE_HASH_TCP_IPV6 | ICE_IPV6_PROT,
+	ICE_HASH_TCP_IPV6,
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV4,
 	0
 };
@@ -260,7 +257,7 @@ struct ice_rss_hash_cfg outer_ipv6_inner_ipv6_tmplt = {
 struct ice_rss_hash_cfg outer_ipv6_inner_ipv6_udp_tmplt = {
 	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
 	ICE_FLOW_SEG_HDR_UDP,
-	ICE_HASH_UDP_IPV6 | ICE_IPV6_PROT,
+	ICE_HASH_UDP_IPV6,
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV6,
 	0
 };
@@ -268,7 +265,7 @@ struct ice_rss_hash_cfg outer_ipv6_inner_ipv6_udp_tmplt = {
 struct ice_rss_hash_cfg outer_ipv6_inner_ipv6_tcp_tmplt = {
 	ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER |
 	ICE_FLOW_SEG_HDR_TCP,
-	ICE_HASH_TCP_IPV6 | ICE_IPV6_PROT,
+	ICE_HASH_TCP_IPV6,
 	ICE_RSS_INNER_HEADERS_W_OUTER_IPV6,
 	0
 };

             reply	other threads:[~2023-08-20 10:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-20 10:51 Visa Hankala [this message]
2023-08-21  7:31 ` 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=pLaaGlbA9NXixga5@hankala.org \
    --to=visa@hankala.org \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@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).