From: "Michael S. Tsirkin" <mst@redhat.com>
To: Shirley Ma <mashirle@us.ibm.com>
Cc: "David Miller" <davem@davemloft.net>,
"Thomas Müller" <thomas@mathtm.de>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH next-next-2.6 v2] virtio_net: missing sg_init_table
Date: Wed, 31 Mar 2010 12:20:22 +0300 [thread overview]
Message-ID: <20100331092022.GA31911@redhat.com> (raw)
In-Reply-To: <1269911955.14013.4.camel@localhost.localdomain>
On Mon, Mar 29, 2010 at 06:19:15PM -0700, Shirley Ma wrote:
> Add missing sg_init_table for sg_set_buf in virtio_net which
> induced in defer skb patch.
>
> Reported-by: Thomas Müller <thomas@mathtm.de>
> Tested-by: Thomas Müller <thomas@mathtm.de>
> Signed-off-by: Shirley Ma <xma@us.ibm.com>
I'm concerned that the 'big' path might cause a performance regression.
Let's move sg into virtnet_info so that this needs to be only called
once?
> ---
> drivers/net/virtio_net.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 25dc77c..3f5be35 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -326,6 +326,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp)
> struct scatterlist sg[2];
> int err;
>
> + sg_init_table(sg, 2);
> skb = netdev_alloc_skb_ip_align(vi->dev, MAX_PACKET_LEN);
> if (unlikely(!skb))
> return -ENOMEM;
> @@ -351,6 +352,7 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp)
> char *p;
> int i, err, offset;
>
> + sg_init_table(sg, MAX_SKB_FRAGS + 2);
> /* page in sg[MAX_SKB_FRAGS + 1] is list tail */
> for (i = MAX_SKB_FRAGS + 1; i > 1; --i) {
> first = get_a_page(vi, gfp);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-03-31 9:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-29 18:31 [PATCH next-next-2.6] virtio_net: missing sg_init_table Shirley Ma
2010-03-29 19:31 ` Thomas Müller
2010-03-30 1:19 ` [PATCH next-next-2.6 v2] " Shirley Ma
2010-03-31 1:32 ` David Miller
2010-03-31 9:20 ` Michael S. Tsirkin [this message]
2010-03-31 10:16 ` David Miller
2010-03-31 12:41 ` [PATCH] virtio-net: move sg off stack Michael S. Tsirkin
2010-04-02 2:26 ` David Miller
2010-04-06 3:14 ` Rusty Russell
2010-03-30 1:19 ` [PATCH next-next-2.6] virtio_net: missing sg_init_table 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=20100331092022.GA31911@redhat.com \
--to=mst@redhat.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mashirle@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=thomas@mathtm.de \
/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.