From: Pavel Machek <pavel@ucw.cz>
To: Niklas Cassel <niklas.cassel@axis.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Joao Pinto <Joao.Pinto@synopsys.com>,
Lars Persson <larper@axis.com>, netdev <netdev@vger.kernel.org>
Subject: Re: stmmac tx timeout
Date: Tue, 23 May 2017 15:39:46 +0200 [thread overview]
Message-ID: <20170523133946.GA7713@amd> (raw)
In-Reply-To: <fc8e5141-5815-9a6d-51ed-ddd7e5c2bbc8@axis.com>
[-- Attachment #1: Type: text/plain, Size: 1909 bytes --]
Hi!
> I'm debugging a transmit queue 0 timeout on stmmac with DWMAC4 (4.10a).
> I'm using kernel v4.9.23, which is before multi queue support was added.
> I've cherry-picked
> 98a29944774a ("net: ethernet: stmmac: remove private tx queue lock")
> 84c53b4baef8 ("stmmac: fix memory barriers")
> but I still get tx timeouts with these patches.
>
> I've managed to reproduce the problem several times,
> mainly by transmitting the syslog over HTTP.
How long does it take till timeout? Umm. And if you go through the
list... I believe we understood what was wrong with the timeout
handling and how to fix it...
You may want to tweak tx coalescing parameters. If you set them
"right" you should get timeouts every 5 minutes or so. That makes it
easier to debug. This should do the trick:
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
-#define STMMAC_COAL_TX_TIMER 40000
+#define STMMAC_COAL_TX_TIMER 1000
Now that you have driver that crashes early, you might want to do some
voodoo to stop the crashing. This worked for me:
@@ -2043,7 +2063,11 @@ static netdev_tx_t stmmac_xmit(struct sk_buff
*skb, stru\
ct net_device *dev)
} else
priv->tx_count_frames = 0;
+ dma_rmb();
+ dma_wmb();
/* To avoid raise condition */
+ BUG_ON(first->des01.etx.own); /* This BUG_ON seems to be enough.
+ Replacing it with barriers is _not_enough. */
priv->hw->desc->set_tx_owner(first);
wmb();
No, the BUG_ON() does not trigger. Yes, it still fixes the driver for
me. You may want to verify it has same effect for you.
At that point I ran out of time, and out of goats to sacrifice. You
may be more lucky :-).
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2017-05-23 13:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-23 12:06 stmmac tx timeout Niklas Cassel
2017-05-23 13:39 ` Pavel Machek [this message]
2017-06-06 10:45 ` Niklas Cassel
2017-06-13 8:38 ` Pavel Machek
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=20170523133946.GA7713@amd \
--to=pavel@ucw.cz \
--cc=Joao.Pinto@synopsys.com \
--cc=alexandre.torgue@st.com \
--cc=larper@axis.com \
--cc=netdev@vger.kernel.org \
--cc=niklas.cassel@axis.com \
--cc=peppe.cavallaro@st.com \
/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).