Subject: Re: [PATCH bpf-next V2 1/6] bpf: Remove MTU check in __bpf_skb_max_len

From: Jesper Dangaard Brouer <[email-masked]>
Date: Thu, 8 Oct 2020 13:06:32 +0200

On Wed, 7 Oct 2020 16:46:10 -0700
Maciej Żenczykowski <[email-masked]> wrote:

> >  static u32 __bpf_skb_max_len(const struct sk_buff *skb)
> >  {
> > -       return skb->dev ? skb->dev->mtu + skb->dev->hard_header_len :
> > -                         SKB_MAX_ALLOC;
> > +       return IP_MAX_MTU;
> >  }  
> 
> Shouldn't we just delete this helper instead and replace call sites?

It does seem wrong to pass argument skb into this function, as it is
no-longer used...

Guess I can simply replace __bpf_skb_max_len with IP_MAX_MTU.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer