All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Amit Shah <amit.shah@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] virtio_net: Check for room in the vq before adding buffer
Date: Thu, 27 Aug 2009 19:17:20 +0930	[thread overview]
Message-ID: <200908271917.21260.rusty@rustcorp.com.au> (raw)
In-Reply-To: <1251278908-18601-1-git-send-email-amit.shah@redhat.com>

On Wed, 26 Aug 2009 06:58:28 pm Amit Shah wrote:
> Saves us one cycle of alloc-add-free if the queue was full.
> 
> Signed-off-by: Amit Shah <amit.shah@redhat.com>

Thanks, applied with one change:

> @@ -323,7 +323,7 @@ static bool try_fill_recv_maxbufs(struct virtnet_info *vi, gfp_t gfp)
>  			break;
>  		}
>  		vi->num++;
> -	}
> +	} while (err > 0);

This is better as "while (err >= num)".  The other one is right (we only need
1 buffer), this one we need to be able to fit "num" entries.

Thanks!
Rusty.

  reply	other threads:[~2009-08-27  9:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26  9:28 [PATCH] virtio_net: Check for room in the vq before adding buffer Amit Shah
2009-08-27  9:47 ` Rusty Russell [this message]
2009-08-27 10:29   ` Amit Shah
2009-08-27 11:06     ` Rusty Russell
2009-08-27 11:18       ` Amit Shah

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=200908271917.21260.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=amit.shah@redhat.com \
    --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.