Subject: Re: 答复: [PATCH] net: Expand headroom to send fragmented packets in bridge fragment forward

From: Florian Westphal <[email-masked]>
Date: Wed, 9 Apr 2025 12:45:25 +0200

Yang Huajian（杨华健） <[email-masked]> wrote:
> > if (skb_headroom(skb) < ll_rs)
> >	goto expand_headroom;
> 
> > ... but I'm not sure what the actual problem is.
> 
> Yes, your guess is correct!
> 
> Actual problem: I think it is unreasonable to directly drop skb with insufficient headroom.
> 
> > Why does this need to make a full skb copy?
> > Should that be using skb_expand_head()?
> 
> Using skb_expand_head has the same effect.
 
> > Actually, can't you just (re)use the slowpath for the skb_headroom < ll_rs case instead of adding headroom expansion?
> 
> I tested it just now, reuse the slowpath will successed.
> But maybe this change cannot resolve all cases if the netdevice really needs this headroom.

The slowpath considers headroom requirements, see ip_frag_next():

        skb2 = alloc_skb(len + state->hlen + state->ll_rs, GFP_ATOMIC);

You should wait for more feedback and then send a v2 tomorrow.

Thanks!