From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Stanislav Fomichev <stfomichev@gmail.com>
Cc: <bpf@vger.kernel.org>, <ast@kernel.org>, <daniel@iogearbox.net>,
<andrii@kernel.org>, <netdev@vger.kernel.org>,
<magnus.karlsson@intel.com>, <kerneljasonxing@gmail.com>
Subject: Re: [PATCH bpf-next 1/3] xsk: avoid overwriting skb fields for multi-buffer traffic
Date: Tue, 23 Sep 2025 17:43:32 +0200 [thread overview]
Message-ID: <aNLAJJoWLibivhXR@boxer> (raw)
In-Reply-To: <aNGGjMFT_bsByxcZ@mini-arch>
On Mon, Sep 22, 2025 at 10:25:32AM -0700, Stanislav Fomichev wrote:
> On 09/22, Maciej Fijalkowski wrote:
> > We are unnecessarily setting a bunch of skb fields per each processed
> > descriptor, which is redundant for fragmented frames.
> >
> > Let us set these respective members for first fragment only.
> >
> > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> > ---
> > net/xdp/xsk.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
> > index 72e34bd2d925..72194f0a3fc0 100644
> > --- a/net/xdp/xsk.c
> > +++ b/net/xdp/xsk.c
> > @@ -758,6 +758,10 @@ static struct sk_buff *xsk_build_skb(struct xdp_sock *xs,
> > goto free_err;
> >
> > xsk_set_destructor_arg(skb, desc->addr);
> > + skb->dev = dev;
> > + skb->priority = READ_ONCE(xs->sk.sk_priority);
> > + skb->mark = READ_ONCE(xs->sk.sk_mark);
> > + skb->destructor = xsk_destruct_skb;
> > } else {
> > int nr_frags = skb_shinfo(skb)->nr_frags;
> > struct xsk_addr_node *xsk_addr;
> > @@ -826,14 +830,10 @@ static struct sk_buff *xsk_build_skb(struct xdp_sock *xs,
> >
> > if (meta->flags & XDP_TXMD_FLAGS_LAUNCH_TIME)
> > skb->skb_mstamp_ns = meta->request.launch_time;
> > + xsk_tx_metadata_to_compl(meta, &skb_shinfo(skb)->xsk_meta);
> > }
> > }
> >
> > - skb->dev = dev;
> > - skb->priority = READ_ONCE(xs->sk.sk_priority);
> > - skb->mark = READ_ONCE(xs->sk.sk_mark);
> > - skb->destructor = xsk_destruct_skb;
> > - xsk_tx_metadata_to_compl(meta, &skb_shinfo(skb)->xsk_meta);
> > xsk_inc_num_desc(skb);
>
> What about IFF_TX_SKB_NO_LINEAR case? I'm not super familiar with
> it, but I don't see priority/mark being set over there after this change.
The thing is I tricked myself with running xskxceiver against the changes
and not seeing issues :< so IFF_TX_SKB_NO_LINEAR case needs a test
coverage pretty badly I'd say...
next prev parent reply other threads:[~2025-09-23 15:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 15:25 [PATCH bpf-next 0/3] xsk: refactors around generic xmit side Maciej Fijalkowski
2025-09-22 15:25 ` [PATCH bpf-next 1/3] xsk: avoid overwriting skb fields for multi-buffer traffic Maciej Fijalkowski
2025-09-22 17:25 ` Stanislav Fomichev
2025-09-23 8:39 ` Jason Xing
2025-09-23 15:43 ` Maciej Fijalkowski [this message]
2025-09-22 15:25 ` [PATCH bpf-next 2/3] xsk: remove @first_frag from xsk_build_skb() Maciej Fijalkowski
2025-09-22 17:48 ` Stanislav Fomichev
2025-09-23 9:25 ` Jason Xing
2025-09-23 9:36 ` Jason Xing
2025-09-24 14:35 ` Maciej Fijalkowski
2025-09-25 0:17 ` Jason Xing
2025-09-25 8:17 ` Jason Xing
2025-09-22 15:26 ` [PATCH bpf-next 3/3] xsk: wrap generic metadata handling onto separate function Maciej Fijalkowski
2025-09-22 17:51 ` Stanislav Fomichev
2025-09-23 9:43 ` Jason Xing
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=aNLAJJoWLibivhXR@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kerneljasonxing@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=stfomichev@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 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).