Netdev List
 help / color / mirror / Atom feed
From: Joe Damato <jdamato@fastly.com>
To: Daniel Xu <dxu@dxuuu.xyz>
Cc: ecree.xilinx@gmail.com, 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 v2] rxclass: Make output for RSS context action explicit
Date: Mon, 11 Nov 2024 11:27:05 -0800	[thread overview]
Message-ID: <ZzJaiSoer9VAAjHo@LQ3V64L9R2> (raw)
In-Reply-To: <978e1192c07e970b8944c2a729ae42bf97667a53.1731107871.git.dxu@dxuuu.xyz>

On Mon, Nov 11, 2024 at 12:05:38PM -0700, Daniel Xu wrote:
> Currently `ethtool -n` prints out misleading output if the action for an
> ntuple rule is to redirect to an RSS context. 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
> 
> The above output suggests that the HW will direct to queue 0 where in
> reality queue 0 is just the base offset from which the redirection table
> lookup in the RSS context is added to.
> 
> Fix by making output more clear. Also suppress base offset queue for the
> common case of 0. Example of new output:
> 
>     # ./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>
> ---
> Changes from v1:
> * Reword to support queue base offset API
> * Fix compile error
> * Improve wording (also a transcription error)
> 
>  rxclass.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

I tested this on a machine with an mlx5 NIC.

FWIW: I only learned about ring_cookie from this thread, so I don't
feel qualified to give an official "Reviewed-by", but:

Before the patch:

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
sudo ethtool -U eth2 flow-type tcp4 dst-port 11211 context 1

$ 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

After the patch:

$ ./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
	Action: Direct to RSS context id 1

The results after the patch make more sense to me, personally. I
have NOT audited mlx5 at all, so no idea how (or if) it deals with
ring_cookie.

It'd be really great to add the bit about "queue base offset" to the
man page for ethtool.

All that said, since I tested it and it works and makes sense to me:

Tested-by: Joe Damato <jdamato@fastly.com>

  reply	other threads:[~2024-11-11 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11 19:05 [PATCH ethtool-next v2] rxclass: Make output for RSS context action explicit Daniel Xu
2024-11-11 19:27 ` Joe Damato [this message]
2024-11-12 10:03 ` Edward Cree
2024-11-12 15:40 ` Jakub Kicinski
2024-11-13  1:31   ` Daniel Xu

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=ZzJaiSoer9VAAjHo@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