All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH usbnet v2] mtu change needs to stop RX
@ 2016-06-23 21:32 Soohoon Lee
  2016-06-24  0:30 ` [PATCH usbnet v2.1] " Soohoon Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Soohoon Lee @ 2016-06-23 21:32 UTC (permalink / raw)
  To: oneukum; +Cc: netdev


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.

Reviewed-by: kmurray@f5.com

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 61ba464..ce72dd0 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -395,8 +395,11 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu)
        dev->hard_mtu = net->mtu + net->hard_header_len;
        if (dev->rx_urb_size == old_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_resume_rx(dev);
+               }
        }
 
        /* max qlen depend on hard_mtu and rx_urb_size */
@@ -1509,6 +1512,7 @@ static void usbnet_bh (unsigned long param)
                   netif_device_present (dev->net) &&
                   netif_carrier_ok(dev->net) &&
                   !timer_pending (&dev->delay) &&
+                  !test_bit (EVENT_RX_PAUSED, &dev->flags) &&
                   !test_bit (EVENT_RX_HALT, &dev->flags)) {
                int     temp = dev->rxq.qlen;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH usbnet v2.1] mtu change needs to stop RX
  2016-06-23 21:32 [PATCH usbnet v2] mtu change needs to stop RX Soohoon Lee
@ 2016-06-24  0:30 ` Soohoon Lee
  2016-06-28  9:14   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Soohoon Lee @ 2016-06-24  0:30 UTC (permalink / raw)
  To: oneukum; +Cc: netdev


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: Soohoon Lee <soohoon.lee@f5.com>
Reviewed-by: Kimball Murray <kmurray@f5.com>

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 61ba464..ce72dd0 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -395,8 +395,11 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu)
        dev->hard_mtu = net->mtu + net->hard_header_len;
        if (dev->rx_urb_size == old_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_resume_rx(dev);
+               }
        }

        /* max qlen depend on hard_mtu and rx_urb_size */
@@ -1509,6 +1512,7 @@ static void usbnet_bh (unsigned long param)
                   netif_device_present (dev->net) &&
                   netif_carrier_ok(dev->net) &&
                   !timer_pending (&dev->delay) &&
+                  !test_bit (EVENT_RX_PAUSED, &dev->flags) &&
                   !test_bit (EVENT_RX_HALT, &dev->flags)) {
                int     temp = dev->rxq.qlen;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH usbnet v2.1] mtu change needs to stop RX
  2016-06-24  0:30 ` [PATCH usbnet v2.1] " Soohoon Lee
@ 2016-06-28  9:14   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2016-06-28  9:14 UTC (permalink / raw)
  To: Soohoon.Lee; +Cc: oneukum, netdev

From: Soohoon Lee <Soohoon.Lee@f5.com>
Date: Fri, 24 Jun 2016 00:30:16 +0000

> 
> 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: Soohoon Lee <soohoon.lee@f5.com>
> Reviewed-by: Kimball Murray <kmurray@f5.com>

This patch is mangled by your email client, the TAB characters have been
converted into spaces.

Please do not resubmit this patah until you can successfully email the
patch to yourself and apply it cleanly.

Also, your subject line should be formatted like:

	[PATCH net v2.x] usbnet: ....

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-28  9:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-23 21:32 [PATCH usbnet v2] mtu change needs to stop RX Soohoon Lee
2016-06-24  0:30 ` [PATCH usbnet v2.1] " Soohoon Lee
2016-06-28  9:14   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.