[PATCH for-2.6.35] virtio_net: do not reschedule rx refill forever

2010-06-10 Thread Michael S. Tsirkin
We currently fill all of RX ring, then add_buf returns ENOSPC, which gets mis-detected as an out of memory condition and causes us to reschedule the work, and so on forever. Fix this by oom = err == -ENOMEM; Signed-off-by: Michael S. Tsirkin m...@redhat.com --- Rusty, please review the following

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. Make the

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 s...@us.ibm.com 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

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 s...@us.ibm.com 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

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