mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Siddh Raman Pant <siddh.raman.pant@oracle.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] udp: Move back definition of udpv6_encap_needed_key to ipv6 file.
Date: Thu, 23 Oct 2025 14:37:36 +0530	[thread overview]
Message-ID: <20251023090736.99644-1-siddh.raman.pant@oracle.com> (raw)

It makes less sense to remove define of ipv6 variable from ipv6 file
and put it in ipv4 file and declare it in ipv6 file, which was done
in 3d010c8031e3 ("udp: do not accept non-tunnel GSO skbs landing in
a tunnel").

So let's move it back to ipv6 file. It also makes the code similar -
the key is defined right above the respective enable function.

Signed-off-by: Siddh Raman Pant <siddh.raman.pant@oracle.com>
---
I'm not sure why ipv4 key is exported using EXPORT_IPV6_MOD?

 net/ipv4/udp.c | 5 -----
 net/ipv6/udp.c | 4 +++-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 30dfbf73729d..44b08ede7133 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -810,11 +810,6 @@ static inline bool __udp_is_mcast_sock(struct net *net, const struct sock *sk,
 DEFINE_STATIC_KEY_FALSE(udp_encap_needed_key);
 EXPORT_IPV6_MOD(udp_encap_needed_key);
 
-#if IS_ENABLED(CONFIG_IPV6)
-DEFINE_STATIC_KEY_FALSE(udpv6_encap_needed_key);
-EXPORT_IPV6_MOD(udpv6_encap_needed_key);
-#endif
-
 void udp_encap_enable(void)
 {
 	static_branch_inc(&udp_encap_needed_key);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 813a2ba75824..6b92d4f466d5 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -596,7 +596,9 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
 	goto try_again;
 }
 
-DECLARE_STATIC_KEY_FALSE(udpv6_encap_needed_key);
+DEFINE_STATIC_KEY_FALSE(udpv6_encap_needed_key);
+EXPORT_IPV6_MOD(udpv6_encap_needed_key);
+
 void udpv6_encap_enable(void)
 {
 	static_branch_inc(&udpv6_encap_needed_key);
-- 
2.51.0


             reply	other threads:[~2025-10-23  9:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23  9:07 Siddh Raman Pant [this message]
2025-10-23 10:17 ` Sabrina Dubroca
2025-10-23 10:24   ` Siddh Raman Pant
2025-10-24 14:40 ` kernel test robot

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=20251023090736.99644-1-siddh.raman.pant@oracle.com \
    --to=siddh.raman.pant@oracle.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --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®