On Mon, Sep 17, 2018 at 6:24 AM Paolo Abeni <pab...@redhat.com> wrote: > > On Fri, 2018-09-14 at 13:59 -0400, Willem de Bruijn wrote: > > diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c > > index 4f6aa95a9b12..f44fe328aa0f 100644 > > --- a/net/ipv4/udp_offload.c > > +++ b/net/ipv4/udp_offload.c > > @@ -405,7 +405,7 @@ static struct sk_buff *udp4_gro_receive(struct > > list_head *head, > > { > > struct udphdr *uh = udp_gro_udphdr(skb); > > > > - if (unlikely(!uh)) > > + if (unlikely(!uh) || !static_branch_unlikely(&udp_encap_needed_key)) > > goto flush; > > > > /* Don't bother verifying checksum if we're going to flush anyway. */ > > If I read this correctly, once udp_encap_needed_key is enabled, it will > never be turned off, because the tunnel and encap socket shut down does > not cope with udp_encap_needed_key. > > Perhaps we should take care of that, too.
Agreed. For now I reused what's already there, but I can extend that with refcounting using static_branch_inc/static_branch_dec.