Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx

2010-06-21 Thread Michael S. Tsirkin
On Mon, Jun 21, 2010 at 07:53:43PM +0930, Rusty Russell wrote: > On Mon, 21 Jun 2010 06:03:16 pm Michael S. Tsirkin wrote: > > On Mon, Jun 21, 2010 at 12:13:49PM +0930, Rusty Russell wrote: > > > - return NETDEV_TX_BUSY; > > > + kfree_skb(skb); > > > + return NETDEV_TX_OK; >

Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx

2010-06-21 Thread Rusty Russell
On Mon, 21 Jun 2010 06:03:16 pm Michael S. Tsirkin wrote: > On Mon, Jun 21, 2010 at 12:13:49PM +0930, Rusty Russell wrote: > > - return NETDEV_TX_BUSY; > > + kfree_skb(skb); > > + return NETDEV_TX_OK; > > If we do so, let's increment the dropped counter and/or error c

Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx

2010-06-21 Thread Michael S. Tsirkin
On Mon, Jun 21, 2010 at 12:13:49PM +0930, Rusty Russell wrote: > On Fri, 11 Jun 2010 04:33:43 am Michael S. Tsirkin wrote: > > > > > @@ -572,12 +571,14 @@ again: > > > > > > > > > > /* This can happen with OOM and indirect buffers. */ > > > > > if (unlikely(capacity < 0)) { > > > > > -

Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx

2010-06-20 Thread Rusty Russell
On Fri, 11 Jun 2010 04:33:43 am Michael S. Tsirkin wrote: > > > > @@ -572,12 +571,14 @@ again: > > > > > > > > /* This can happen with OOM and indirect buffers. */ > > > > if (unlikely(capacity < 0)) { > > > > - netif_stop_queue(dev); > > > > - dev_warn(

Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx

2010-06-14 Thread Rusty Russell
On Fri, 11 Jun 2010 04:33:43 am Michael S. Tsirkin wrote: > On Thu, Jun 10, 2010 at 10:46:53AM -0700, Stephen Hemminger wrote: > > It makes more sense to have the device increment tx_droppped, > > and return NETDEV_TX_OK. Skip the message (or make it a pr_debug()). > > Network devices do not guar

Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx

2010-06-10 Thread Michael S. Tsirkin
On Thu, Jun 10, 2010 at 10:17:07AM -0700, Sridhar Samudrala wrote: > On Thu, 2010-06-10 at 18:20 +0300, Michael S. Tsirkin wrote: > > virtio net will never try to overflow the TX ring, so the only reason > > add_buf may fail is out of memory. Thus, we can not stop the > > device until some request

Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx

2010-06-10 Thread Michael S. Tsirkin
On Thu, Jun 10, 2010 at 10:46:53AM -0700, Stephen Hemminger wrote: > On Thu, 10 Jun 2010 10:17:07 -0700 > Sridhar Samudrala wrote: > > > On Thu, 2010-06-10 at 18:20 +0300, Michael S. Tsirkin wrote: > > > virtio net will never try to overflow the TX ring, so the only reason > > > add_buf may fail

Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx

2010-06-10 Thread Stephen Hemminger
On Thu, 10 Jun 2010 10:17:07 -0700 Sridhar Samudrala wrote: > On Thu, 2010-06-10 at 18:20 +0300, Michael S. Tsirkin wrote: > > virtio net will never try to overflow the TX ring, so the only reason > > add_buf may fail is out of memory. Thus, we can not stop the > > device until some request compl

Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx

2010-06-10 Thread Sridhar Samudrala
On Thu, 2010-06-10 at 18:20 +0300, Michael S. Tsirkin wrote: > virtio net will never try to overflow the TX ring, so the only reason > add_buf may fail is out of memory. Thus, we can not stop the > device until some request completes - there's no guarantee anything > at all is outstanding. > > Mak

[PATCH for-2.6.35] virtio_net: fix oom handling on tx

2010-06-10 Thread Michael S. Tsirkin
virtio net will never try to overflow the TX ring, so the only reason add_buf may fail is out of memory. Thus, we can not stop the device until some request completes - there's no guarantee anything at all is outstanding. Make the error message clearer as well: error here does not indicate queue f