Re: [PATCH 4/4] USBNET: ax88179_178a: enable tso if host supports sg dma

Ming Lei
2013-07-31T15:25:16Z

On Wed, Jul 31, 2013 at 11:15 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Wed, 2013-07-31 at 16:02 +0200, Oliver Neukum wrote:
>> On Wed, 2013-07-31 at 21:50 +0800, Ming Lei wrote:
>>
>> > In the usbnet case, the driver already supports non-sg well. Actually,
>> > all current drivers should support non-sg well because urb->sg wasn't
>> > introduced for very long time. We can think it as a new feature or DMA
>> > enhancement for xHCI controller.
>> >
>> > If you mean buffer debounce for dma sg support on ehci/uhci/ohci/..,
>> > maybe we need to discuss and evaluate further.
>>
>> We cannot lie to the networking layer. Either we can do sg in hardware
>> or we cannot. This is unfortunately determined by the HC not the device
>> on the bus. How else but from the host driver would we get the
>> information?
>>
>
> Hmm, I would rather make sure SG is really supported before adding TSO
> support.
>
> TCP stack can build skb with fragments of any size, not multiple
> of 512 or 1024 bytes.

For this SG buffer, only xHCI USB host controller supports it, and other
host controllers can't support it if they don't use bounce buffer, but usbnet
devices may be connected to all these host controllers.

This patchset only enables SG/TSO support when ax88179_178a device
connects to xHCI host controller.

Thanks,
--
Ming Lei