From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Toshiaki Makita <toshiaki.makita1@gmail.com>,
Lorenzo Bianconi <lorenzo@kernel.org>
Subject: Re: [PATCH net-next 2/4] veth: allow enabling NAPI even without XDP
Date: Fri, 16 Apr 2021 20:19:42 +0200 [thread overview]
Message-ID: <871rbagkht.fsf@toke.dk> (raw)
In-Reply-To: <9111f5868bac3d3d4de52263f6df8da051cdfcf9.camel@redhat.com>
Paolo Abeni <pabeni@redhat.com> writes:
> On Fri, 2021-04-16 at 17:29 +0200, Toke Høiland-Jørgensen wrote:
>> Paolo Abeni <pabeni@redhat.com> writes:
>>
>> > On Fri, 2021-04-09 at 16:58 +0200, Toke Høiland-Jørgensen wrote:
>> > > Paolo Abeni <pabeni@redhat.com> writes:
>> > >
>> > > > Currently the veth device has the GRO feature bit set, even if
>> > > > no GRO aggregation is possible with the default configuration,
>> > > > as the veth device does not hook into the GRO engine.
>> > > >
>> > > > Flipping the GRO feature bit from user-space is a no-op, unless
>> > > > XDP is enabled. In such scenario GRO could actually take place, but
>> > > > TSO is forced to off on the peer device.
>> > > >
>> > > > This change allow user-space to really control the GRO feature, with
>> > > > no need for an XDP program.
>> > > >
>> > > > The GRO feature bit is now cleared by default - so that there are no
>> > > > user-visible behavior changes with the default configuration.
>> > > >
>> > > > When the GRO bit is set, the per-queue NAPI instances are initialized
>> > > > and registered. On xmit, when napi instances are available, we try
>> > > > to use them.
>> > >
>> > > Am I mistaken in thinking that this also makes XDP redirect into a veth
>> > > work without having to load an XDP program on the peer device? That's
>> > > been a long-outstanding thing we've been meaning to fix, so that would
>> > > be awesome! :)
>> >
>> > I have not experimented that, and I admit gross ignorance WRT this
>> > argument, but AFAICS the needed bits to get XDP redirect working on
>> > veth are the ptr_ring initialization and the napi instance available.
>> >
>> > With this patch both are in place when GRO is enabled, so I guess XPD
>> > redirect should work, too (modulo bugs for untested scenario).
>>
>> OK, finally got around to testing this; it doesn't quite work with just
>> your patch, because veth_xdp_xmit() still checks for rq->xdp_prog
>> instead of rq->napi. Fixing this indeed enabled veth to be an
>> XDP_REDIRECT target without an XDP program loaded on the peer. So yay!
>> I'll send a followup fixing that check.
>
> Thank you for double checking!
>
>> So with this we seem to have some nice improvements in both
>> functionality and performance when GRO is turned on; so any reason why
>> we shouldn't just flip the default to on?
>
> Uhmmm... patch 3/4 should avoid the GRO overhead for most cases where
> we can't leverage the aggregation benefit, but I'm not 110% sure that
> enabling GRO by default will not cause performance regressions in some
> scenarios.
>
> It this proves to be always a win we can still change the default
> later, I think.
Alright, sure, let's hold off on that and revisit once this has had some
more testing :)
-Toke
next prev parent reply other threads:[~2021-04-16 18:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-09 11:04 [PATCH net-next 0/4] veth: allow GRO even without XDP Paolo Abeni
2021-04-09 11:04 ` [PATCH net-next 1/4] veth: use skb_orphan_partial instead of skb_orphan Paolo Abeni
2021-04-09 11:04 ` [PATCH net-next 2/4] veth: allow enabling NAPI even without XDP Paolo Abeni
2021-04-09 14:58 ` Toke Høiland-Jørgensen
2021-04-09 15:20 ` Paolo Abeni
2021-04-16 15:29 ` Toke Høiland-Jørgensen
2021-04-16 17:26 ` Paolo Abeni
2021-04-16 18:19 ` Toke Høiland-Jørgensen [this message]
2021-04-09 11:04 ` [PATCH net-next 3/4] veth: refine napi usage Paolo Abeni
2021-04-09 14:57 ` Toke Høiland-Jørgensen
2021-04-09 15:07 ` Paolo Abeni
2021-04-09 15:18 ` Toke Høiland-Jørgensen
2021-04-09 11:04 ` [PATCH net-next 4/4] self-tests: add veth tests Paolo Abeni
2021-04-12 0:10 ` [PATCH net-next 0/4] veth: allow GRO even without XDP patchwork-bot+netdevbpf
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=871rbagkht.fsf@toke.dk \
--to=toke@redhat.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=toshiaki.makita1@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.