linux/drivers/net/usb
Eric Dumazet 95162d6524 asix: avoid copies in tx path
I noticed excess calls to skb_copy_expand() or memmove() in asix driver.

This driver needs to push 4 bytes in front of frame (packet_len)
and maybe add 4 bytes after the end (if padlen is 4)

So it should set needed_headroom & needed_tailroom to avoid
copies. But its not enough, because many packets are cloned
before entering asix_tx_fixup() and this driver use skb_cloned()
as a lazy way to check if it can push and put additional bytes in frame.

Avoid skb_copy_expand() expensive call, using following rules :

- We are allowed to push 4 bytes in headroom if skb_header_cloned()
  is false (and if we have 4 bytes of headroom)

- We are allowed to put 4 bytes at tail if skb_cloned()
  is false (and if we have 4 bytes of tailroom)

TCP packets for example are cloned, but skb_header_release()
was called in tcp stack, allowing us to use headroom for our needs.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Allan Chou <allan@asix.com.tw>
Cc: Trond Wuellner <trond@chromium.org>
Cc: Grant Grundler <grundler@chromium.org>
Cc: Paul Stewart <pstew@chromium.org>
Cc: Ming Lei <tom.leiming@gmail.com>
Tested-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-07 16:26:56 -07:00
..
Kconfig net: qmi_wwan: fix build error due to cdc-wdm dependecy 2012-03-19 18:17:18 -04:00
Makefile net: usb: qmi_wwan: New driver for Huawei QMI based WWAN devices 2012-03-09 13:09:17 -08:00
asix.c asix: avoid copies in tx path 2012-07-07 16:26:56 -07:00
catc.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
cdc-phonet.c usbnet:cdc-phonet: remove usb_get/put_dev in .probe and .disconnect 2012-06-12 18:50:23 -07:00
cdc_eem.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
cdc_ether.c USB 3.5-rc1 pull request 2012-05-22 15:50:46 -07:00
cdc_ncm.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
cdc_subset.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
cx82310_eth.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
dm9601.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
gl620a.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
hso.c TTY pull request for 3.5-rc1 2012-05-22 16:12:24 -07:00
int51x1.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
ipheth.c ipheth: add support for iPad 2012-06-25 16:20:41 -07:00
kalmia.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
kaweth.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
lg-vl600.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
mcs7830.c mcs7830: Implement link state detection 2012-06-02 17:09:08 -04:00
net1080.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
pegasus.c usbnet:pegasus: remove usb_get/put_dev in .probe and .disconnect 2012-06-12 18:50:23 -07:00
pegasus.h
plusb.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
qmi_wwan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-06-28 17:37:00 -07:00
rndis_host.c USB 3.5-rc1 pull request 2012-05-22 15:50:46 -07:00
rtl8150.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
sierra_net.c net: sierra_net: device IDs for Aircard 320U++ 2012-06-06 10:40:32 -07:00
smsc75xx.c USB 3.5-rc1 pull request 2012-05-22 15:50:46 -07:00
smsc75xx.h smsc75xx: replace 0xffff with PHY_INT_SRC_CLEAR_ALL 2012-05-07 23:43:56 -04:00
smsc95xx.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00
smsc95xx.h
usbnet.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-06-25 15:50:32 -07:00
zaurus.c USB: Disable hub-initiated LPM for comms devices. 2012-05-18 15:42:55 -07:00