public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ben Greear <greearb@candelatech.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] net/hyperv: fix erroneous NETDEV_TX_BUSY use
Date: Wed, 14 Mar 2012 12:17:12 -0700	[thread overview]
Message-ID: <1331752632.6022.49.camel@edumazet-glaptop> (raw)
In-Reply-To: <4F60E9F7.4000402@candelatech.com>

On Wed, 2012-03-14 at 11:56 -0700, Ben Greear wrote:
> On 03/14/2012 11:53 AM, Eric Dumazet wrote:
> > A driver start_xmit() method cannot free skb and return NETDEV_TX_BUSY,
> > since caller is going to reuse freed skb.
> >
> > This is mostly a revert of commit bf769375c (staging: hv: fix the return
> > status of netvsc_start_xmit())
> >
> > In fact netif_tx_stop_queue() / netif_stop_queue() is needed before
> > returning NETDEV_TX_BUSY or you can trigger a ksoftirqd fatal loop.
> >
> > In case of memory allocation error, only safe way is to drop the packet
> > and return NETDEV_TX_OK
> 
> Can you not just leave the skb alone, not bump any tx-dropped
> stats, and return NETDEV_TX_BUSY?
> 

Nope. Think about OOM.

If we do that, we requeue packet on qdisc, and schedule TX softirq.

-> loop

Really, NETDEV_TX_BUSY is not for this kind of situation.

  reply	other threads:[~2012-03-14 19:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14 18:53 [PATCH] net/hyperv: fix erroneous NETDEV_TX_BUSY use Eric Dumazet
2012-03-14 18:56 ` Ben Greear
2012-03-14 19:17   ` Eric Dumazet [this message]
2012-03-14 20:00     ` Haiyang Zhang
2012-03-14 20:14       ` Eric Dumazet
2012-03-14 20:29         ` Haiyang Zhang
2012-03-16  9:02           ` David Miller

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=1331752632.6022.49.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=greearb@candelatech.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox