Hello, 16.08.2016, 10:41, Felipe Balbi kirjoitti: > > Hi, > > 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. 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. 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 -Jussi -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html