Re: Bug in skb_segment: fskb->len != len

Eric Dumazet
2013-10-29T15:08:29Z

On Tue, 2013-10-29 at 22:41 +0800, Herbert Xu wrote:
> On Mon, Oct 28, 2013 at 06:15:08PM -0700, Eric Dumazet wrote:
> > On Mon, 2013-10-28 at 06:21 -0700, Eric Dumazet wrote:
> >
> > > But we also need to fix the skb_segment() bug anyway.
> >
> > Hi Christoph
> >
> > I cooked a minimal patch, could you please try it ?
> >
> > I'll refactor skb_segment() to be smarter for the next release
> > (linux-3.14).
>
> I think this patch is just papering over a deeper issue.
>
> We should either be building skbs in pages, or using frag_list.
> In the latter case each frag_list must be exactly mss bytes,
> except for the last one.
>
> So if we're crashing here it means that we got mixed up on the
> receive side, either because the driver was sending us bogus skbs
> or we're simply buggy.
>
> So we need to figure out why the receive-side (i.e., GRO) is building
> these bogus packets, and not papering over them on the transmit-side.

It looks like you missed a lot of recent changes.

GRO layer was updated to be able to stack two or three sk_buff,
fully populated with page frags.

Thats quite mandatory to support line rate for 40Gb links.

We now have to make skb_segment() aware of this, I missed this part.