Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ahmed Zaki <ahmed.zaki@intel.com>
To: Alexander Duyck <alexander.duyck@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>
Cc: mkubecek@suse.cz, andrew@lunn.ch,
	willemdebruijn.kernel@gmail.com,
	Wojciech Drewek <wojciech.drewek@intel.com>,
	corbet@lwn.net, netdev@vger.kernel.org,
	linux-doc@vger.kernel.org, jesse.brandeburg@intel.com,
	edumazet@google.com, anthony.l.nguyen@intel.com,
	horms@kernel.org, vladimir.oltean@nxp.com,
	intel-wired-lan@lists.osuosl.org, pabeni@redhat.com,
	davem@davemloft.net
Subject: Re: [Intel-wired-lan] [PATCH net-next v4 1/6] net: ethtool: allow symmetric-xor RSS hash for any flow type
Date: Tue, 17 Oct 2023 16:12:11 -0600	[thread overview]
Message-ID: <ef588877-0ec9-43fd-a532-e3605139593b@intel.com> (raw)
In-Reply-To: <CAKgT0Ud4PX1Y6GO9rW+Nvr_y862Cbv3Fpn+YX4wFHEos9rugJA@mail.gmail.com>



On 2023-10-17 14:41, Alexander Duyck wrote:
> On Tue, Oct 17, 2023 at 1:17 PM Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> On Tue, 17 Oct 2023 11:37:52 -0700 Alexander Duyck wrote:
>>>> Algo is also a bit confusing, it's more like key pre-processing?
>>>> There's nothing toeplitz about xoring input fields. Works as well
>>>> for CRC32.. or XOR.
>>>
>>> I agree that the change to the algorithm doesn't necessarily have
>>> anything to do with toeplitz, however it is still a change to the
>>> algorithm by performing the extra XOR on the inputs prior to
>>> processing. That is why I figured it might make sense to just add a
>>> new hfunc value that would mean toeplitz w/ symmetric XOR.
>>
>> XOR is just one form of achieving symmetric hashing, sorting is another.
> 
> Right, but there are huge algorithmic differences between the two.
> With sorting you don't lose any entropy, whereas with XOR you do. For
> example one side effect of XOR is that for every two hosts on the same
> IP subnet the IP subnets will cancel out. As such with the same key
> 192.168.0.1->192.168.0.2 will hash out essentially the same as
> fc::1->fc::2.

I agree of course that we lose entropy by XORing, but don't we also lose 
entropy, for example, if we hash only the L4 dst_port vs (ip_src, 
ip_dst, l4_src, l4_dst,..etc)? we still say we are using the same alg.


>>>> We can use one of the reserved fields of struct ethtool_rxfh to carry
>>>> this extension. I think I asked for this at some point, but there's
>>>> only so much repeated feedback one can send in a day :(
>>>
>>> Why add an extra reserved field when this is just a variant on a hash
>>> function? I view it as not being dissimilar to how we handle TSO or
>>> tx-checksumming. It would make sense to me to just set something like
>>> toeplitz-symmetric-xor to on in order to turn this on.
>>
>> It's entirely orthogonal. {sym-XOR, sym-sort} x {toep, crc, xor} -
>> all combinations can work.
>>
>> Forget the "is it algo or not algo" question, just purely from data
>> normalization perspective, in terms of the API, if combinations make
>> sense they should be controllable independently.
>>
>> https://en.wikipedia.org/wiki/First_normal_form
> 
> I am thinking of this from a software engineering perspective. This
> symmetric-xor aka simplified-toeplitz is actually much cheaper to
> implement in software than the original. As such I would want it to be
> considered a separate algorithm as I could make use of something like
> that when having to implement RSS in QEMU for instance. Based on
> earlier comments it doesn't change the inputs, it just changes how I
> have to handle the data and the key. It starts reducing things down to
> something like the Intel implementation of Flow Director in terms of
> how the key gets generated and hashed.

The key is independent of all of this discussion. It is set by the user 
and whatever that key is, the hardware (after properly configuring what 
fields are XOR'd) will generate the symmetric hash from the input data. 
The "alg" does not handle or manipulate the key.

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2023-10-17 22:12 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 15:49 [Intel-wired-lan] [PATCH net-next v4 0/6] Support symmetric RSS (Toeplitz) hash Ahmed Zaki
2023-10-16 15:49 ` [Intel-wired-lan] [PATCH net-next v4 1/6] net: ethtool: allow symmetric-xor RSS hash for any flow type Ahmed Zaki
2023-10-16 20:17   ` Alexander H Duyck
2023-10-16 21:08     ` Ahmed Zaki
2023-10-16 22:15       ` Alexander Duyck
2023-10-16 22:44         ` Ahmed Zaki
2023-10-16 22:55           ` Alexander Duyck
2023-10-16 23:30             ` Jakub Kicinski
2023-10-17  0:08               ` Ahmed Zaki
2023-10-17 18:42                 ` Alexander Duyck
2023-10-17 19:14                   ` Ahmed Zaki
2023-10-17 20:03                     ` Alexander Duyck
2023-10-17 20:19                       ` Jakub Kicinski
2023-10-17 20:28                         ` Alexander Duyck
2023-10-17 18:37               ` Alexander Duyck
2023-10-17 20:17                 ` Jakub Kicinski
2023-10-17 20:41                   ` Alexander Duyck
2023-10-17 22:12                     ` Ahmed Zaki [this message]
2023-10-18  0:34                     ` Jakub Kicinski
2023-10-18 18:12                       ` Alexander Duyck
2023-10-18 23:50                         ` Jakub Kicinski
2023-10-20 21:24                           ` Ahmed Zaki
2023-10-20 22:33                             ` Jakub Kicinski
2023-10-20 23:14                               ` Ahmed Zaki
2023-10-20 23:49                                 ` Jakub Kicinski
2023-10-21  0:00                                   ` Ahmed Zaki
2023-10-29 12:25                                     ` Gal Pressman
2023-10-29 12:42                                       ` Ahmed Zaki
2023-10-29 12:48                                         ` Gal Pressman
2023-10-29 16:59                                           ` Ahmed Zaki
2023-10-31 12:00                                             ` Gal Pressman
2023-10-31 14:40                                               ` Ahmed Zaki
2023-10-31 14:45                                                 ` Gal Pressman
2023-10-31 15:14                                                   ` Ahmed Zaki
2023-10-31 15:20                                                     ` Jakub Kicinski
2023-10-31 16:13                                                       ` Gal Pressman
2023-10-31 19:57                                                         ` Jakub Kicinski
2023-10-31 16:12                                                     ` Gal Pressman
2023-10-31 14:59                                               ` Alexander Duyck
2023-10-31 16:11                                                 ` Gal Pressman
2023-10-16 15:49 ` [Intel-wired-lan] [PATCH net-next v4 2/6] ice: fix ICE_AQ_VSI_Q_OPT_RSS_* register values Ahmed Zaki
2023-10-16 15:49 ` [Intel-wired-lan] [PATCH net-next v4 3/6] ice: refactor RSS configuration Ahmed Zaki
2023-10-16 15:49 ` [Intel-wired-lan] [PATCH net-next v4 4/6] ice: refactor the FD and RSS flow ID generation Ahmed Zaki
2023-10-16 15:49 ` [Intel-wired-lan] [PATCH net-next v4 5/6] ice: enable symmetric RSS Toeplitz hash for any flow type Ahmed Zaki
2023-10-16 15:49 ` [Intel-wired-lan] [PATCH net-next v4 6/6] iavf: enable symmetric RSS Toeplitz hash 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=ef588877-0ec9-43fd-a532-e3605139593b@intel.com \
    --to=ahmed.zaki@intel.com \
    --cc=alexander.duyck@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=wojciech.drewek@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