summaryrefslogtreecommitdiff
path: root/drivers/net/usb/asix_devices.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-07-25 09:47:53 +0400
committerDavid S. Miller <davem@davemloft.net>2013-07-28 07:10:57 +0400
commita88c32ae15f25fcf0a3c9fadd92f840a1abf0e43 (patch)
treeaf3102f094d7e5d842bf204f49bd0f8f99a54616 /drivers/net/usb/asix_devices.c
parent6680ec68eff47d36f67b4351bc9836fd6cba9532 (diff)
downloadlinux-a88c32ae15f25fcf0a3c9fadd92f840a1abf0e43.tar.xz
USBNET: centralize computing of max rx/tx qlen
This patch centralizes computing of max rx/tx qlen, because: - RX_QLEN()/TX_QLEN() is called in hot path - computing depends on device's usb speed, now we have ls/fs, hs, ss, so more checks need to be involved - in fact, max rx/tx qlen should not only depend on device USB speed, but also depend on ethernet link speed, so we need to consider that in future. - if SG support is done, max tx qlen may need change too Generally, hard_mtu and rx_urb_size are changed in bind(), reset() and link_reset() callback, and change mtu network operation, this patches introduces the API of usbnet_update_max_qlen(), and calls it in above path. Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/asix_devices.c')
-rw-r--r--drivers/net/usb/asix_devices.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index ad5d1e4384db..b96ad4f15b8a 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -778,6 +778,9 @@ static int ax88178_change_mtu(struct net_device *net, int new_mtu)
dev->hard_mtu = net->mtu + net->hard_header_len;
ax88178_set_mfb(dev);
+ /* max qlen depend on hard_mtu and rx_urb_size */
+ usbnet_update_max_qlen(dev);
+
return 0;
}