netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] udp: Move back definition of udpv6_encap_needed_key to ipv6 file.
@ 2025-10-23  9:07 Siddh Raman Pant
  2025-10-23 10:17 ` Sabrina Dubroca
  2025-10-24 14:40 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Siddh Raman Pant @ 2025-10-23  9:07 UTC (permalink / raw)
  To: Willem de Bruijn, David S. Miller, Eric Dumazet; +Cc: netdev, linux-kernel

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] udp: Move back definition of udpv6_encap_needed_key to ipv6 file.
  2025-10-23  9:07 [PATCH] udp: Move back definition of udpv6_encap_needed_key to ipv6 file Siddh Raman Pant
@ 2025-10-23 10:17 ` Sabrina Dubroca
  2025-10-23 10:24   ` Siddh Raman Pant
  2025-10-24 14:40 ` kernel test robot
  1 sibling, 1 reply; 4+ messages in thread
From: Sabrina Dubroca @ 2025-10-23 10:17 UTC (permalink / raw)
  To: Siddh Raman Pant
  Cc: Willem de Bruijn, David S. Miller, Eric Dumazet, netdev,
	linux-kernel

2025-10-23, 14:37:36 +0530, Siddh Raman Pant wrote:
> 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").

It would be good to CC all the authors and reviewers of the patch(es)
you're mentioning.

> 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.

I don't think that works with CONFIG_IPV6=m. The ipv4 code will need
to access the key via udp_encap_needed().


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

So that the ipv6 code can use it via
udp_encap_needed()/udp_unexpected_gso() when it's built as a module.

-- 
Sabrina

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] udp: Move back definition of udpv6_encap_needed_key to ipv6 file.
  2025-10-23 10:17 ` Sabrina Dubroca
@ 2025-10-23 10:24   ` Siddh Raman Pant
  0 siblings, 0 replies; 4+ messages in thread
From: Siddh Raman Pant @ 2025-10-23 10:24 UTC (permalink / raw)
  To: sd@queasysnail.net
  Cc: willemdebruijn.kernel@gmail.com, davem@davemloft.net,
	netdev@vger.kernel.org, edumazet@google.com,
	linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

On Thu, Oct 23 2025 at 15:47:37 +0530, Sabrina Dubroca wrote:
> 2025-10-23, 14:37:36 +0530, Siddh Raman Pant wrote:
> > 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").
> 
> It would be good to CC all the authors and reviewers of the patch(es)
> you're mentioning.
> 
> > 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.
> 
> I don't think that works with CONFIG_IPV6=m. The ipv4 code will need
> to access the key via udp_encap_needed().
> 
> 
> > Signed-off-by: Siddh Raman Pant <siddh.raman.pant@oracle.com>
> > ---
> > I'm not sure why ipv4 key is exported using EXPORT_IPV6_MOD?
> 
> So that the ipv6 code can use it via
> udp_encap_needed()/udp_unexpected_gso() when it's built as a module.

Cool, thank you very much for the explanation! That was what I was
missing.

Please ignore this patch then.

Thanks,
Siddh

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] udp: Move back definition of udpv6_encap_needed_key to ipv6 file.
  2025-10-23  9:07 [PATCH] udp: Move back definition of udpv6_encap_needed_key to ipv6 file Siddh Raman Pant
  2025-10-23 10:17 ` Sabrina Dubroca
@ 2025-10-24 14:40 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-10-24 14:40 UTC (permalink / raw)
  To: Siddh Raman Pant, Willem de Bruijn, David S. Miller, Eric Dumazet
  Cc: oe-kbuild-all, netdev, linux-kernel

Hi Siddh,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]
[also build test ERROR on net/main linus/master v6.18-rc2 next-20251024]
[cannot apply to horms-ipvs/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Siddh-Raman-Pant/udp-Move-back-definition-of-udpv6_encap_needed_key-to-ipv6-file/20251023-171157
base:   net-next/main
patch link:    https://lore.kernel.org/r/20251023090736.99644-1-siddh.raman.pant%40oracle.com
patch subject: [PATCH] udp: Move back definition of udpv6_encap_needed_key to ipv6 file.
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20251024/202510242214.RjDUfVB7-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251024/202510242214.RjDUfVB7-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510242214.RjDUfVB7-lkp@intel.com/

All errors (new ones prefixed by >>):

>> aarch64-linux-ld: net/ipv4/udp.o:(__jump_table+0xe8): undefined reference to `udpv6_encap_needed_key'

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-24 14:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-23  9:07 [PATCH] udp: Move back definition of udpv6_encap_needed_key to ipv6 file Siddh Raman Pant
2025-10-23 10:17 ` Sabrina Dubroca
2025-10-23 10:24   ` Siddh Raman Pant
2025-10-24 14:40 ` kernel test robot

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