Re: smsc75xx & smsc95xx, setting skb->truesize correctly?
Eric Dumazet <eric.dumazet <at> gmail.com>
2012-08-22 06:34:46 GMT
On Wed, 2012-08-22 at 08:35 +0300, Jussi Kivilinna wrote:
> Quoting Eric Dumazet <eric.dumazet <at> gmail.com>:
>
> > On Mon, 2012-08-20 at 17:57 +0300, Jussi Kivilinna wrote:
> >> Hello,
> >>
> >> Is setting skb->truesize in smsc75xx and smsc95xx correct?
> >> In smsc75xx/smsc95xx_rx_fixup(), input skb containing multiple packets
> >> is cloned and truesize for each clone is set to packet-size +
> >> sizeof(struct sk_buff), but input skb has minimum allocation size of
> >> 9000 bytes (MAX_SINGLE_PACKET_SIZE) and maximum of 18944 bytes
> >> (DEFAULT_HS_BURST_CAP_SIZE) (+ NET_IP_ALIGN). Doesn't this cause
> >> truesize to be underestimated?
> >
> > This has been discussed in a "TCP transmit performance regression"
> > thread some weeks ago.
> >
> > More generally, skb_clone() is not a good idea in rx path.
>
> So all skb_clone use in drivers/net/usb/ should be removed/replaced
> with following?
Doing a copy might be expensive on some low end hardware, so I can
understand why this skb_clone() idea was deployed years ago.
Gigabit r8169 has to perform the copy because of security issue, and so
far nobody complained of performance impact.
Best thing would be to not use large buffers from the beginning,
and switch to a frag idea.
(Continue reading)