netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duan Fugang-B38611 <B38611@freescale.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: "Stephen Hemminger" <stephen@networkplumber.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"Estevam Fabio-R49496" <r49496@freescale.com>,
	"Li Frank-B20596" <B20596@freescale.com>,
	"Shawn Guo" <shawn.guo@linaro.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"Hector Palacios" <hector.palacios@digi.com>,
	"Tim Sander" <tim.sander@hbm.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Thomas Gleixner" <tglx@linutronix.de>
Subject: RE: [PATCH] net/fec: call netif_carrier_off when not having link
Date: Mon, 29 Jul 2013 02:14:10 +0000	[thread overview]
Message-ID: <9848F2DB572E5649BA045B288BE08FBE015D5D24@039-SN2MPN1-023.039d.mgd.msft.net> (raw)
In-Reply-To: 1374852712.1666.20.camel@bwh-desktop.uk.level5networks.com

On Fri, 2013-07-26 at 11:32 PM, Ben Hutchings wrote:
>netif_stop_queue() *must not* be called before netif_carrier_off(), otherwise the TX watchdog can fire immediately.
>The TX watchdog only knows when the last packet was passed to the driver, not when the queue was stopped.
>The last packet could have been added an arbitrarily long time before the link went down, therefore it may appear that the timeout has already expired..
>
>Although it is safe to call netif_stop_queue() after netif_carrier_off(), it is not useful.
>netif_stop_queue() should only be called from your ndo_start_xmit operation and only because the queue is full. 
>Any other reason to stop should be communicated to the kernel using netif_carrier_off() or netif_device_detach().
>
>Ben.

Agree.
I remember you said:
The watchdog fires when the software queue has been stopped *and* the link has been reported as up for over dev->watchdog_timeo ticks.
The software queue should be stopped if the hardware queue is full or nearly full.  If the software queue remains stopped and the link is still reported up, then one of these things is happening:

1. The link went down but the driver didn't notice, or sent a transmit packet which never completes 2. TX completions are not being indicated or handled correctly 3. The hardware TX path has locked up 4. The link is stalled by excessive pause frames or collisions 5. Timeout is too low and/or low watermark is too high (there may be other explanations)

The watchdog is primarily meant to deal with case 3, though all of cases 1-3 may be worked around by resetting the hardware.


Thanks,
Andy

  parent reply	other threads:[~2013-07-29  2:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 13:27 [PATCH] net/fec: call netif_carrier_off when not having link Uwe Kleine-König
2013-07-25 16:03 ` Stephen Hemminger
2013-07-26  9:35   ` Duan Fugang-B38611
2013-07-26 10:06     ` Florian Fainelli
2013-07-26 10:52       ` Sascha Hauer
2013-07-26 15:31     ` Ben Hutchings
2013-07-29  2:10       ` Duan Fugang-B38611
2013-07-29  2:14       ` Duan Fugang-B38611 [this message]
2013-07-30  9:29 ` [PATCH] net/fec: Don't let ndo_start_xmit return NETDEV_TX_BUSY without link Uwe Kleine-König
2013-07-30  9:59   ` Duan Fugang-B38611
2013-07-30 23:05   ` David Miller
2013-07-31  8:16     ` Uwe Kleine-König
2013-07-31 18:51       ` David Miller
2013-08-01  2:01         ` Duan Fugang-B38611
2013-08-01  2:25           ` Steven Rostedt

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=9848F2DB572E5649BA045B288BE08FBE015D5D24@039-SN2MPN1-023.039d.mgd.msft.net \
    --to=b38611@freescale.com \
    --cc=B20596@freescale.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=hector.palacios@digi.com \
    --cc=kernel@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=r49496@freescale.com \
    --cc=rostedt@goodmis.org \
    --cc=shawn.guo@linaro.org \
    --cc=stephen@networkplumber.org \
    --cc=tglx@linutronix.de \
    --cc=tim.sander@hbm.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).