Re: [PATCH RFC] netpoll: don't spin forever sending to stopped queues

2006-06-12 Thread Jeremy Fitzhardinge

Matt Mackall wrote:

On Thu, Jun 08, 2006 at 07:15:50PM -0700, Jeremy Fitzhardinge wrote:
  
Here's a patch.  I haven't tested it beyond compiling it, and I don't 
know if it is actually correct.  In this case, it seems pointless to 
spin waiting for an even which will never happen.  Should 
netif_poll_disable() cause netpoll_send_skb() (or something) to not even 
bother trying to send?  netif_poll_disable seems mysteriously simple to me.


   J



Did this work for you at all?
  


No, it didn't appear to help; I get the same symptom.  I think fix is 
correct (in that its better than what was there before), but there's 
probably more going on in my case.  I haven't looked into it more deeply 
yet.  I suspect there's another netpoll code path which is spinning 
forever on an XOFFed queue.



When transmitting a skb in netpoll_send_skb(), only retry a limited
number of times if the device queue is stopped.



Where limited = once?
  


No, it reuses the existing retry logic.  It retries 2 times with a 
50us pause between attempts, so up to a second.  This seems excessive to 
me; I don't know where those original numbers came from.  I tried 5000 
retries, but it didn't make any difference to my case.


   J
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC] netpoll: don't spin forever sending to stopped queues

2006-06-12 Thread Jeremy Fitzhardinge

Matt Mackall wrote:

Ahh, right. I forgot that I'd done that. Can you resend?
  

I just respun it against 2.6.17-rc6-mm2.

   J


--

Subject: netpoll: don't spin forever sending to blocked queues

When transmitting a skb in netpoll_send_skb(), only retry a limited
number of times if the device queue is stopped.

Signed-off-by: Jeremy Fitzhardinge [EMAIL PROTECTED]

diff -r 0b8d3d4ee182 net/core/netpoll.c
--- a/net/core/netpoll.cMon Jun 12 13:46:23 2006 -0700
+++ b/net/core/netpoll.cMon Jun 12 13:48:34 2006 -0700
@@ -279,14 +279,10 @@ static void netpoll_send_skb(struct netp
 * network drivers do not expect to be called if the queue is
 * stopped.
 */
-   if (netif_queue_stopped(np-dev)) {
-   netif_tx_unlock(np-dev);
-   netpoll_poll(np);
-   udelay(50);
-   continue;
-   }
-
-   status = np-dev-hard_start_xmit(skb, np-dev);
+   status = NETDEV_TX_BUSY;
+   if (!netif_queue_stopped(np-dev))
+   status = np-dev-hard_start_xmit(skb, np-dev);
+
netif_tx_unlock(np-dev);

/* success */


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC] netpoll: don't spin forever sending to stopped queues

2006-06-11 Thread Matt Mackall
On Thu, Jun 08, 2006 at 07:15:50PM -0700, Jeremy Fitzhardinge wrote:
 Matt Mackall wrote:
 That's odd. Netpoll holds a reference to the device, of course, but so
 does a normal up interface. So that shouldn't be the problem.
 Another possibility is that outgoing packets from printks in the
 driver are causing difficulty. Not sure what can be done about that.
   
 Here's a patch.  I haven't tested it beyond compiling it, and I don't 
 know if it is actually correct.  In this case, it seems pointless to 
 spin waiting for an even which will never happen.  Should 
 netif_poll_disable() cause netpoll_send_skb() (or something) to not even 
 bother trying to send?  netif_poll_disable seems mysteriously simple to me.
 
J

Did this work for you at all?

 When transmitting a skb in netpoll_send_skb(), only retry a limited
 number of times if the device queue is stopped.

Where limited = once?

 Signed-off-by: Jeremy Fitzhardinge [EMAIL PROTECTED]
 
 diff -r aac813f54617 net/core/netpoll.c
 --- a/net/core/netpoll.c  Wed Jun 07 14:53:40 2006 -0700
 +++ b/net/core/netpoll.c  Thu Jun 08 19:00:29 2006 -0700
 @@ -280,15 +280,10 @@ static void netpoll_send_skb(struct netp
* network drivers do not expect to be called if the queue is
* stopped.
*/
 - if (netif_queue_stopped(np-dev)) {
 - np-dev-xmit_lock_owner = -1;
 - spin_unlock(np-dev-xmit_lock);
 - netpoll_poll(np);
 - udelay(50);
 - continue;
 - }
 -
 - status = np-dev-hard_start_xmit(skb, np-dev);
 + status = NETDEV_TX_BUSY;
 + if (!netif_queue_stopped(np-dev))
 + status = np-dev-hard_start_xmit(skb, np-dev);
 +
   np-dev-xmit_lock_owner = -1;
   spin_unlock(np-dev-xmit_lock);
 
 
 

-- 
Mathematics is the supreme nostalgia of our time.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC] netpoll: don't spin forever sending to stopped queues

2006-06-08 Thread Jeremy Fitzhardinge

Matt Mackall wrote:

That's odd. Netpoll holds a reference to the device, of course, but so
does a normal up interface. So that shouldn't be the problem.
Another possibility is that outgoing packets from printks in the
driver are causing difficulty. Not sure what can be done about that.
  
Here's a patch.  I haven't tested it beyond compiling it, and I don't 
know if it is actually correct.  In this case, it seems pointless to 
spin waiting for an even which will never happen.  Should 
netif_poll_disable() cause netpoll_send_skb() (or something) to not even 
bother trying to send?  netif_poll_disable seems mysteriously simple to me.


   J

--

Subject: netpoll: don't spin forever sending to stopped queues

When transmitting a skb in netpoll_send_skb(), only retry a limited
number of times if the device queue is stopped.

Signed-off-by: Jeremy Fitzhardinge [EMAIL PROTECTED]

diff -r aac813f54617 net/core/netpoll.c
--- a/net/core/netpoll.cWed Jun 07 14:53:40 2006 -0700
+++ b/net/core/netpoll.cThu Jun 08 19:00:29 2006 -0700
@@ -280,15 +280,10 @@ static void netpoll_send_skb(struct netp
 * network drivers do not expect to be called if the queue is
 * stopped.
 */
-   if (netif_queue_stopped(np-dev)) {
-   np-dev-xmit_lock_owner = -1;
-   spin_unlock(np-dev-xmit_lock);
-   netpoll_poll(np);
-   udelay(50);
-   continue;
-   }
-
-   status = np-dev-hard_start_xmit(skb, np-dev);
+   status = NETDEV_TX_BUSY;
+   if (!netif_queue_stopped(np-dev))
+   status = np-dev-hard_start_xmit(skb, np-dev);
+
np-dev-xmit_lock_owner = -1;
spin_unlock(np-dev-xmit_lock);




-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html