From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: "Björn Töpel" <bjorn@kernel.org>
Cc: <netdev@vger.kernel.org>, <bpf@vger.kernel.org>,
<magnus.karlsson@intel.com>, <stfomichev@gmail.com>,
<kuba@kernel.org>, <pabeni@redhat.com>, <horms@kernel.org>,
<lorenzo@kernel.org>, <hawk@kernel.org>, <toke@redhat.com>
Subject: Re: [PATCH RFC net-next 4/4] veth: use generic skb XDP handling
Date: Tue, 12 May 2026 19:06:34 +0200 [thread overview]
Message-ID: <agNeGjzEsYRaqqFf@boxer> (raw)
In-Reply-To: <878q9ok8ac.fsf@all.your.base.are.belong.to.us>
On Tue, May 12, 2026 at 04:32:43PM +0200, Björn Töpel wrote:
> Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:
>
> > veth currently runs XDP for skb-backed packets by constructing an
> > xdp_buff and then, for XDP_TX and XDP_REDIRECT, converting that
> > skb-backed xdp_buff into an xdp_frame. The backing memory is still
> > skb-owned, so veth has to pin the skb data and frags manually before
> > consuming the skb.
> >
> > Use the generic skb XDP helper for skb-backed packets instead. This
> > keeps skb-backed packets on the skb generic XDP path: XDP_REDIRECT uses
> > xdp_do_generic_redirect() and XDP_TX uses generic_xdp_tx(). Packets that
> > already arrive as xdp_frames keep using the existing veth xdp_frame path.
> >
> > veth still provides its own page_pool and xdp_rxq_info through struct
> > xdp_generic_ctx. It also keeps using struct veth_xdp_buff storage so
> > metadata kfuncs that need the skb continue to work after a possible skb
> > COW.
>
>
> Hmm, so now if veth with native XDP redirects to a native XDP NIC, we'll
> end up in the generic path? We'll loose some bulking capabilities as
> well, but maybe that's OK.
Hi Bjorn - thanks a lot for taking a look at these changes!
This touches a path where receiver has XDP prog loaded but sender used
ndo_start_xmit() to produce skbs onto another end of veth pair; these skbs
are then stored within ptr_ring where receiver picks them up. Native XDP
still has bulking, however the skb path has a little bit of back-and-forth
juggle between skb<->xdp_frame conversion. Now I got rid of these
conversions but also of home-grown generic XDP path as well as bulking and
the end result seems to land in the same performance results.
Does it make sense to you?
>
> I guess what I'm saying is that some performance numbers would help
> here! ;-)
>
> (I think it might be some accounting bug as well, but I need to re-read
> it!)
>
>
> Björn
next prev parent reply other threads:[~2026-05-12 17:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-09 8:48 [PATCH RFC net-next 0/4] xdp: reuse generic skb XDP handling for veth Maciej Fijalkowski
2026-05-09 8:48 ` [PATCH RFC net-next 1/4] xdp: add mixed page_pool/page_shared memory type Maciej Fijalkowski
2026-05-09 8:48 ` [PATCH RFC net-next 2/4] xdp: return status from generic_xdp_tx() Maciej Fijalkowski
2026-05-12 12:57 ` Björn Töpel
2026-05-12 17:13 ` Maciej Fijalkowski
2026-05-09 8:48 ` [PATCH RFC net-next 3/4] xdp: split generic XDP skb handling Maciej Fijalkowski
2026-05-09 8:48 ` [PATCH RFC net-next 4/4] veth: use generic skb XDP handling Maciej Fijalkowski
2026-05-12 14:32 ` Björn Töpel
2026-05-12 17:06 ` Maciej Fijalkowski [this message]
2026-05-12 12:55 ` [PATCH RFC net-next 0/4] xdp: reuse generic skb XDP handling for veth Björn Töpel
2026-05-12 17:12 ` Maciej Fijalkowski
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=agNeGjzEsYRaqqFf@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.org \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stfomichev@gmail.com \
--cc=toke@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