netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ahmed Zaki <ahmed.zaki@intel.com>
Cc: netdev@vger.kernel.org, jesse.brandeburg@intel.com,
	anthony.l.nguyen@intel.com,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Subject: Re: [RFC PATCH net-next 1/3] net: ethtool: add symmetric Toeplitz RSS hash function
Date: Thu, 24 Aug 2023 11:14:55 -0700	[thread overview]
Message-ID: <20230824111455.686e98b4@kernel.org> (raw)
In-Reply-To: <20230823164831.3284341-2-ahmed.zaki@intel.com>

CC Willem

On Wed, 23 Aug 2023 10:48:29 -0600 Ahmed Zaki wrote:
> Symmetric RSS hash functions are beneficial in applications that monitor
> both Tx and Rx packets of the same flow (IDS, software firewalls, ..etc).
> Getting all traffic of the same flow on the same RX queue results in
> higher CPU cache efficiency.
> 
> Allow ethtool to support symmetric Toeplitz algorithm. A user can set the
> RSS function of the netdevice via:
>     # ethtool -X eth0 hfunc symmetric_toeplitz

Looks fairly reasonable, but there are two questions we need to answer:
 - what do we do if RXH config includes fields which are by definition
   not symmetric (l2 DA or in the future flow label)?
 - my initial thought was the same as Saeed's - that the fields are
   sorted, so how do we inform user about the exact implementation?

One way to fix both problems would be to, instead of changing the hash
function, change the RXH config. Add new "xor-ed" fields there.

Another would be to name the function "XORSYM_TOP" and make the core
check that it cannot be combined with uni-dir fields?

I like the first option more.

Either way, please make sure to add docs, and extend the toeplitz test
for this.

> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 62b61527bcc4..9a8e1fb7170d 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -60,10 +60,11 @@ enum {
>  	ETH_RSS_HASH_TOP_BIT, /* Configurable RSS hash function - Toeplitz */
>  	ETH_RSS_HASH_XOR_BIT, /* Configurable RSS hash function - Xor */
>  	ETH_RSS_HASH_CRC32_BIT, /* Configurable RSS hash function - Crc32 */
> +	ETH_RSS_HASH_SYM_TOP_BIT, /* Configurable RSS hash function - Symmetric Toeplitz */
>  
>  	/*
>  	 * Add your fresh new hash function bits above and remember to update
> -	 * rss_hash_func_strings[] in ethtool.c
> +	 * rss_hash_func_strings[] in ethtool/common.c
>  	 */
>  	ETH_RSS_HASH_FUNCS_COUNT
>  };
> @@ -108,6 +109,7 @@ enum ethtool_supported_ring_param {
>  #define __ETH_RSS_HASH(name)	__ETH_RSS_HASH_BIT(ETH_RSS_HASH_##name##_BIT)
>  
>  #define ETH_RSS_HASH_TOP	__ETH_RSS_HASH(TOP)
> +#define ETH_RSS_HASH_SYM_TOP	__ETH_RSS_HASH(SYM_TOP)
>  #define ETH_RSS_HASH_XOR	__ETH_RSS_HASH(XOR)
>  #define ETH_RSS_HASH_CRC32	__ETH_RSS_HASH(CRC32)
>  
> diff --git a/net/ethtool/common.c b/net/ethtool/common.c
> index f5598c5f50de..a0e0c6b2980e 100644
> --- a/net/ethtool/common.c
> +++ b/net/ethtool/common.c
> @@ -81,6 +81,7 @@ rss_hash_func_strings[ETH_RSS_HASH_FUNCS_COUNT][ETH_GSTRING_LEN] = {
>  	[ETH_RSS_HASH_TOP_BIT] =	"toeplitz",
>  	[ETH_RSS_HASH_XOR_BIT] =	"xor",
>  	[ETH_RSS_HASH_CRC32_BIT] =	"crc32",
> +	[ETH_RSS_HASH_SYM_TOP_BIT] =	"symmetric_toeplitz",
>  };
>  
>  const char


  parent reply	other threads:[~2023-08-24 18:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23 16:48 [RFC PATCH net-next 0/3] Support Symmetric Toeplitz RSS hash Ahmed Zaki
2023-08-23 16:48 ` [RFC PATCH net-next 1/3] net: ethtool: add symmetric Toeplitz RSS hash function Ahmed Zaki
2023-08-23 19:45   ` Saeed Mahameed
2023-08-24 13:14     ` Ahmed Zaki
2023-08-24 18:36       ` Saeed Mahameed
2023-08-24 22:56         ` Ahmed Zaki
2023-08-24 23:30           ` Willem de Bruijn
2023-08-25 21:21             ` Ahmed Zaki
2023-08-24 18:14   ` Jakub Kicinski [this message]
2023-08-24 22:55     ` Ahmed Zaki
2023-08-25  0:43       ` Jakub Kicinski
2023-08-25 20:46         ` Ahmed Zaki
2023-08-26  0:49           ` Jakub Kicinski
2023-08-30 18:11             ` Ahmed Zaki
2023-08-23 16:48 ` [RFC PATCH net-next 2/3] ice: fix ICE_AQ_VSI_Q_OPT_RSS_* register values Ahmed Zaki
2023-08-23 16:48 ` [RFC PATCH net-next 3/3] ice: add support for symmetric Toeplitz RSS hash function Ahmed Zaki

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=20230824111455.686e98b4@kernel.org \
    --to=kuba@kernel.org \
    --cc=ahmed.zaki@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=willemdebruijn.kernel@gmail.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).