[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <A1F3067C9B68744AA19F6802BAB8FFDC0DCE702F@TK5EX14MBXC223.redmond.corp.microsoft.com>
Date: Wed, 14 Mar 2012 20:00:46 +0000
From: Haiyang Zhang <haiyangz@...rosoft.com>
To: Eric Dumazet <eric.dumazet@...il.com>,
Ben Greear <greearb@...delatech.com>
CC: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
KY Srinivasan <kys@...rosoft.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: RE: [PATCH] net/hyperv: fix erroneous NETDEV_TX_BUSY use
> -----Original Message-----
> From: Eric Dumazet [mailto:eric.dumazet@...il.com]
> Sent: Wednesday, March 14, 2012 3:17 PM
> To: Ben Greear
> Cc: David Miller; netdev; KY Srinivasan; Haiyang Zhang; Greg Kroah-Hartman
> Subject: Re: [PATCH] net/hyperv: fix erroneous NETDEV_TX_BUSY use
>
> 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.
>
Actually, I'm working on this bug, and have a patch under our internal
review now. My fix is actually not freeing the SKB, and return NETDEV_TX_BUSY.
Even if the vmbus ring buffer is busy currently, it can be available during
the next re-try, because the host is taking away data from ring buffer. The
stop/wake queue mechanism is in the netvsc.c file.
In the out-of-memory case, dropping packet and return NETDEV_TX_OK seems fine.
Thanks,
- Haiyang
Powered by blists - more mailing lists