From: Joe Damato <jdamato@fastly.com>
To: Edward Cree <ecree.xilinx@gmail.com>, Daniel Xu <dxu@dxuuu.xyz>,
davem@davemloft.net, mkubecek@suse.cz, kuba@kernel.org,
martin.lau@linux.dev, netdev@vger.kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH ethtool-next] rxclass: Make output for RSS context action explicit
Date: Fri, 8 Nov 2024 12:43:13 -0800 [thread overview]
Message-ID: <Zy534c38QI97WFre@LQ3V64L9R2> (raw)
In-Reply-To: <Zy516d25BMTUWEo4@LQ3V64L9R2>
On Fri, Nov 08, 2024 at 12:34:49PM -0800, Joe Damato wrote:
> On Fri, Nov 08, 2024 at 07:56:41PM +0000, Edward Cree wrote:
> > On 08/11/2024 19:32, Daniel Xu wrote:
> > > Currently, if the action for an ntuple rule is to redirect to an RSS
> > > context, the RSS context is printed as an attribute. At the same time,
> > > a wrong action is printed. For example:
> > >
> > > # ethtool -X eth0 hfunc toeplitz context new start 24 equal 8
> > > New RSS context is 1
> > >
> > > # ethtool -N eth0 flow-type ip6 dst-ip $IP6 context 1
> > > Added rule with ID 0
> > >
> > > # ethtool -n eth0 rule 0
> > > Filter: 0
> > > Rule Type: Raw IPv6
> > > Src IP addr: :: mask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
> > > Dest IP addr: <redacted> mask: ::
> > > Traffic Class: 0x0 mask: 0xff
> > > Protocol: 0 mask: 0xff
> > > L4 bytes: 0x0 mask: 0xffffffff
> > > RSS Context ID: 1
> > > Action: Direct to queue 0
> > >
> > > This is wrong and misleading. Fix by treating RSS context as a explicit
> > > action. The new output looks like this:
> > >
> > > # ./ethtool -n eth0 rule 0
> > > Filter: 0
> > > Rule Type: Raw IPv6
> > > Src IP addr: :: mask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
> > > Dest IP addr: <redacted> mask: ::
> > > Traffic Class: 0x0 mask: 0xff
> > > Protocol: 0 mask: 0xff
> > > L4 bytes: 0x0 mask: 0xffffffff
> > > Action: Direct to RSS context id 1
> > >
> > > Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> >
> > I believe this patch is incorrect. My understanding is that on
> > packet reception, the integer returned from the RSS indirection
> > table is *added* to the queue number from the ntuple rule, so
> > that for instance the same indirection table can be used for one
> > rule distributing packets over queues 0-3 and for another rule
> > distributing a different subset of packets over queues 4-7.
> > I'm not sure if this behaviour is documented anywhere, and
> > different NICs may have different interpretations, but this is
> > how sfc ef10 behaves.
>
> I just wanted to chime in and say that my understanding has always
> been more aligned with Daniel's and I had also found the ethtool
> output confusing when directing flows that match a rule to a custom
> context.
>
> If Daniel's patch is wrong (I don't know enough to say if it is or
> not), would it be possible to have some alternate ethtool output
> that's less confusing? Or for this specific output to be outlined in
> the documentation somewhere?
Sorry for the quick follow up, but I just tested this and I do think
there is an issue with ethtool's output.
Here's an example from my system where I create 18 queues and a
custom RSS context to send flows to queues 16 and 17 only:
$ ethtool --version
ethtool version 6.7
$ sudo ethtool -L eth2 combined 18
$ sudo ethtool -X eth2 weight 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 context new
New RSS context is 1
$ sudo ethtool -U eth2 flow-type tcp4 dst-port 11211 context 1
Added rule with ID 1023
$ sudo ethtool -n eth2 rule 1023
Filter: 1023
Rule Type: TCP over IPv4
Src IP addr: 0.0.0.0 mask: 255.255.255.255
Dest IP addr: 0.0.0.0 mask: 255.255.255.255
TOS: 0x0 mask: 0xff
Src port: 0 mask: 0xffff
Dest port: 11211 mask: 0x0
RSS Context ID: 1
Action: Direct to queue 0
I don't understand why this would say "Direct to queue 0" when the
weights specifically disallow this for context 1.
next prev parent reply other threads:[~2024-11-08 20:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 19:32 [PATCH ethtool-next] rxclass: Make output for RSS context action explicit Daniel Xu
2024-11-08 19:35 ` Daniel Xu
2024-11-08 19:56 ` Edward Cree
2024-11-08 20:34 ` Joe Damato
2024-11-08 20:43 ` Joe Damato [this message]
2024-11-08 21:13 ` Edward Cree
2024-11-08 22:50 ` Daniel Xu
2024-11-09 17:42 ` Jakub Kicinski
2024-11-11 10:47 ` Edward Cree
2024-11-11 18:22 ` Jakub Kicinski
2024-11-12 9:24 ` Edward Cree
2024-11-12 15:24 ` Jakub Kicinski
2024-11-13 3:30 ` Edward Cree
2024-11-14 0:46 ` Jakub Kicinski
2024-11-14 0:46 ` Jakub Kicinski
2024-11-14 23:04 ` Edward Cree
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=Zy534c38QI97WFre@LQ3V64L9R2 \
--to=jdamato@fastly.com \
--cc=davem@davemloft.net \
--cc=dxu@dxuuu.xyz \
--cc=ecree.xilinx@gmail.com \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=martin.lau@linux.dev \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.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).