mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-23 00:27:30 -04:00
udp_tunnel: Pass struct sock to udp_tunnel_{push,drop}_rx_port().
None of the udp_tunnel users need struct socket in their
fast paths; it is only used for tunnel setup / teardown.
Even udp_tunnel_{push,drop}_rx_port() do not need struct socket.
Let's change udp_tunnel_{push,drop}_rx_port() to take struct
sock instead of struct socket.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260502031401.3557229-5-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
9333d5ff28
commit
8d0012ce1b
@@ -1654,10 +1654,10 @@ static void geneve_offload_rx_ports(struct net_device *dev, bool push)
|
||||
|
||||
list_for_each_entry(gs, &gn->sock_list, list) {
|
||||
if (push) {
|
||||
udp_tunnel_push_rx_port(dev, gs->sock,
|
||||
udp_tunnel_push_rx_port(dev, gs->sock->sk,
|
||||
UDP_TUNNEL_TYPE_GENEVE);
|
||||
} else {
|
||||
udp_tunnel_drop_rx_port(dev, gs->sock,
|
||||
udp_tunnel_drop_rx_port(dev, gs->sock->sk,
|
||||
UDP_TUNNEL_TYPE_GENEVE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3332,9 +3332,9 @@ static void vxlan_offload_rx_ports(struct net_device *dev, bool push)
|
||||
type = UDP_TUNNEL_TYPE_VXLAN;
|
||||
|
||||
if (push)
|
||||
udp_tunnel_push_rx_port(dev, vs->sock, type);
|
||||
udp_tunnel_push_rx_port(dev, vs->sock->sk, type);
|
||||
else
|
||||
udp_tunnel_drop_rx_port(dev, vs->sock, type);
|
||||
udp_tunnel_drop_rx_port(dev, vs->sock->sk, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,9 +127,9 @@ struct udp_tunnel_info {
|
||||
};
|
||||
|
||||
/* Notify network devices of offloadable types */
|
||||
void udp_tunnel_push_rx_port(struct net_device *dev, struct socket *sock,
|
||||
void udp_tunnel_push_rx_port(struct net_device *dev, struct sock *sk,
|
||||
unsigned short type);
|
||||
void udp_tunnel_drop_rx_port(struct net_device *dev, struct socket *sock,
|
||||
void udp_tunnel_drop_rx_port(struct net_device *dev, struct sock *sk,
|
||||
unsigned short type);
|
||||
void udp_tunnel_notify_add_rx_port(struct socket *sock, unsigned short type);
|
||||
void udp_tunnel_notify_del_rx_port(struct socket *sock, unsigned short type);
|
||||
|
||||
@@ -97,10 +97,9 @@ void setup_udp_tunnel_sock(struct net *net, struct sock *sk,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(setup_udp_tunnel_sock);
|
||||
|
||||
void udp_tunnel_push_rx_port(struct net_device *dev, struct socket *sock,
|
||||
void udp_tunnel_push_rx_port(struct net_device *dev, struct sock *sk,
|
||||
unsigned short type)
|
||||
{
|
||||
struct sock *sk = sock->sk;
|
||||
struct udp_tunnel_info ti;
|
||||
|
||||
ti.type = type;
|
||||
@@ -111,10 +110,9 @@ void udp_tunnel_push_rx_port(struct net_device *dev, struct socket *sock,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(udp_tunnel_push_rx_port);
|
||||
|
||||
void udp_tunnel_drop_rx_port(struct net_device *dev, struct socket *sock,
|
||||
void udp_tunnel_drop_rx_port(struct net_device *dev, struct sock *sk,
|
||||
unsigned short type)
|
||||
{
|
||||
struct sock *sk = sock->sk;
|
||||
struct udp_tunnel_info ti;
|
||||
|
||||
ti.type = type;
|
||||
|
||||
Reference in New Issue
Block a user