mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Don <joshdon@google.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Josh Don <joshdon@google.com>
Subject: [PATCH] udp: Add noinline_for_tracing annotation for udp{,_v6}_send_skb()
Date: Mon, 19 Oct 2026 23:07:58 +0000	[thread overview]
Message-ID: <20261019230758.2960779-1-joshdon@google.com> (raw)

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()").

Assisted-by: LLM
Signed-off-by: Josh Don <joshdon@google.com>
---
 net/ipv4/udp.c | 4 ++--
 net/ipv6/udp.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index b090bd1f59e86..487c8cc8ab206 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1110,8 +1110,8 @@ void udp_set_csum(bool nocheck, struct sk_buff *skb,
 }
 EXPORT_SYMBOL(udp_set_csum);
 
-static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4,
-			struct inet_cork *cork)
+noinline_for_tracing static int
+udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4, struct inet_cork *cork)
 {
 	struct sock *sk = skb->sk;
 	int offset, len, datalen;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 93478d1ad5769..fe92538835176 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1366,8 +1366,8 @@ static void udp6_hwcsum_outgoing(struct sock *sk, struct sk_buff *skb,
  *	Sending
  */
 
-static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6,
-			   struct inet_cork *cork)
+noinline_for_tracing static int
+udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6, struct inet_cork *cork)
 {
 	struct sock *sk = skb->sk;
 	int offset, len, datalen;
-- 
2.56.0.212.g129ede20d9-goog


             reply	other threads:[~2026-10-19 23:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 23:07 Josh Don [this message]
2026-10-19 23:39 ` Willem de Bruijn

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=20261019230758.2960779-1-joshdon@google.com \
    --to=joshdon@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemdebruijn.kernel@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

all inboxes | Powered by JetHome®