Re: [PATCH] udp: Add noinline_for_tracing annotation for udp{,_v6}_send_skb()

From: Josh Don

Date: Tue Oct 20 2026 - 21:37:28 EST


On Tue, Oct 20, 2026 at 6:49 AM Willem de Bruijn
<willemdebruijn.kernel@xxxxxxxxx> wrote:
>
> Kuniyuki Iwashima wrote:
> > On Mon, 19 Oct 2026 23:07:58 +0000, Josh Don wrote:
> > > We hook udp_send_skb() and udp_v6_send_skb() using BPF fentry programs
> > > to monitor UDP transmits. Both functions are static and have two
> > > callers: udp{,v6}_sendmsg() and udp{,_v6}_push_pending_frames().
> > >
> > > After an FDO profile update, udp_v6_send_skb() is now inlined into
> > > udpv6_sendmsg(), while an out-of-line copy remains for
> > > udp_v6_push_pending_frames(). The fentry program still attaches
> > > successfully, but it is silently bypassed for all uncorked sends.
> > >
> > > To address this, make both functions noinline explicitly for tracing,
> > > as was done for tcp_drop_reason() in commit dbd5e2e79ed8 ("net: tcp:
> > > Add noinline_for_tracing annotation for tcp_drop_reason()").
> >
> > Unlike tcp_drop_reason(), udp_send_skb() is a hot function as
> > inlined by FDO.
> >
> > Did you see how this change affects to udp_rr performance ?
>
> Yes, maybe I was a bit too fast in assuming that this does not
> meaningfully affect performance. A tcp_rr is worthwhile.
>
> Or, since these functions call ip(6)_send_skb, which cannot be
> inlined, perhaps a robust obviously free path is to attach BPF
> hooks to that (and filter on sk_type and sk_protocol).

Thanks folks, I'm looking into Willem's suggestion as an alternative here.