netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio_net: avoid BUG_ON() with large packets when CONFIG_DEBUG_SG=y
@ 2010-03-30  4:56 Rusty Russell
  2010-03-30  5:08 ` David Miller
  2010-03-31  9:17 ` Michael S. Tsirkin
  0 siblings, 2 replies; 5+ messages in thread
From: Rusty Russell @ 2010-03-30  4:56 UTC (permalink / raw)
  To: netdev; +Cc: Michael S. Tsirkin

AFAICT only weird kvm setups and lguest traverse this code path now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 drivers/net/virtio_net.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -351,6 +351,9 @@ static int add_recvbuf_big(struct virtne
 	char *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);

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-31  9:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-30  4:56 [PATCH] virtio_net: avoid BUG_ON() with large packets when CONFIG_DEBUG_SG=y Rusty Russell
2010-03-30  5:08 ` David Miller
2010-03-31  0:35   ` Rusty Russell
2010-03-31  5:39     ` Shirley Ma
2010-03-31  9:17 ` Michael S. Tsirkin

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).