RE: [PATCH] USBNET: fix handling padding packet

2013-11-11 Thread David Laight
As my below test on ax99179_178a, I believe the patch should fix padding for dma sg, but need a little update, and I will send out v1 later: $ping -s 974 another_machine #from host with ax99179_178a attached If FLAG_SEND_ZLP is set for ax99179_178a, the above ping won't work

Re: [PATCH] USBNET: fix handling padding packet

2013-09-19 Thread Oliver Neukum
On Wed, 2013-09-18 at 20:56 +0200, Bjørn Mork wrote: Oliver Neukum oneu...@suse.de wrote: No, USB 3.0 uses no companion controllers, so you can have devices of any speed connected to it. Ah, right. I don't own such modern hardware, but I should have known this anyway. This still

Re: [PATCH] USBNET: fix handling padding packet

2013-09-19 Thread Bjørn Mork
Oliver Neukum oneu...@suse.de writes: On Wed, 2013-09-18 at 20:56 +0200, Bjørn Mork wrote: Oliver Neukum oneu...@suse.de wrote: No, USB 3.0 uses no companion controllers, so you can have devices of any speed connected to it. Ah, right. I don't own such modern hardware, but I should have

RE: [PATCH] USBNET: fix handling padding packet

2013-09-19 Thread David Laight
I wonder what the gain of that really is? Yes, I can see the advantage of making the class drivers more effective. But padding is only relevant for the ECM class, isn't it? And are there any ECM class devices where SG support matters? AFAICT the requirement for avoiding ZLP is a property of

Re: [PATCH] USBNET: fix handling padding packet

2013-09-19 Thread Ming Lei
On Thu, Sep 19, 2013 at 3:18 PM, Bjørn Mork bj...@mork.no wrote: Oliver Neukum oneu...@suse.de writes: On Wed, 2013-09-18 at 20:56 +0200, Bjørn Mork wrote: Oliver Neukum oneu...@suse.de wrote: No, USB 3.0 uses no companion controllers, so you can have devices of any speed connected to it.

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread Oliver Neukum
On Tue, 2013-09-17 at 17:10 +0800, Ming Lei wrote: Commit 638c5115a7949(USBNET: support DMA SG) introduces DMA SG if the usb host controller is capable of building packet from discontinuous buffers, but missed handling padding packet when building DMA SG. This patch attachs the

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread Bjørn Mork
Ming Lei ming@canonical.com writes: Commit 638c5115a7949(USBNET: support DMA SG) introduces DMA SG if the usb host controller is capable of building packet from discontinuous buffers, but missed handling padding packet when building DMA SG. This patch attachs the pre-allocated padding

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread Ming Lei
On Wed, Sep 18, 2013 at 9:59 PM, Bjørn Mork bj...@mork.no wrote: Ming Lei ming@canonical.com writes: Commit 638c5115a7949(USBNET: support DMA SG) introduces DMA SG if the usb host controller is capable of building packet from discontinuous buffers, but missed handling padding packet when

RE: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread David Laight
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:

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread David Miller
From: Bjørn Mork bj...@mork.no Date: Wed, 18 Sep 2013 17:52:42 +0200 Ming Lei ming@canonical.com writes: There is no reason to forbid DMA SG for one driver which requires padding, right? Yes there is: Added complexity for everybody, based on a combination of features which just does

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread Bjørn Mork
Ming Lei ming@canonical.com writes: Are you really sure that the one driver/device using this really need the padding byte? If you could just make FLAG_SEND_ZLP part of the condition for enabling can_dma_sg, then all this extra complexity would be unnecessary. As the comment in front of

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread Ming Lei
On Wed, Sep 18, 2013 at 11:52 PM, Bjørn Mork bj...@mork.no wrote: Ming Lei ming@canonical.com writes: Are you really sure that the one driver/device using this really need the padding byte? If you could just make FLAG_SEND_ZLP part of the condition for enabling can_dma_sg, then all this

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread Oliver Neukum
On Wed, 2013-09-18 at 17:52 +0200, Bjørn Mork wrote: No modern device should need the padding. No old device will be able to use the SG feature as implemented. You only enable it on USB3, don't On XHCI. you? If this feature is restricted to USB3 capable devices, then it most certainly can

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread Bjørn Mork
Ming Lei ming@canonical.com writes: On Wed, Sep 18, 2013 at 11:52 PM, Bjørn Mork bj...@mork.no wrote: Why don't you test it on the device you tested the SG patch with? I am pretty sure it works just fine using proper ZLP transfer termination. I should have planned to test it, but didn't

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread Bjørn Mork
Oliver Neukum oneu...@suse.de wrote: On Wed, 2013-09-18 at 17:52 +0200, Bjørn Mork wrote: No modern device should need the padding. No old device will be able to use the SG feature as implemented. You only enable it on USB3, don't On XHCI. you? If this feature is restricted to USB3 capable

[PATCH] USBNET: fix handling padding packet

2013-09-17 Thread Ming Lei
Commit 638c5115a7949(USBNET: support DMA SG) introduces DMA SG if the usb host controller is capable of building packet from discontinuous buffers, but missed handling padding packet when building DMA SG. This patch attachs the pre-allocated padding packet at the end of the sg list, so padding

Re: [PATCH] USBNET: fix handling padding packet

2013-09-17 Thread David Miller
From: Ming Lei ming@canonical.com Date: Tue, 17 Sep 2013 17:10:02 +0800 Commit 638c5115a7949(USBNET: support DMA SG) introduces DMA SG if the usb host controller is capable of building packet from discontinuous buffers, but missed handling padding packet when building DMA SG. This