From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Jason Wang <jasowang@redhat.com>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: ayaka <ayaka@soulik.info>,
netdev@vger.kernel.org, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: tuntap: add ioctl() TUNGETQUEUEINDX to fetch queue index
Date: Tue, 13 Aug 2024 09:22:37 -0400 [thread overview]
Message-ID: <66bb5e1dbf778_6ef1329466@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <CACGkMEt0QF0vnyCM5H8LDywG+gnrq_sf7O8+uYr=_Ko8ncUh3g@mail.gmail.com>
Jason Wang wrote:
> On Tue, Aug 13, 2024 at 1:11 AM Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
> >
> > Jason Wang wrote:
> > > On Fri, Aug 9, 2024 at 10:55 PM Willem de Bruijn
> > > <willemdebruijn.kernel@gmail.com> wrote:
> > > >
> > > > ayaka wrote:
> > > > >
> > > > > Sent from my iPad
> > > >
> > > > Try to avoid ^^^
> > > >
> > >
> > > [...]
> > >
> > > > > 2. Does such a hash operation happen to every packet passing through?
> > > >
> > > > For packets with a local socket, the computation is cached in the
> > > > socket.
> > > >
> > > > For these tunnel packets, see tun_automq_select_queue. Specifically,
> > > > the call to __skb_get_hash_symmetric.
> > > >
> > > > I'm actually not entirely sure why tun has this, rather than defer
> > > > to netdev_pick_tx, which call skb_tx_hash.
> > >
> > > Not sure I get the question, but it needs to use a consistent hash to
> > > match the flows stored before.
> >
> > This is a bit tangential to Randy's original thread, but I would like
> > to understand this part a bit better, if you don't mind.
>
> Comments are more than welcomed. The code is written more than 10
> years, it should have something that can be improved.
>
> >
> > Tun automq calls __skb_get_hash_symmetric instead of the
> > non-symmetrical skb_get_hash of netdev_pick_tx. That makes sense.
> >
> > Also, netdev_pick_tx tries other things first, like XPS.
>
> Right, using XPS may conflict with the user expected behaviour (e.g
> the automatic steering has been documented in the virtio spec, though
> it's best effort somehow).
>
> >
> > Why does automq have to be stateful, keeping a table. Rather than
> > always computing symmetrical_hash % reciprocal_scale(txq, numqueues)
> > directly, as is does when the flow is not found?
> >
> > Just curious, thanks.
>
> You are right, I think we can avoid the hash calculation and depend on
> the fallback in netdev_pick_tx().
>
> Have put this in my backlog.
Great. Thanks for taking a look at that Jason.
It may very well be that standard netdev_pick_tx does not conform to
the virtio spec behavior. But if it does, nice simplification.
If we have to create a variant that takes a bool skip_xps, that's
totally worth it.
next prev parent reply other threads:[~2024-08-13 13:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 11:19 [PATCH] net: tuntap: add ioctl() TUNGETQUEUEINDX to fetch queue index Randy Li
2024-07-31 14:12 ` Willem de Bruijn
2024-07-31 16:45 ` Randy Li
2024-07-31 21:57 ` Willem de Bruijn
2024-08-01 9:15 ` Randy Li
2024-08-01 13:04 ` Willem de Bruijn
2024-08-01 13:36 ` Randy Li
2024-08-01 14:17 ` Willem de Bruijn
2024-08-01 19:52 ` Randy Li
2024-08-02 15:10 ` Willem de Bruijn
2024-08-07 18:54 ` Randy Li
2024-08-08 2:10 ` Willem de Bruijn
2024-08-08 2:49 ` Jason Wang
2024-08-08 3:11 ` Willem de Bruijn
2024-08-08 3:36 ` Jason Wang
2024-08-08 4:16 ` ayaka
2024-08-08 18:48 ` Willem de Bruijn
2024-08-09 4:45 ` ayaka
2024-08-09 14:55 ` Willem de Bruijn
2024-08-12 6:05 ` Jason Wang
2024-08-12 17:10 ` Willem de Bruijn
2024-08-13 3:53 ` Jason Wang
2024-08-13 13:22 ` Willem de Bruijn [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-08-09 4:50 ayaka
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=66bb5e1dbf778_6ef1329466@willemb.c.googlers.com.notmuch \
--to=willemdebruijn.kernel@gmail.com \
--cc=ayaka@soulik.info \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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