[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL+tcoBN9puWX-sTGvTiBN0Hg5oXKR3mjv783YXeR4Bsovuxkw@mail.gmail.com>
Date: Thu, 9 Oct 2025 16:37:56 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
Cc: Alexander Lobakin <aleksander.lobakin@...el.com>, Eric Dumazet <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, Jamal Hadi Salim <jhs@...atatu.com>,
Cong Wang <xiyou.wangcong@...il.com>, Jiri Pirko <jiri@...nulli.us>,
Kuniyuki Iwashima <kuniyu@...gle.com>, Willem de Bruijn <willemb@...gle.com>, netdev@...r.kernel.org,
eric.dumazet@...il.com
Subject: Re: [PATCH RFC net-next 1/5] net: add add indirect call wrapper in skb_release_head_state()
On Wed, Oct 8, 2025 at 3:42 AM Maciej Fijalkowski
<maciej.fijalkowski@...el.com> wrote:
>
> On Tue, Oct 07, 2025 at 05:26:46PM +0200, Alexander Lobakin wrote:
> > From: Eric Dumazet <edumazet@...gle.com>
> > Date: Mon, 6 Oct 2025 19:30:59 +0000
> >
> > > While stress testing UDP senders on a host with expensive indirect
> > > calls, I found cpus processing TX completions where showing
> > > a very high cost (20%) in sock_wfree() due to
> > > CONFIG_MITIGATION_RETPOLINE=y.
> > >
> > > Take care of TCP and UDP TX destructors and use INDIRECT_CALL_3() macro.
> > >
> > > Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> > > ---
> > > net/core/skbuff.c | 4 +++-
> > > 1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> > > index bc12790017b0b5c0be99f8fb9d362b3730fa4eb0..c9c06f9a8d6085f8d0907b412e050a60c835a6e8 100644
> > > --- a/net/core/skbuff.c
> > > +++ b/net/core/skbuff.c
> > > @@ -1136,7 +1136,9 @@ void skb_release_head_state(struct sk_buff *skb)
> > > skb_dst_drop(skb);
> > > if (skb->destructor) {
> > > DEBUG_NET_WARN_ON_ONCE(in_hardirq());
> > > - skb->destructor(skb);
> > > + INDIRECT_CALL_3(skb->destructor,
> > > + tcp_wfree, __sock_wfree, sock_wfree,
> > > + skb);
> >
> > Not sure, but maybe we could add generic XSk skb destructor here as
> > well?
I added the following snippet[1] and only saw a stable ~1% improvement
when sending 64 size packets with xdpsock.
I'm not so sure it deserves a follow-up patch to Eric's series. Better
than nothing? Any ideas on this one?
[1]
INDIRECT_CALL_4(skb->destructor, tcp_wfree, __sock_wfree, sock_wfree,
xsk_destruct_skb, skb);
>> Or it's not that important as generic XSk is not the best way to
> > use XDP sockets?
Yes, it surely matters. At least, virtio_net and veth need this copy
mode. And I've been working on batch xmit to ramp up the generic path.
> >
> > Maciej, what do you think?
>
> I would appreciate it as there has been various attempts to optmize xsk
> generic xmit path.
So do I!
Thanks,
Jason
>
> >
> > > }
> > > #if IS_ENABLED(CONFIG_NF_CONNTRACK)
> > > nf_conntrack_put(skb_nfct(skb));
> >
> > Thanks,
> > Olek
>
Powered by blists - more mailing lists