[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091224133749.GB2855@amit-x200.redhat.com>
Date: Thu, 24 Dec 2009 19:07:49 +0530
From: Amit Shah <amit.shah@...hat.com>
To: Shirley Ma <mashirle@...ibm.com>
Cc: Rusty Russell <rusty@...tcorp.com.au>,
"Michael S. Tsirkin" <mst@...hat.com>, Avi Kivity <avi@...hat.com>,
netdev@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [PATCH 2/2] virtio_net: Defer skb allocation in receive path
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@...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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists