[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B7349@saturn3.aculab.com>
Date: Wed, 18 Sep 2013 16:43:18 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: Bjørn Mork <bjorn@...k.no>,
"Ming Lei" <ming.lei@...onical.com>
Cc: "David S. Miller" <davem@...emloft.net>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"Oliver Neukum" <oneukum@...e.de>, <netdev@...r.kernel.org>,
<linux-usb@...r.kernel.org>, "Oliver Neukum" <oliver@...kum.org>
Subject: RE: [PATCH] USBNET: fix handling padding packet
> I also believe it would be nice to move the initialisation of can_dma_sg
> away from the minidriver and into usbnet_probe. It's confusing that
> this field is used "uninitialized" (well, defaulting to zero) in all but
> one minidriver. It would much nicer if the logic was more like
>
> usbnet_probe:
> if (...)
> dev->can_dma_sg = 1;
>
> minidriver_bind:
> if (dev->can_dma_sg) {
> dev->net->features |= NETIF_F_SG | NETIF_F_TSO;
> dev->net->hw_features |= NETIF_F_SG | NETIF_F_TSO;
> }
Actually it would probably be nicer if the minidriver set
a flag to indicate that it could support fragmented skb
(a lot can't because of the way they add trailers)
and also provided the length of the header it will add.
The usbnet code could then allocate the header space.
If scatter-gather dma is available (a host feature) then
the header can be allocated outside the skb data area
to avoid having to copy the entire skb data.
The check for ZLP avoidance could then be done once only
(not sure how the info would be passed to teh minidriver apart
from adding more additional parameters to teh tx_fixup function).
I did a quick scan of the minidrivers, some of them don't
seem to have the correct checks for fragmented skb (etc).
Most of them only add a header.
David
Powered by blists - more mailing lists