Commit 43daa96b authored by Soohoon Lee's avatar Soohoon Lee Committed by David S. Miller

usbnet: Stop RX Q on MTU change

When MTU is changed unlink_urbs() flushes RX Q but mean while usbnet_bh()
can fill up the Q at the same time.
Depends on which HCD is down there unlink takes long time then the flush
never ends.
Signed-off-by: default avatarSoohoon Lee <soohoon.lee@f5.com>
Reviewed-by: default avatarKimball Murray <kmurray@f5.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fedbb6b4
...@@ -395,8 +395,11 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu) ...@@ -395,8 +395,11 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu)
dev->hard_mtu = net->mtu + net->hard_header_len; dev->hard_mtu = net->mtu + net->hard_header_len;
if (dev->rx_urb_size == old_hard_mtu) { if (dev->rx_urb_size == old_hard_mtu) {
dev->rx_urb_size = dev->hard_mtu; dev->rx_urb_size = dev->hard_mtu;
if (dev->rx_urb_size > old_rx_urb_size) if (dev->rx_urb_size > old_rx_urb_size) {
usbnet_pause_rx(dev);
usbnet_unlink_rx_urbs(dev); usbnet_unlink_rx_urbs(dev);
usbnet_resume_rx(dev);
}
} }
/* max qlen depend on hard_mtu and rx_urb_size */ /* max qlen depend on hard_mtu and rx_urb_size */
...@@ -1508,8 +1511,9 @@ static void usbnet_bh (unsigned long param) ...@@ -1508,8 +1511,9 @@ static void usbnet_bh (unsigned long param)
} else if (netif_running (dev->net) && } else if (netif_running (dev->net) &&
netif_device_present (dev->net) && netif_device_present (dev->net) &&
netif_carrier_ok(dev->net) && netif_carrier_ok(dev->net) &&
!timer_pending (&dev->delay) && !timer_pending(&dev->delay) &&
!test_bit (EVENT_RX_HALT, &dev->flags)) { !test_bit(EVENT_RX_PAUSED, &dev->flags) &&
!test_bit(EVENT_RX_HALT, &dev->flags)) {
int temp = dev->rxq.qlen; int temp = dev->rxq.qlen;
if (temp < RX_QLEN(dev)) { if (temp < RX_QLEN(dev)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment