virtio_net: avoid BUG_ON() with large packets when CONFIG_DEBUG_SG=y
Subsystems (3)
PATCH 1/1 virtio_net: avoid BUG_ON() with large packets when CONFIG_DEBUG_SG=y
AFAICT only weird kvm setups and lguest traverse this code path now.
--- drivers/net/virtio_net.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/virtio_net.c +3 -0
@@ -351,6 +351,9 @@ static int add_recvbuf_big(struct virtnechar *p;int i, err, offset; +/* This is a waste of cycles, but satisfies CONFIG_DEBUG_SG. */ +sg_init_table (sg,ARRAY_SIZE (sg)); +/* 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);
David Miller
maintainerFrom: Rusty Russell <[email protected]>
Date: Tue, 30 Mar 2010 15:26:35 +1030
Quoted 3 lines
AFAICT only weird kvm setups and lguest traverse this code path now.
Signed-off-by Rusty Russell <[email protected]>
Shirley Ma already posted a fix for this, and you missed the add_recvbuf_small() case in your version.
I'll be applying Shirley's patch to net-next-2.6
Quoted 11 lines · David Miller
From: Rusty Russell <[email protected]>
Date: Tue, 30 Mar 2010 15:26:35 +1030Quoted 3 lines
AFAICT only weird kvm setups and lguest traverse this code path now.
Signed-off-by Rusty Russell <[email protected]>Shirley Ma already posted a fix for this, and you missed the
add_recvbuf_small()case in your version.I'll be applying Shirley's patch to net-next-2.6
Excellent, thanks. Shirley, please cc me in future.
Thanks,
Rusty.
Quoted 1 line · Rusty Russell
Shirley, please cc me in future.
I will. I thought you might be on vacation. :)
Shirley
Michael S. Tsirkin
maintainerQuoted 3 lines · Rusty Russell
AFAICT only weird kvm setups and lguest traverse this code path now.
Signed-off-by Rusty Russell <[email protected]>
vhost still lacks support mergeable buffers so it uses this path.
Quoted 8 lines
--- drivers/net/virtio_net.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/virtio_net.c static int add_recvbuf_big(struct virtne · line 356
Quoted 6 lines
drivers/net/virtio_net.c +3
-0@@ -351,6 +351,9 @@ static int add_recvbuf_big(struct virtnechar *p;int i, err, offset; +/* This is a waste of cycles, but satisfies CONFIG_DEBUG_SG. */ +sg_init_table (sg,ARRAY_SIZE (sg)); +
How about moving sg into virtnet_info? This way we could call this only once, right?
Quoted 3 lines
drivers/net/virtio_net.c +0
-0/* 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);