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

2013-08-01 Thread Grant Grundler
On Thu, Aug 1, 2013 at 8:36 AM, Eric Dumazet wrote: ... >> IIRC, cpu_to_leXX() macros return the endian "corrected" value. >> In other words, they need to be assigned to something, no? > > Nope, this in in-place byte swapping (for Big Endian only) Ah ok - thanks for clarifying. I couldn't find th

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

2013-08-01 Thread Eric Dumazet
On Thu, 2013-08-01 at 08:30 -0700, Grant Grundler wrote: > http://lxr.free-electrons.com/source/include/linux/byteorder/generic.h#L111 > http://lxr.free-electrons.com/ident?i=__cpu_to_le32s > > IIRC, cpu_to_leXX() macros return the endian "corrected" value. > In other words, they need to be assig

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

2013-08-01 Thread Grant Grundler
On Wed, Jul 31, 2013 at 3:51 AM, Ming Lei wrote: > This patch enables 'can_dma_sg' flag for ax88179_178a device > if the attached host controller supports building packet from > discontinuous buffers(DMA SG is possible), so both frame header > and skb data buffers can be passed to usb stack via ur

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

2013-08-01 Thread Eric Dumazet
On Thu, 2013-08-01 at 16:10 +0800, Ming Lei wrote: > On Thu, Aug 1, 2013 at 1:04 PM, Eric Dumazet wrote: > > On Thu, 2013-08-01 at 12:41 +0800, Ming Lei wrote: > > > >> From my trace result, lots of linear SKBs are cloned or header-cloned, so > >> it needs skb copy too. > >> > >> Is it normal in x

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

2013-08-01 Thread Ming Lei
On Thu, Aug 1, 2013 at 1:04 PM, Eric Dumazet wrote: > On Thu, 2013-08-01 at 12:41 +0800, Ming Lei wrote: > >> From my trace result, lots of linear SKBs are cloned or header-cloned, so >> it needs skb copy too. >> >> Is it normal in xmit path to see cloned SKBs for driver? If not, I can add >> che

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

2013-07-31 Thread Eric Dumazet
On Thu, 2013-08-01 at 12:41 +0800, Ming Lei wrote: > From my trace result, lots of linear SKBs are cloned or header-cloned, so > it needs skb copy too. > > Is it normal in xmit path to see cloned SKBs for driver? If not, I can add > check > to avoid allocation of 8 bytes header for non-cloned sk

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

2013-07-31 Thread Ming Lei
Hi Eric, Thanks for your review. On Thu, Aug 1, 2013 at 11:51 AM, Eric Dumazet wrote: > On Wed, 2013-07-31 at 18:51 +0800, Ming Lei wrote: >> This patch enables 'can_dma_sg' flag for ax88179_178a device >> if the attached host controller supports building packet from >> discontinuous buffers(DMA

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

2013-07-31 Thread Eric Dumazet
On Wed, 2013-07-31 at 18:51 +0800, Ming Lei wrote: > This patch enables 'can_dma_sg' flag for ax88179_178a device > if the attached host controller supports building packet from > discontinuous buffers(DMA SG is possible), so both frame header > and skb data buffers can be passed to usb stack via u

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

2013-07-31 Thread Ming Lei
On Wed, Jul 31, 2013 at 11:15 PM, Eric Dumazet wrote: > On Wed, 2013-07-31 at 16:02 +0200, Oliver Neukum wrote: > > 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. Now Sa

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

2013-07-31 Thread Ming Lei
On Wed, Jul 31, 2013 at 11:15 PM, Eric Dumazet 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 b

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

2013-07-31 Thread Eric Dumazet
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

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

2013-07-31 Thread Oliver Neukum
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 contro

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

2013-07-31 Thread Ming Lei
On Wed, Jul 31, 2013 at 8:47 PM, Greg Kroah-Hartman wrote: > On Wed, Jul 31, 2013 at 06:51:49PM +0800, Ming Lei wrote: >> This patch enables 'can_dma_sg' flag for ax88179_178a device >> if the attached host controller supports building packet from >> discontinuous buffers(DMA SG is possible), so b

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

2013-07-31 Thread Greg Kroah-Hartman
On Wed, Jul 31, 2013 at 06:51:49PM +0800, Ming Lei wrote: > This patch enables 'can_dma_sg' flag for ax88179_178a device > if the attached host controller supports building packet from > discontinuous buffers(DMA SG is possible), so both frame header > and skb data buffers can be passed to usb stac

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

2013-07-31 Thread Ming Lei
This patch enables 'can_dma_sg' flag for ax88179_178a device if the attached host controller supports building packet from discontinuous buffers(DMA SG is possible), so both frame header and skb data buffers can be passed to usb stack via urb->sg, then skb data copy can be saved. With the patch, C