From: Eric Dumazet <hidden> Date: 2015-02-21 16:22:32
On Sat, 2015-02-21 at 11:31 +0100, Florian Westphal wrote:
Tomas Szepe [off-list ref] wrote:
quoted
quoted
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 ?
@@ -7050,6 +7050,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,u32opts[2];intfrags;boolstop_queue;+boolxmit_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 */
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
Hmm, I _thought_ HW would not start xmit of this descriptor/skb until after
RTL_W8(TxPoll, NPQ);
call a bit later... your patch surely looks safer though, thanks for
looking into this.
Could Tomas try following fix ?
In addition -- Tomas, on your affected board -- did you try
turning off gso/tso?
Holger Hoffstätte mentioned on lkml that his affected r8169 nic is
stable with xmit_more+bql after disabling gso/tso on the nic
(ethtool -k $dev to display settings, "-K $dev tso off gso off" to
disable offloads).
From: Eric Dumazet <hidden> Date: 2015-02-21 18:09:07
On Sat, 2015-02-21 at 18:46 +0100, Florian Westphal wrote:
Eric Dumazet [off-list ref] wrote:
quoted
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
Hmm, I _thought_ HW would not start xmit of this descriptor/skb until after
RTL_W8(TxPoll, NPQ);
Note this 'kick' does not provide tail ptr.
NIC basically looks at TX descriptors to find ones with the DescOwn bit
set. It stops when if find one TX descriptor _without_ DescOwn.
So what can happen here is the NIC was kicked earlier (prior transmit),
but found your TX descriptor, before you got a chance to read
skb->xmit_more
This is why we have these wmb() everywhere. We want to do
txd->opts1 = XXX
Only when we are really ready.
On Sat, 2015-02-21 at 18:46 +0100, Florian Westphal wrote:
quoted
Eric Dumazet [off-list ref] wrote:
quoted
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
Hmm, I _thought_ HW would not start xmit of this descriptor/skb until after
RTL_W8(TxPoll, NPQ);
Note this 'kick' does not provide tail ptr.
NIC basically looks at TX descriptors to find ones with the DescOwn bit
set. It stops when if find one TX descriptor _without_ DescOwn.
From: Tomas Szepe <hidden> Date: 2015-02-21 19:05:28
quoted hunk
quoted
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 ?
From: Tomas Szepe <hidden> Date: 2015-02-21 19:26:42
quoted
Could Tomas try following fix ?
In addition -- Tomas, on your affected board -- did you try
turning off gso/tso?
Holger Hoffstätte mentioned on lkml that his affected r8169 nic is
stable with xmit_more+bql after disabling gso/tso on the nic
(ethtool -k $dev to display settings, "-K $dev tso off gso off" to
disable offloads).
They're always off on this NIC (cannot be turned on).
# ethtool -k eth1| grep segmentation-offload
tcp-segmentation-offload: off
generic-segmentation-offload: off [requested on]
# ethtool -K eth1 gso on tso on
Could not change any device features
# ethtool -k eth1| grep segmentation-offload
tcp-segmentation-offload: off
generic-segmentation-offload: off [requested on]
--
Tomas Szepe [off-list ref]
@@ -7050,6 +7050,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,u32opts[2];intfrags;boolstop_queue;+boolxmit_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 */
From: David Miller <davem@davemloft.net> Date: 2015-02-22 20:57:57
From: Tomas Szepe <redacted>
Date: Sun, 22 Feb 2015 01:41:51 +0100
quoted
quoted
Sure, just did. Unfortunately, 3.19.0 + 0bec3b70 + this patch results
in a driver that retains the problem.
OK, could you test following patch instead ?
Yup, but tough luck: 3.19.0 + 0bec3b70 + this patch -> problem present.
I'm reverting the two commits for now, as below.
We can put them back in if we can resolve the problems.
====================
[PATCH] r8169: Revert BQL and xmit_more support.
There are certain regressions which are pointing to
these two commits which we are having a hard time
resolving. So revert them for now.
Specifically this reverts:
commit 0bec3b700d106a8b0a34227b2976d1a582f1aab7
Author: Florian Westphal [off-list ref]
Date: Wed Jan 7 10:49:49 2015 +0100
r8169: add support for xmit_more
and
commit 1e918876853aa85435e0f17fd8b4a92dcfff53d6
Author: Florian Westphal [off-list ref]
Date: Wed Oct 1 13:38:03 2014 +0200
r8169: add support for Byte Queue Limits
There were some attempts by Eric Dumazet to address some obvious
problems in the TX flow, to see if they would fix the problems,
but none of them seem to help for the regression reporters.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/realtek/r8169.c | 30 +++++++-----------------------
1 file changed, 7 insertions(+), 23 deletions(-)
@@ -7049,7 +7047,6 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,u32status,len;u32opts[2];intfrags;-boolstop_queue;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");
@@ -7090,8 +7087,6 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,txd->opts2=cpu_to_le32(opts[1]);-netdev_sent_queue(dev,skb->len);-skb_tx_timestamp(skb);/* Force memory writes to complete before releasing descriptor */