DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: Visa Hankala <visa@hankala.org>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Yang, Qiming" <qiming.yang@intel.com>,
	"orika@nvidia.com" <orika@nvidia.com>
Subject: RE: [PATCH] net/ice: omit IP protocol id from IP/TCP/UDP RSS
Date: Mon, 21 Aug 2023 07:31:13 +0000	[thread overview]
Message-ID: <DM4PR11MB599468CAEDB46DE0A8C4B31DD71EA@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <pLaaGlbA9NXixga5@hankala.org>

Hi Visa:

	This change may potentially disrupt existing usage, particularly for customers who rely on a default 5-tuple hash configuration. These customers require this configuration to distinguish between TCP and UDP traffic with the same IP and port numbers.

	The challenge arises from the absence of an available RSS_TYPE that can instruct the PMD on whether a protocol ID should be included in the hash or not. Therefore, we had to make a decision on a default behavior. (It might be worth considering the 	introduction of a new RSS_TYPE for this purpose, @Ori Kam

	To work around this issue, we've introduced a raw packet filter which allow users to select specific fields as hash keys using a mask. If you require further information or have any questions, please don't hesitate to reach out.

Regards
Qi

> -----Original Message-----
> From: Visa Hankala <visa@hankala.org>
> Sent: Sunday, August 20, 2023 6:51 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: [PATCH] net/ice: omit IP protocol id from IP/TCP/UDP RSS
> 
> 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-21  7:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-20 10:51 Visa Hankala
2023-08-21  7:31 ` Zhang, Qi Z [this message]

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=DM4PR11MB599468CAEDB46DE0A8C4B31DD71EA@DM4PR11MB5994.namprd11.prod.outlook.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=orika@nvidia.com \
    --cc=qiming.yang@intel.com \
    --cc=visa@hankala.org \
    /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).