netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Shirley Ma <mashirle@us.ibm.com>
Cc: Amit Shah <amit.shah@redhat.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Avi Kivity <avi@redhat.com>,
	netdev@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] virtio_net: Defer skb allocation in receive path
Date: Mon, 4 Jan 2010 23:14:54 +0200	[thread overview]
Message-ID: <20100104211454.GB21488@redhat.com> (raw)
In-Reply-To: <1262640344.18773.2.camel@localhost.localdomain>

On Mon, Jan 04, 2010 at 01:25:44PM -0800, Shirley Ma wrote:
> Hello Amit,
> 
> Sorry for late response. I am just back from vacation.
> 
> On Thu, 2009-12-24 at 19:07 +0530, Amit Shah wrote:
> > > +static void free_unused_bufs(struct virtnet_info *vi)
> > > +{
> > > +     void *buf;
> > > +     while (vi->num) {
> > > +             buf = vi->rvq->vq_ops->detach_unused_buf(vi->rvq);
> > > +             if (!buf)
> > > +                     continue;
> > 
> > Do you mean 'break' here?
> 
> Nope, it means break since the buffer usage is not sorted by descriptors
> from my understanding. It breaks when vi->num reaches 0.
> 
> Thanks
> Shirley
t

I don't understand.
detach_unused_buf has:
+               if (!vq->data[i])
+                       continue;

so it will never return NULL unless no more buffers?  breaking here ad
BUG_ON(vi->num) as Amit suggests seems cleaner than looping forever if
there's a bug.

-- 
MST

  reply	other threads:[~2010-01-04 21:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-18  7:41 [PATCH net-next 0/2] Defer skb allocation in virtio_net recv Shirley Ma
2009-12-18  7:43 ` [PATCH 1/2] virtio: Add detach unused buffer from vring Shirley Ma
2009-12-20 11:24   ` Michael S. Tsirkin
2009-12-24 13:35   ` Amit Shah
2009-12-18  7:44 ` [PATCH 2/2] virtio_net: Defer skb allocation in receive path Shirley Ma
2009-12-24 13:37   ` Amit Shah
2010-01-04 21:25     ` Shirley Ma
2010-01-04 21:14       ` Michael S. Tsirkin [this message]
2010-01-11 19:09         ` Shirley Ma
2010-01-13 20:53           ` [PATCH v2 " Shirley Ma
2010-01-13 20:57             ` Michael S. Tsirkin
2010-01-13 21:33               ` Shirley Ma
2010-01-13 21:37                 ` Michael S. Tsirkin
2010-01-13 22:23                   ` Shirley Ma
2010-01-13 22:48                     ` Michael S. Tsirkin
2010-01-14  0:37                       ` Shirley Ma
2010-01-29 14:05                         ` Michael S. Tsirkin
2010-02-02 18:07                           ` Shirley Ma
2010-01-16 21:31             ` Rusty Russell
2009-12-18  7:57 ` [PATCH net-next 0/2] Defer skb allocation in virtio_net recv Shirley Ma

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=20100104211454.GB21488@redhat.com \
    --to=mst@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mashirle@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).