RE: [PATCH] USBNET: fix handling padding packet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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


��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux