LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Florian Westphal <fw@strlen.de>
Cc: Tomas Szepe <szepe@pinerecords.com>,
	Francois Romieu <romieu@fr.zoreil.com>,
	Hayes Wang <hayeswang@realtek.com>,
	Eric Dumazet <edumazet@google.com>,
	Tom Herbert <therbert@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Marco Berizzi <pupilla@hotmail.com>,
	linux-kernel@vger.kernel.org, netdev <netdev@vger.kernel.org>
Subject: Re: 1e918876 breaks r8169 (linux-3.18+)
Date: Sat, 21 Feb 2015 08:22:26 -0800	[thread overview]
Message-ID: <1424535746.5565.42.camel@edumazet-glaptop2.roam.corp.google.com> (raw)
In-Reply-To: <20150221103104.GA26574@breakpoint.cc>

On Sat, 2015-02-21 at 11:31 +0100, Florian Westphal wrote:
> Tomas Szepe <szepe@pinerecords.com> wrote:
> > > I tried to reproduce this without success so far on my RTL8168d/8111d device.
> > > I've been running 40 parallel netperf TCP_STREAM tests (1gbit) for the
> > > last 5 hours and so far I saw no watchdog tx timeouts.
> > > 
> > > I'll keep this running for a day or so to see if it just takes more time
> > > to trigger.
> > 
> > So, how's this coming along?  Don't you think the patch should be reverted
> > until the problem is diagnosed/understood/fixed?
> 
> Sorry.
> 
> David, please consider reverting
> 
> 1e918876853aa85435e0f17fd8b4a92dcfff53d6
> (r8169: add support for Byte Queue Limits)
> 
> 	and
> 
> 0bec3b700d106a8b0a34227b2976d1a582f1aab7
> (r8169: add support for xmit_more)
> 
> I cannot reproduce any hangs (tried for 2days with 40 parallel
> netperfs using both 100mbit and 1gbit receiver).
> 
> And I don't see anything wrong with the change either.
> Seems like some revisions of the HW are just dodgy?
> 
> I hate giving up, but I have no means to diagnose this any further.
> Even reporter says it doesn't affect all of his r8169 nics.
> 
> So I think the change is correct per se, but might be revealing some
> HW/firmware bug.

Hold on.

I believe there is one race in the way you access skb->xmit_more _after_

txd->opts1 = cpu_to_le32(status);

After this point, TX might have completed and TX completion already have
freed skb

Could Tomas try following fix ?

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index ad0020af2193..f2764366a36c 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7050,6 +7050,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 	u32 opts[2];
 	int frags;
 	bool stop_queue;
+	bool xmit_more;
 
 	if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) {
 		netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
@@ -7091,7 +7092,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 	txd->opts2 = cpu_to_le32(opts[1]);
 
 	netdev_sent_queue(dev, skb->len);
-
+	xmit_more = skb->xmit_more;
 	skb_tx_timestamp(skb);
 
 	/* Force memory writes to complete before releasing descriptor */
@@ -7108,7 +7109,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 
 	stop_queue = !TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS);
 
-	if (!skb->xmit_more || stop_queue ||
+	if (!xmit_more || stop_queue ||
 	    netif_xmit_stopped(netdev_get_tx_queue(dev, 0))) {
 		RTL_W8(TxPoll, NPQ);
 



  parent reply	other threads:[~2015-02-21 16:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 10:08 Tomas Szepe
2015-02-03 10:42 ` Florian Westphal
2015-02-05 16:56   ` Tomáš Szépe
2015-02-06 14:04     ` Tomas Szepe
2015-02-08 12:18       ` Holger Hoffstätte
2015-02-10 15:45   ` Florian Westphal
2015-02-11  9:46     ` Tomáš Szépe
2015-02-21 10:15     ` Tomas Szepe
2015-02-21 10:31       ` Florian Westphal
2015-02-21 10:57         ` Holger Hoffstätte
2015-02-21 16:22         ` Eric Dumazet [this message]
2015-02-21 17:46           ` Florian Westphal
2015-02-21 18:09             ` Eric Dumazet
2015-02-21 18:32               ` Florian Westphal
2015-02-21 19:26             ` Tomas Szepe
2015-02-21 19:05           ` Tomas Szepe
2015-02-21 19:54             ` Eric Dumazet
2015-02-22  0:41               ` Tomas Szepe
2015-02-22 20:57                 ` David Miller
     [not found] <E1YqR6a-0007T7-Dz@feisty.vs19.net>
2015-05-07 19:22 ` Daniel Exner

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=1424535746.5565.42.camel@edumazet-glaptop2.roam.corp.google.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pupilla@hotmail.com \
    --cc=romieu@fr.zoreil.com \
    --cc=szepe@pinerecords.com \
    --cc=therbert@google.com \
    --subject='Re: 1e918876 breaks r8169 (linux-3.18+)' \
    /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

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).