Re: [PATCH 2/2] usb: gadget: f_ncm: add support for scatter/gather SKB to enable GSO

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

 



Hi Jussi,

Jussi Kivilinna <jussi.kivilinna@xxxxxxxxxxx> writes:
>> Jussi Kivilinna <jussi.kivilinna@xxxxxxxxxxx> writes:
>>> Enabling SG allows enabling GSO (generic segmentation offload) feature
>>> of linux networking layer. This increases TCP throughput with NCM
>>> on Cortex-A15+USB3380 based device from 300 Mbit/s to 1.1 Gbit/s.
>>>
>>> Signed-off-by: Jussi Kivilinna <jussi.kivilinna@xxxxxxxxxxx>
>> 
>> this is AWESOME!! :-) But here's the thing, any chance we can build this
>> in u_ether.c ? Also, NETIF_F_SG should be conditional on
>> gadget->sg_supported so that we don't break UDCs that don't support
>> sglists.
>> 
>
> Actually, no sglists are passed to UDC. Reason why this work
> with minimal changes for NCM is that NCM does tx buffering
> in its wrap function.. 'ncm_wrap_ntb' copies input skbuffs to
> larger skbuff, so enabling SG is  only matter of changing that
> skbuff data copy from 'memcpy' to 'skb_copy_bits' (and changing
> CRC calculation work with skbuff fragments). Since NCM already
> does copying, SG can be enabled for NCM without extra overhead.

aha, understood. Now what if we skip copying altogether? If we have an
sg and a UDC that supports sg (gadget->sg_supported = 1), then we can
avoid copying, right?

> To see if NETIF_F_SG with skbuff copying made difference with
> other networking gadgets, I made quick test for RNDIS gadget to
> enable NETIF_F_SG by adding skb_linearize_cow call to
> 'rndis_add_header' wrap function. TCP transfer from device to
> host:
>  without SG: 265 Mbit/s
>  with SG:    326 Mbit/s
>
> So, adding NETIF_F_SG with skbuff linearization in u_ether
> could improve performance little bit.

interesting. Does USB3380 support sglists? We could check how much more
we get if we skip copying altogether.

> For higher speeds with USB3380/SuperSpeed, either larger MTU or
> NCM (with its tx buffering) is needed. Here's earlier CDC EEM
> results on different MTUs, without NETIF_F_SG change, on same hw:
>  MTU=1500:   169 Mbit/s
>  MTU=15000: 1.23 Gbit/s
>
> and on Intel PC + USB3380:
>  MTU=1500:   259 Mbit/s
>  MTU=3000:   452 Mbit/s
>  MTU=4500:   575 Mbit/s
>  MTU=9000:   823 Mbit/s
>  MTU=12000:  934 Mbit/s
>  MTU=15000:  1000 Mbit/s

cool, thanks for these numbers. This is very interesting, indeed.

-- 
balbi

Attachment: signature.asc
Description: PGP signature


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

  Powered by Linux