From: "Michael S. Tsirkin" <mst@redhat.com>
To: Herbert Xu <herbert@gondor.hengli.com.au>
Cc: Bruce Rogers <brogers@novell.com>,
netdev@vger.kernel.org, Shirley Ma <mashirle@us.ibm.com>,
virtualization@lists.linux-foundation.org, stable@kernel.org
Subject: Re: [PATCH] virtio_net: indicate oom when addbuf returns failure
Date: Mon, 7 Jun 2010 12:15:18 +0300 [thread overview]
Message-ID: <20100607091518.GB5561@redhat.com> (raw)
In-Reply-To: <20100606222441.GA5992@gondor.apana.org.au>
On Mon, Jun 07, 2010 at 08:24:41AM +1000, Herbert Xu wrote:
> On Sun, Jun 06, 2010 at 11:13:00PM +0300, Michael S. Tsirkin wrote:
> >
> > Actually this code looks strange:
> > Note that add_buf inicates out of memory
> > condition with a positive return value, and ring full
> > (which is not an error!) with -ENOSPC.
>
> Indeed, this ultimately came from
>
> commit 9ab86bbcf8be755256f0a5e994e0b38af6b4d399
> Author: Shirley Ma <mashirle@us.ibm.com>
> Date: Fri Jan 29 03:20:04 2010 +0000
>
> virtio_net: Defer skb allocation in receive path Date: Wed, 13 Jan 2010 12:53:38 -0800
>
> (Greg, please don't apply this even though I've just given you
> the upstream commit ID that you were asking for :)
>
> where it confuses a memory allocation error with an add_buf failure.
>
> > Possibly the right thing to do is to
> > 1. handle ENOMEM specially
> > 2. fix add_buf to return ENOMEM on error
>
> I think we should make it so that only a memory allocation error
> is returned as before. There is no need for returning the add_buf
> error unless add_buf is now doing an allocation itself that needs
> to be retried.
That's what my patch did, right? Ack it?
> Thanks,
> --
> Visit Openswan at http://www.openswan.org/
> Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2010-06-07 9:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-04 0:58 [PATCH] virtio_net: indicate oom when addbuf returns failure Rusty Russell
2010-06-04 16:05 ` [stable] " Greg KH
2010-06-06 20:13 ` Michael S. Tsirkin
2010-06-06 22:24 ` Herbert Xu
2010-06-06 22:24 ` Herbert Xu
2010-06-07 2:24 ` Rusty Russell
2010-06-07 2:24 ` Rusty Russell
2010-06-07 9:15 ` Michael S. Tsirkin [this message]
2010-06-07 2:17 ` Rusty Russell
2010-06-07 2:17 ` Rusty Russell
2010-06-10 15:46 ` Bruce Rogers
2010-06-10 15:46 ` Bruce Rogers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100607091518.GB5561@redhat.com \
--to=mst@redhat.com \
--cc=brogers@novell.com \
--cc=herbert@gondor.hengli.com.au \
--cc=mashirle@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=stable@kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.