netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Shirley Ma <mashirle@us.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	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: Thu, 24 Dec 2009 19:07:49 +0530	[thread overview]
Message-ID: <20091224133749.GB2855@amit-x200.redhat.com> (raw)
In-Reply-To: <1261122289.4148.27.camel@localhost.localdomain>

On (Thu) Dec 17 2009 [23:44:49], Shirley Ma wrote:
> virtio_net receives packets from its pre-allocated vring buffers, then it 
> delivers these packets to upper layer protocols as skb buffs. So it's not
> necessary to pre-allocate skb for each mergable buffer, then frees extra 
> skbs when buffers are merged into a large packet. This patch has deferred 
> skb allocation in receiving packets for both big packets and mergeable buffers
> to reduce skb pre-allocations and skb frees. It frees unused buffers by calling 
> detach_unused_buf in vring, so recv skb queue is not needed.
> 
> Signed-off-by: Shirley Ma <xma@us.ibm.com>

...

> +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?

> +		if (vi->mergeable_rx_bufs || vi->big_packets)
> +			give_pages(vi, buf);
> +		else
> +			dev_kfree_skb(buf);
> +		--vi->num;
> +	}
> +}
> +

		Amit

  reply	other threads:[~2009-12-24 13:38 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 [this message]
2010-01-04 21:25     ` Shirley Ma
2010-01-04 21:14       ` Michael S. Tsirkin
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=20091224133749.GB2855@amit-x200.redhat.com \
    --to=amit.shah@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mashirle@us.ibm.com \
    --cc=mst@redhat.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).