From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Ahmed Zaki <ahmed.zaki@intel.com>, Saeed Mahameed <saeed@kernel.org>
Cc: netdev@vger.kernel.org, jesse.brandeburg@intel.com,
anthony.l.nguyen@intel.com
Subject: Re: [RFC PATCH net-next 1/3] net: ethtool: add symmetric Toeplitz RSS hash function
Date: Thu, 24 Aug 2023 19:30:20 -0400 [thread overview]
Message-ID: <64e7e80c13b60_4b65d29437@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <4f0393fb-7f5a-5e91-ce43-4b2d842dd9b3@intel.com>
Ahmed Zaki wrote:
>
> On 2023-08-24 12:36, Saeed Mahameed wrote:
> > On 24 Aug 07:14, Ahmed Zaki wrote:
> >>
> >> On 2023-08-23 13:45, Saeed Mahameed wrote:
> >>> On 23 Aug 10:48, 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.
> >>>>
> >
> > ...
> >
> >>>
> >>> What is the expectation of the symmetric toeplitz hash, how do you
> >>> achieve
> >>> that? by sorting packet fields? which fields?
> >>>
> >>> Can you please provide a link to documentation/spec?
> >>> We should make sure all vendors agree on implementation and
> >>> expectation of
> >>> the symmetric hash function.
> >>
> >> The way the Intel NICs are achieving this hash symmetry is by XORing
> >> the source and destination values of the IP and L4 ports and then
> >> feeding these values to the regular Toeplitz (in-tree) hash algorithm.
> >>
> >> For example, for UDP/IPv4, the input fields for the Toeplitz hash
> >> would be:
> >>
> >> (SRC_IP, DST_IP, SRC_PORT, DST_PORT)
> >>
> >
> > So you mangle the input. This is different than the paper you
> > referenced below which doesn't change the input but it modifies the RSS
> > algorithm and uses a special hash key.
> >
> >> If symmetric Toeplitz is set, the NIC XOR the src and dst fields:
> >>
> >> (SRC_IP^DST_IP , SRC_IP^DST_IP, SRC_PORT^DST_PORT, SRC_PORT^DST_PORT)
> >>
> >> This way, the output hash would be the same for both flow directions.
> >> Same is applicable for IPv6, TCP and SCTP.
> >>
> >
> > I understand the motivation, I just want to make sure the
> > interpretation is
> > clear, I agree with Jakub, we should use a clear name for the ethtool
> > parameter or allow users to select "xor-ed"/"sorted" fields as Jakub
> > suggested.
> >> Regarding the documentation, the above is available in our public
> >> datasheets [2]. In the final version, I can add similar explanation
> >> in the headers (kdoc) and under "Documentation/networking/" so that
> >> there is a clear understanding of the algorithm.
Please do define the behavior.
When I hear symmetric Toeplitz, my initial assumption was also
sorted fields, as implemented in __flow_hash_consistentify.
If this is something else, agreed that that is good to make
crystal clear in name and somewhere in the kernel Documentation.
xor-symmetric hash?
next prev parent reply other threads:[~2023-08-24 23:30 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 [this message]
2023-08-25 21:21 ` Ahmed Zaki
2023-08-24 18:14 ` Jakub Kicinski
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=64e7e80c13b60_4b65d29437@willemb.c.googlers.com.notmuch \
--to=willemdebruijn.kernel@gmail.com \
--cc=ahmed.zaki@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=netdev@vger.kernel.org \
--cc=saeed@kernel.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).