]> git.ipfire.org Git - thirdparty/linux.git/commit
bareudp: Store struct sock in struct bareudp_dev.
authorKuniyuki Iwashima <kuniyu@google.com>
Sat, 2 May 2026 03:13:03 +0000 (03:13 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 6 May 2026 00:47:05 +0000 (17:47 -0700)
commitbc773b15eb19ae3e27dd3a3377f2fe006ce5f382
tree1532f782bd4e1d8e8f37cc9fe8624860cccd03d9
parent82720c6196dca23e7b35ebcd3f7314b90eec59f8
bareudp: Store struct sock in struct bareudp_dev.

bareudp does not need to access struct socket itself in the fast
path; it only reads struct sock, and struct socket is only used
for tunnel setup and teardown.

Let's store struct sock directly in struct bareudp_dev.

bareudp_sock_release() is called from dev->netdev_ops->ndo_stop().
synchronize_net() in unregister_netdevice_many_notify() ensures that
inflight bareudp RX fast paths finish before bareudp_dev is freed.

bareudp no longer needs synchronize_rcu() in udp_tunnel_sock_release().

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260502031401.3557229-11-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/bareudp.c