udp: gro behind static key
Avoid the socket lookup cost in udp_gro_receive if no socket has a udp tunnel callback configured. udp_sk(sk)->gro_receive requires a registration with setup_udp_tunnel_sock, which enables the static key. Signed-off-by: Willem de Bruijn <willemb@google.com> Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
2b9156129f
commit
f2e9de210d
@@ -119,7 +119,7 @@ static struct sk_buff *udp6_gro_receive(struct list_head *head,
|
||||
{
|
||||
struct udphdr *uh = udp_gro_udphdr(skb);
|
||||
|
||||
if (unlikely(!uh))
|
||||
if (unlikely(!uh) || !static_branch_unlikely(&udpv6_encap_needed_key))
|
||||
goto flush;
|
||||
|
||||
/* Don't bother verifying checksum if we're going to flush anyway. */
|
||||
|
Reference in New Issue
Block a user