All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Mark McLoughlin <markmc@redhat.com>
Cc: Jeff Garzik <jeff@garzik.org>,
	netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH 1/3] virtio: fix virtio_net xmit of freed skb bug
Date: Sat, 14 Jun 2008 17:39:33 +1000	[thread overview]
Message-ID: <200806141739.34341.rusty@rustcorp.com.au> (raw)
In-Reply-To: <1213366440.9507.0.camel@muff>

On Saturday 14 June 2008 00:14:00 Mark McLoughlin wrote:
> On Thu, 2008-05-29 at 16:34 +1000, Rusty Russell wrote:
> > On Tuesday 27 May 2008 21:06:26 Mark McLoughlin wrote:
> > > On Mon, 2008-05-26 at 17:42 +1000, Rusty Russell wrote:
> > > > If we fail to transmit a packet, we assume the queue is full and put
> > > > the skb into last_xmit_skb.  However, if more space frees up before
> > > > we xmit it, we loop, and the result can be transmitting the same skb
> > > > twice.
> > > >
> > > > Fix is simple: set skb to NULL if we've used it in some way, and
> > > > check before sending.
> >
> > Great! It's a corner case, but it's no more complicated to do it your
> > way.
> >
> > Minor mod, I find it clearer to have the vi->last_xmit_skb = NULL; under
> > the branch:
> >
> > Subject: [PATCH] virtio_net: Delay dropping tx skbs
> > Date: Tue, 27 May 2008 12:06:26 +0100
> > From: Mark McLoughlin <markmc@redhat.com>
> >
> > Currently we drop the skb in start_xmit() if we have a
> > queued buffer and fail to transmit it.
> >
> > However, if we delay dropping it until we've stopped the
> > queue and enabled the tx notification callback, then there
> > is a chance space might become available for it.
>
> Hmm, we lost this one somewhere along the way ...

Good catch.  Looks like it got folded, but pre-folded version got merged.  
Sorry, I've restored it to my series.

Thanks,
Rusty.

  parent reply	other threads:[~2008-06-14  7:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-26  7:42 [PATCH 1/3] virtio: fix virtio_net xmit of freed skb bug Rusty Russell
2008-05-26  7:48 ` [PATCH 2/3] virtio: fix delayed xmit of packet and freeing of old packets Rusty Russell
2008-05-26  7:48 ` Rusty Russell
2008-05-26  7:53   ` [PATCH 3/3] virtio: Use __skb_queue_purge() Rusty Russell
2008-05-26  8:11     ` Wang Chen
2008-05-26  8:11     ` Wang Chen
2008-05-26  7:53   ` Rusty Russell
2008-05-27 11:01   ` [PATCH 2/3] virtio: fix delayed xmit of packet and freeing of old packets Mark McLoughlin
2008-05-27 11:01   ` Mark McLoughlin
2008-05-28  4:59     ` Rusty Russell
2008-05-28  4:59     ` Rusty Russell
2008-05-27 11:06 ` [PATCH 1/3] virtio: fix virtio_net xmit of freed skb bug Mark McLoughlin
2008-05-29  6:34   ` Rusty Russell
2008-05-29  6:34   ` Rusty Russell
2008-06-13 14:14     ` Mark McLoughlin
2008-06-13 14:14     ` Mark McLoughlin
2008-06-13 19:57       ` Jeff Garzik
2008-06-13 19:57       ` Jeff Garzik
2008-06-14  7:39       ` Rusty Russell
2008-06-14  7:39       ` Rusty Russell [this message]
2008-05-27 11:06 ` Mark McLoughlin
2008-05-31  2:12 ` Jeff Garzik
2008-05-31  2:12 ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2008-05-26  7:42 Rusty Russell

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=200806141739.34341.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=jeff@garzik.org \
    --cc=markmc@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.