From: Eric Dumazet > Sent: 23 September 2016 15:37 > On Fri, 2016-09-23 at 11:09 -0300, Marcelo Ricardo Leitner wrote: > > On Fri, Sep 23, 2016 at 06:42:51AM -0700, Eric Dumazet wrote: > > > On Fri, 2016-09-23 at 09:45 -0300, Marcelo Ricardo Leitner wrote: > > > > > > > Aye. In that case, what about using tail instead of end? > > > > > > > > > What do you mean exactly ? > > > > Something like: > > -skb->truesize = SKB_TRUESIZE(skb_end_offset(skb)); > > +skb->truesize = SKB_TRUESIZE(skb_tail_offset(skb)); > > Certainly not ;) > > This would be lying. > We really want a precise memory accounting to avoid OOM. > > Some USB drivers use 8KB for their skb->head, you do not want to pretend > its 66+NET_SKB_PAF=F bytes just because there is no payload in the > packet.
Last I look some of the USBnet drivers used 64k+ skb (and then lied about truesize). That whole usbnet stuff needs a rework for usb3 (xhci) so that once the rings (etc) are all setup packet transfer looks much more like a normal ethernet device. I think it needs to stop trying to receive into skb, instead just receive into usb sized buffers - and then generate skb that contain the ethernet frame data. Not that I'm volunteering :-) David