asix: asix_rx_fixup surgery to reduce skb truesizes
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 14 Mar 2012 20:18:32 +0000 (20:18 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 9 Apr 2014 01:20:45 +0000 (02:20 +0100)
commita94c450fea945252e3beebacacd5d3b913f38f4b
tree2e83db740ead14f1bb36d290d0e8020b86eadf81
parent9be2956736261b04b270bcd9746b80c872ef4934
asix: asix_rx_fixup surgery to reduce skb truesizes

commit a9e0aca4b37885b5599e52211f098bd7f565e749 upstream.

asix_rx_fixup() is complex, and does some unnecessary memory copies (at
least on x86 where NET_IP_ALIGN is 0)

Also, it tends to provide skbs with a big truesize (4096+256 with
MTU=1500) to upper stack, so incoming trafic consume a lot of memory and
I noticed early packet drops because we hit socket rcvbuf too fast.

Switch to a different strategy, using copybreak so that we provide nice
skbs to upper stack (including the NET_SKB_PAD to avoid future head
reallocations in some paths)

With this patch, I no longer see packets drops or tcp collapses on
various tcp workload with a AX88772 adapter.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Aurelien Jacobs <aurel@gnuage.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Trond Wuellner <trond@chromium.org>
Cc: Grant Grundler <grundler@chromium.org>
Cc: Paul Stewart <pstew@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ Emil: Backported to 3.2: fixed small conflict ]
Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/usb/asix.c