public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp•com.au>
To: netdev@vger•kernel.org
Cc: "Michael S. Tsirkin" <mst@redhat•com>
Subject: [PATCH] virtio_net: avoid BUG_ON() with large packets when CONFIG_DEBUG_SG=y
Date: Tue, 30 Mar 2010 15:26:35 +1030	[thread overview]
Message-ID: <201003301526.35720.rusty@rustcorp.com.au> (raw)

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

             reply	other threads:[~2010-03-30  4:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30  4:56 Rusty Russell [this message]
2010-03-30  5:08 ` [PATCH] virtio_net: avoid BUG_ON() with large packets when CONFIG_DEBUG_SG=y David Miller
2010-03-31  0:35   ` Rusty Russell
2010-03-31  5:39     ` Shirley Ma
2010-03-31  9:17 ` Michael S. Tsirkin

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=201003301526.35720.rusty@rustcorp.com.au \
    --to=rusty@rustcorp$(echo .)com.au \
    --cc=mst@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox