Message ID | 1269887518.13277.13.camel@localhost.localdomain |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
Am 29.03.2010 20:31, schrieb Shirley Ma: > Add missing sg_init_table for sg_set_buf in virtio_net. > > Reported-by: Thomas Müller <thomas@mathtm.de> > Signed-off-by: Shirley Ma <xma@us.ibm.com> I've just tested the patch and it works fine, so I guess you can add a Tested-by: Thomas Müller <thomas@mathtm.de> line, if you like. Thanks, Thomas > --- > 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
On Mon, 2010-03-29 at 21:31 +0200, Thomas Müller wrote: > I've just tested the patch and it works fine, so I guess you can add a > Tested-by: Thomas Müller <thomas@mathtm.de> > line, if you like. Thanks. Updated the patch with Tested-by. Shirley -- 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
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);
Add missing sg_init_table for sg_set_buf in virtio_net. Reported-by: Thomas Müller <thomas@mathtm.de> Signed-off-by: Shirley Ma <xma@us.ibm.com> --- drivers/net/virtio_net.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) -- 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