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

* Re: [PATCH] virtio_net: avoid BUG_ON() with large packets when CONFIG_DEBUG_SG=y
  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  9:17 ` Michael S. Tsirkin
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2010-03-30  5:08 UTC (permalink / raw)
  To: rusty; +Cc: netdev, mst

From: Rusty Russell <rusty@rustcorp.com.au>
Date: Tue, 30 Mar 2010 15:26:35 +1030

> AFAICT only weird kvm setups and lguest traverse this code path now.
> 
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

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

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

* Re: [PATCH] virtio_net: avoid BUG_ON() with large packets when CONFIG_DEBUG_SG=y
  2010-03-30  5:08 ` David Miller
@ 2010-03-31  0:35   ` Rusty Russell
  2010-03-31  5:39     ` Shirley Ma
  0 siblings, 1 reply; 5+ messages in thread
From: Rusty Russell @ 2010-03-31  0:35 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, mst, Shirley Ma

On Tue, 30 Mar 2010 03:38:59 pm David Miller wrote:
> From: Rusty Russell <rusty@rustcorp.com.au>
> Date: Tue, 30 Mar 2010 15:26:35 +1030
> 
> > AFAICT only weird kvm setups and lguest traverse this code path now.
> > 
> > Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> 
> 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.

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

* Re: [PATCH] virtio_net: avoid BUG_ON() with large packets when CONFIG_DEBUG_SG=y
  2010-03-31  0:35   ` Rusty Russell
@ 2010-03-31  5:39     ` Shirley Ma
  0 siblings, 0 replies; 5+ messages in thread
From: Shirley Ma @ 2010-03-31  5:39 UTC (permalink / raw)
  To: Rusty Russell; +Cc: David Miller, netdev, mst

On Wed, 2010-03-31 at 11:05 +1030, Rusty Russell wrote:
> Shirley, please cc me in future.

I will. I thought you might be on vacation. :)

Shirley


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

* Re: [PATCH] virtio_net: avoid BUG_ON() with large packets when CONFIG_DEBUG_SG=y
  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  9:17 ` Michael S. Tsirkin
  1 sibling, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2010-03-31  9:17 UTC (permalink / raw)
  To: Rusty Russell; +Cc: netdev

On Tue, Mar 30, 2010 at 03:26:35PM +1030, Rusty Russell wrote:
> AFAICT only weird kvm setups and lguest traverse this code path now.
> 
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

vhost still lacks support mergeable buffers so it uses this path.

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

How about moving sg into virtnet_info? This way we could call
this only once, right?

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