Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

13 messages, 5 authors, 2012-04-23 · open the first message on its own page

Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Ben Hutchings <hidden>
Date: 2012-01-29 04:32:34

[Trying a different address.]

Denis,

It looks like you were working on sundance for a while; are you still
interested in it?

Mike reported that:
Network traffic on my D-Link DFE-580TX card results in a transmit
queue timeout and gives endless resets after that untill the interface
is brought down.

The amount of traffic required to generate the error seems to vary but
sooner rather then later it will occur.
and the messages logged under Linux 3.2.1 are:
[  430.008026] ------------[ cut here ]------------
[  430.008100] WARNING:
at /build/buildd-linux-2.6_3.2.1-2-i386-4wAPNj/linux-2.6-3.2.1/debian/build/source_i386_none/net/sched/sch_generic.c:255 dev_watchdog+0xb1/0x104()
[  430.008200] Hardware name:
[  430.008251] NETDEV WATCHDOG: eth1 (sundance): transmit queue 0
timed out
[  430.008307] Modules linked in: p4_clockmod cpufreq_powersave
cpufreq_userspace cpufreq_conservative cpufreq_stats speedstep_lib
mperf fuse w83627ehf hwmon_vid coretemp loop snd_intel8x0
snd_ac97_codec ac97_bus snd_pcm snd_seq snd_time
r snd_seq_device ohci_hcd ehci_hcd tpm_tis sis900 sundance tpm usbcore
tpm_bios pcspkr psmouse snd parport_pc evdev serio_raw parport mii
button usb_common soundcore processor shpchp pci_hotplug thermal_sys
snd_page_alloc ext3 jbd mbcach
e sd_mod crc_t10dif sata_sis ata_generic pata_sis libata scsi_mod
[  430.010093] Pid: 0, comm: swapper/0 Not tainted 3.2.0-1-686-pae #1
[  430.010149] Call Trace:
[  430.010203]  [<c1038280>] ? warn_slowpath_common+0x68/0x79
[  430.010260]  [<c1229e38>] ? dev_watchdog+0xb1/0x104
[  430.010314]  [<c10382f9>] ? warn_slowpath_fmt+0x29/0x2d
[  430.010370]  [<c1229e38>] ? dev_watchdog+0xb1/0x104
[  430.010428]  [<c103ccb5>] ? local_bh_enable+0x2/0x2
[  430.010484]  [<c1041e78>] ? run_timer_softirq+0x150/0x1f3
[  430.010539]  [<c1229d87>] ? netif_tx_unlock+0x3a/0x3a
[  430.010595]  [<c103ccb5>] ? local_bh_enable+0x2/0x2
[  430.010649]  [<c103cd49>] ? __do_softirq+0x94/0x12f
[  430.010704]  [<c103ccb5>] ? local_bh_enable+0x2/0x2
[  430.010757]  <IRQ>  [<c103cf3a>] ? irq_exit+0x32/0x80
[  430.010847]  [<c101e6f4>] ? smp_apic_timer_interrupt+0x5b/0x65
[  430.010906]  [<c12b9b11>] ? apic_timer_interrupt+0x31/0x38
[  430.010963]  [<c120007b>] ? rtc_proc_show+0x15e/0x22d
[  430.011020]  [<c1010e5a>] ? mwait_idle+0x65/0x8b
[  430.011076]  [<c100b234>] ? cpu_idle+0x95/0xaf
[  430.011132]  [<c1412708>] ? start_kernel+0x32a/0x32f
[  430.011185] ---[ end trace 4f9c55881a85ddc2 ]---
[  430.011244] eth1: Transmit timed out, TxStatus 00 TxFrameId 1a,
resetting...
[  430.011302] 00 35afc000 35afc010 00008001(00) 34c2d802 800005ea
[  430.011307] 01 35afc010 35afc020 00000005(01) 34cfc802 800005ea
[  430.011311] 02 35afc020 35afc030 00008009(02) 357ca802 800005ea
[  430.011316] 03 35afc030 35afc040 0000000d(03) 34d01802 800005ea
[  430.011320] 04 35afc040 35afc050 00008011(04) 34d00002 800005ea
[  430.011324] 05 35afc050 35afc060 00000015(05) 35a9f802 800005ea
[  430.011328] 06 35afc060 35afc070 00008019(06) 34c75002 800005ea
[  430.011333] 07 35afc070 35afc080 0000001d(07) 35ac0002 800005ea
[  430.011337] 08 35afc080 35afc090 00008021(08) 34d4e802 800005ea
[  430.011341] 09 35afc090 35afc0a0 00000025(09) 357b0002 800005ea
[  430.011346] 0a 35afc0a0 35afc0b0 00008029(0a) 34d66802 800005ea
[  430.011350] 0b 35afc0b0 35afc0c0 0000002d(0b) 354f2802 800005ea
[  430.011354] 0c 35afc0c0 35afc0d0 00008031(0c) 34d04802 800005ea
[  430.011359] 0d 35afc0d0 35afc0e0 00000035(0d) 34cd1002 800005ea
[  430.011363] 0e 35afc0e0 35afc0f0 00008039(0e) 34cc9802 800005ea
[  430.011367] 0f 35afc0f0 35afc100 0000003d(0f) 34d3d002 800005ea
[  430.011371] 10 35afc100 35afc110 00008041(10) 355d3002 800005ea
[  430.011376] 11 35afc110 35afc120 00000045(11) 34d02802 800005ea
[  430.011380] 12 35afc120 35afc130 00008049(12) 34d8b002 800005ea
[  430.011384] 13 35afc130 35afc140 0000004d(13) 34cc9002 800005ea
[  430.011389] 14 35afc140 35afc150 00008051(14) 34d51002 800005ea
[  430.011393] 15 35afc150 35afc160 00000055(15) 357c7802 800005ea
[  430.011397] 16 35afc160 00000000 00008059(16) 34d4f002 800005ea
[  430.011401] 17 35afc170 35afc180 0001805d(17) 00000000 00000000
[  430.011406] 18 35afc180 35afc190 00018061(18) 00000000 00000000
[  430.011410] 19 35afc190 35afc1a0 00018065(19) 00000000 00000000
[  430.011414] 1a 35afc1a0 35afc1b0 00018069(1a) 00000000 00000000
[  430.011419] 1b 35afc1b0 35afc1c0 0000806d(1b) 34eea002 800005ea
[  430.011423] 1c 35afc1c0 35afc1d0 00008071(1c) 355d9802 800005ea
[  430.011427] 1d 35afc1d0 35afc1e0 00008075(1d) 34d19002 800005ea
[  430.011431] 1e 35afc1e0 35afc1f0 00008079(1e) 354e4002 800005ea
[  430.011436] 1f 35afc1f0 35afc000 0000007d(1f) 354ea002 800005ea
[  430.011440] TxListPtr=35afc1b0 netif_queue_stopped=1
[  430.011444] cur_tx=154807(17) dirty_tx=154779(1b)
[  430.011447] cur_rx=0 dirty_rx=0
[  430.011449] cur_task=154807
[  438.008046] eth1: Transmit timed out, TxStatus 00 TxFrameId 00,
resetting...
[  438.008115] 00 35afc000 35afc010 00010001(00) 00000000 00000000
[  438.008120] 01 35afc010 35afc020 00008005(01) 34cd3802 800005ea
[  438.008124] 02 35afc020 35afc030 00000009(02) 34cce802 800005ea
[  438.008129] 03 35afc030 35afc040 0000800d(03) 34f2b802 800005ea
[  438.008133] 04 35afc040 35afc050 00000011(04) 34d40002 800005ea
[  438.008137] 05 35afc050 35afc060 00008015(05) 34eff002 800005ea
[  438.008142] 06 35afc060 35afc070 00000019(06) 34d5e002 800005ea
[  438.008146] 07 35afc070 35afc080 0000801d(07) 357c4802 800005ea
[  438.008150] 08 35afc080 35afc090 00000021(08) 34d8f802 800005ea
[  438.008155] 09 35afc090 35afc0a0 00000025(09) 34d57802 800005ea
[  438.008159] 0a 35afc0a0 35afc0b0 00000029(0a) 34ca7802 800005ea
[  438.008163] 0b 35afc0b0 35afc0c0 0000002d(0b) 34c21802 800005ea
[  438.008168] 0c 35afc0c0 35afc0d0 00000031(0c) 34d41802 800005ea
[  438.008172] 0d 35afc0d0 35afc0e0 00000035(0d) 35406402 800001ad
[  438.008176] 0e 35afc0e0 35afc0f0 00000039(0e) 34d14802 800005ea
[  438.008181] 0f 35afc0f0 35afc100 0000003d(0f) 34e34002 800005ea
[  438.008185] 10 35afc100 35afc110 00000041(10) 34cd1802 800005ea
[  438.008189] 11 35afc110 35afc120 00000045(11) 355db802 800005ea
[  438.008193] 12 35afc120 35afc130 00000049(12) 3541c802 800005ea
[  438.008198] 13 35afc130 35afc140 0000004d(13) 34ca5802 800005ea
[  438.008202] 14 35afc140 35afc150 00000051(14) 34ccb002 800005ea
[  438.008206] 15 35afc150 35afc160 00000055(15) 34ef4002 800005ea
[  438.008210] 16 35afc160 35afc170 00000059(16) 34c1a802 800005ea
[  438.008215] 17 35afc170 35afc180 0000005d(17) 34ef4802 800005ea
[  438.008219] 18 35afc180 35afc190 00000061(18) 34e25002 800005ea
[  438.008223] 19 35afc190 35afc1a0 00000065(19) 34d4e002 800005ea
[  438.008228] 1a 35afc1a0 35afc1b0 00000069(1a) 357b5002 800005ea
[  438.008232] 1b 35afc1b0 35afc1c0 0000006d(1b) 34ce1002 800005ea
[  438.008236] 1c 35afc1c0 35afc1d0 00000071(1c) 357bc002 800005ea
[  438.008241] 1d 35afc1d0 00000000 00008075(1d) 34c73002 800005ea
[  438.008245] 1e 35afc1e0 00000000 00008079(1e) 354e4002 800005ea
[  438.008249] 1f 35afc1f0 00000000 0000007d(1f) 354ea002 800005ea
[  438.008254] TxListPtr=35afc010 netif_queue_stopped=1
[  438.008257] cur_tx=30(1e) dirty_tx=1(01)
[  438.008260] cur_rx=5 dirty_rx=5
[  438.008263] cur_task=30
Some more details are at <http://bugs.debian.org/656476>.

Ben.

-- 
Ben Hutchings
If you seem to know what you are doing, you'll be given more to do.

Re: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Denis Kirjanov <kirjanov@gmail.com>
Date: 2012-01-30 09:51:44

I'll check this out. After kernel.org was cracked I've missed
@kernel.org mail account.

On 1/29/12, Ben Hutchings [off-list ref] wrote:
[Trying a different address.]

Denis,

It looks like you were working on sundance for a while; are you still
interested in it?

Mike reported that:
quoted
Network traffic on my D-Link DFE-580TX card results in a transmit
queue timeout and gives endless resets after that untill the interface
is brought down.

The amount of traffic required to generate the error seems to vary but
sooner rather then later it will occur.
and the messages logged under Linux 3.2.1 are:
quoted
[  430.008026] ------------[ cut here ]------------
[  430.008100] WARNING:
at
/build/buildd-linux-2.6_3.2.1-2-i386-4wAPNj/linux-2.6-3.2.1/debian/build/source_i386_none/net/sched/sch_generic.c:255
dev_watchdog+0xb1/0x104()
[  430.008200] Hardware name:
[  430.008251] NETDEV WATCHDOG: eth1 (sundance): transmit queue 0
timed out
[  430.008307] Modules linked in: p4_clockmod cpufreq_powersave
cpufreq_userspace cpufreq_conservative cpufreq_stats speedstep_lib
mperf fuse w83627ehf hwmon_vid coretemp loop snd_intel8x0
snd_ac97_codec ac97_bus snd_pcm snd_seq snd_time
r snd_seq_device ohci_hcd ehci_hcd tpm_tis sis900 sundance tpm usbcore
tpm_bios pcspkr psmouse snd parport_pc evdev serio_raw parport mii
button usb_common soundcore processor shpchp pci_hotplug thermal_sys
snd_page_alloc ext3 jbd mbcach
e sd_mod crc_t10dif sata_sis ata_generic pata_sis libata scsi_mod
[  430.010093] Pid: 0, comm: swapper/0 Not tainted 3.2.0-1-686-pae #1
[  430.010149] Call Trace:
[  430.010203]  [<c1038280>] ? warn_slowpath_common+0x68/0x79
[  430.010260]  [<c1229e38>] ? dev_watchdog+0xb1/0x104
[  430.010314]  [<c10382f9>] ? warn_slowpath_fmt+0x29/0x2d
[  430.010370]  [<c1229e38>] ? dev_watchdog+0xb1/0x104
[  430.010428]  [<c103ccb5>] ? local_bh_enable+0x2/0x2
[  430.010484]  [<c1041e78>] ? run_timer_softirq+0x150/0x1f3
[  430.010539]  [<c1229d87>] ? netif_tx_unlock+0x3a/0x3a
[  430.010595]  [<c103ccb5>] ? local_bh_enable+0x2/0x2
[  430.010649]  [<c103cd49>] ? __do_softirq+0x94/0x12f
[  430.010704]  [<c103ccb5>] ? local_bh_enable+0x2/0x2
[  430.010757]  <IRQ>  [<c103cf3a>] ? irq_exit+0x32/0x80
[  430.010847]  [<c101e6f4>] ? smp_apic_timer_interrupt+0x5b/0x65
[  430.010906]  [<c12b9b11>] ? apic_timer_interrupt+0x31/0x38
[  430.010963]  [<c120007b>] ? rtc_proc_show+0x15e/0x22d
[  430.011020]  [<c1010e5a>] ? mwait_idle+0x65/0x8b
[  430.011076]  [<c100b234>] ? cpu_idle+0x95/0xaf
[  430.011132]  [<c1412708>] ? start_kernel+0x32a/0x32f
[  430.011185] ---[ end trace 4f9c55881a85ddc2 ]---
[  430.011244] eth1: Transmit timed out, TxStatus 00 TxFrameId 1a,
resetting...
[  430.011302] 00 35afc000 35afc010 00008001(00) 34c2d802 800005ea
[  430.011307] 01 35afc010 35afc020 00000005(01) 34cfc802 800005ea
[  430.011311] 02 35afc020 35afc030 00008009(02) 357ca802 800005ea
[  430.011316] 03 35afc030 35afc040 0000000d(03) 34d01802 800005ea
[  430.011320] 04 35afc040 35afc050 00008011(04) 34d00002 800005ea
[  430.011324] 05 35afc050 35afc060 00000015(05) 35a9f802 800005ea
[  430.011328] 06 35afc060 35afc070 00008019(06) 34c75002 800005ea
[  430.011333] 07 35afc070 35afc080 0000001d(07) 35ac0002 800005ea
[  430.011337] 08 35afc080 35afc090 00008021(08) 34d4e802 800005ea
[  430.011341] 09 35afc090 35afc0a0 00000025(09) 357b0002 800005ea
[  430.011346] 0a 35afc0a0 35afc0b0 00008029(0a) 34d66802 800005ea
[  430.011350] 0b 35afc0b0 35afc0c0 0000002d(0b) 354f2802 800005ea
[  430.011354] 0c 35afc0c0 35afc0d0 00008031(0c) 34d04802 800005ea
[  430.011359] 0d 35afc0d0 35afc0e0 00000035(0d) 34cd1002 800005ea
[  430.011363] 0e 35afc0e0 35afc0f0 00008039(0e) 34cc9802 800005ea
[  430.011367] 0f 35afc0f0 35afc100 0000003d(0f) 34d3d002 800005ea
[  430.011371] 10 35afc100 35afc110 00008041(10) 355d3002 800005ea
[  430.011376] 11 35afc110 35afc120 00000045(11) 34d02802 800005ea
[  430.011380] 12 35afc120 35afc130 00008049(12) 34d8b002 800005ea
[  430.011384] 13 35afc130 35afc140 0000004d(13) 34cc9002 800005ea
[  430.011389] 14 35afc140 35afc150 00008051(14) 34d51002 800005ea
[  430.011393] 15 35afc150 35afc160 00000055(15) 357c7802 800005ea
[  430.011397] 16 35afc160 00000000 00008059(16) 34d4f002 800005ea
[  430.011401] 17 35afc170 35afc180 0001805d(17) 00000000 00000000
[  430.011406] 18 35afc180 35afc190 00018061(18) 00000000 00000000
[  430.011410] 19 35afc190 35afc1a0 00018065(19) 00000000 00000000
[  430.011414] 1a 35afc1a0 35afc1b0 00018069(1a) 00000000 00000000
[  430.011419] 1b 35afc1b0 35afc1c0 0000806d(1b) 34eea002 800005ea
[  430.011423] 1c 35afc1c0 35afc1d0 00008071(1c) 355d9802 800005ea
[  430.011427] 1d 35afc1d0 35afc1e0 00008075(1d) 34d19002 800005ea
[  430.011431] 1e 35afc1e0 35afc1f0 00008079(1e) 354e4002 800005ea
[  430.011436] 1f 35afc1f0 35afc000 0000007d(1f) 354ea002 800005ea
[  430.011440] TxListPtr=35afc1b0 netif_queue_stopped=1
[  430.011444] cur_tx=154807(17) dirty_tx=154779(1b)
[  430.011447] cur_rx=0 dirty_rx=0
[  430.011449] cur_task=154807
[  438.008046] eth1: Transmit timed out, TxStatus 00 TxFrameId 00,
resetting...
[  438.008115] 00 35afc000 35afc010 00010001(00) 00000000 00000000
[  438.008120] 01 35afc010 35afc020 00008005(01) 34cd3802 800005ea
[  438.008124] 02 35afc020 35afc030 00000009(02) 34cce802 800005ea
[  438.008129] 03 35afc030 35afc040 0000800d(03) 34f2b802 800005ea
[  438.008133] 04 35afc040 35afc050 00000011(04) 34d40002 800005ea
[  438.008137] 05 35afc050 35afc060 00008015(05) 34eff002 800005ea
[  438.008142] 06 35afc060 35afc070 00000019(06) 34d5e002 800005ea
[  438.008146] 07 35afc070 35afc080 0000801d(07) 357c4802 800005ea
[  438.008150] 08 35afc080 35afc090 00000021(08) 34d8f802 800005ea
[  438.008155] 09 35afc090 35afc0a0 00000025(09) 34d57802 800005ea
[  438.008159] 0a 35afc0a0 35afc0b0 00000029(0a) 34ca7802 800005ea
[  438.008163] 0b 35afc0b0 35afc0c0 0000002d(0b) 34c21802 800005ea
[  438.008168] 0c 35afc0c0 35afc0d0 00000031(0c) 34d41802 800005ea
[  438.008172] 0d 35afc0d0 35afc0e0 00000035(0d) 35406402 800001ad
[  438.008176] 0e 35afc0e0 35afc0f0 00000039(0e) 34d14802 800005ea
[  438.008181] 0f 35afc0f0 35afc100 0000003d(0f) 34e34002 800005ea
[  438.008185] 10 35afc100 35afc110 00000041(10) 34cd1802 800005ea
[  438.008189] 11 35afc110 35afc120 00000045(11) 355db802 800005ea
[  438.008193] 12 35afc120 35afc130 00000049(12) 3541c802 800005ea
[  438.008198] 13 35afc130 35afc140 0000004d(13) 34ca5802 800005ea
[  438.008202] 14 35afc140 35afc150 00000051(14) 34ccb002 800005ea
[  438.008206] 15 35afc150 35afc160 00000055(15) 34ef4002 800005ea
[  438.008210] 16 35afc160 35afc170 00000059(16) 34c1a802 800005ea
[  438.008215] 17 35afc170 35afc180 0000005d(17) 34ef4802 800005ea
[  438.008219] 18 35afc180 35afc190 00000061(18) 34e25002 800005ea
[  438.008223] 19 35afc190 35afc1a0 00000065(19) 34d4e002 800005ea
[  438.008228] 1a 35afc1a0 35afc1b0 00000069(1a) 357b5002 800005ea
[  438.008232] 1b 35afc1b0 35afc1c0 0000006d(1b) 34ce1002 800005ea
[  438.008236] 1c 35afc1c0 35afc1d0 00000071(1c) 357bc002 800005ea
[  438.008241] 1d 35afc1d0 00000000 00008075(1d) 34c73002 800005ea
[  438.008245] 1e 35afc1e0 00000000 00008079(1e) 354e4002 800005ea
[  438.008249] 1f 35afc1f0 00000000 0000007d(1f) 354ea002 800005ea
[  438.008254] TxListPtr=35afc010 netif_queue_stopped=1
[  438.008257] cur_tx=30(1e) dirty_tx=1(01)
[  438.008260] cur_rx=5 dirty_rx=5
[  438.008263] cur_task=30
Some more details are at <http://bugs.debian.org/656476>.

Ben.

--
Ben Hutchings
If you seem to know what you are doing, you'll be given more to do.

-- 
Regards,
Denis

Bug#656476: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Eric Dumazet <hidden>
Date: 2012-01-30 10:14:07

Le lundi 30 janvier 2012 à 12:51 +0300, Denis Kirjanov a écrit :
I'll check this out. After kernel.org was cracked I've missed
@kernel.org mail account.

At first glance, start_tx() is racy against TX completion.

It does :

        if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 &&
            !netif_queue_stopped(dev)) {
                /* do nothing */
        } else {
                netif_stop_queue (dev);
        }

So it can call netif_stop_queue() while TX completion handler did a
cleanup of all queued packets right before.


Note intr_handler() doesnt hold the queue spinlock when it does :

                if (netif_queue_stopped(dev) &&
                        np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) {
                        /* The ring is no longer full, clear busy flag. */
                        netif_wake_queue (dev);
                }





-- 
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Re: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Eric Dumazet <hidden>
Date: 2012-01-30 10:36:08

Le lundi 30 janvier 2012 à 11:14 +0100, Eric Dumazet a écrit :
Le lundi 30 janvier 2012 à 12:51 +0300, Denis Kirjanov a écrit :
quoted
I'll check this out. After kernel.org was cracked I've missed
@kernel.org mail account.

At first glance, start_tx() is racy against TX completion.

It does :

        if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 &&
            !netif_queue_stopped(dev)) {
                /* do nothing */
        } else {
                netif_stop_queue (dev);
        }

So it can call netif_stop_queue() while TX completion handler did a
cleanup of all queued packets right before.


Note intr_handler() doesnt hold the queue spinlock when it does :

                if (netif_queue_stopped(dev) &&
                        np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) {
                        /* The ring is no longer full, clear busy flag. */
                        netif_wake_queue (dev);
                }
So I would try following patch :

 drivers/net/ethernet/dlink/sundance.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c
index 28a3a9b..c671a6c 100644
--- a/drivers/net/ethernet/dlink/sundance.c
+++ b/drivers/net/ethernet/dlink/sundance.c
@@ -1099,11 +1099,13 @@ start_tx (struct sk_buff *skb, struct net_device *dev)
 	tasklet_schedule(&np->tx_tasklet);
 
 	/* On some architectures: explicitly flush cache lines here. */
-	if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 &&
-	    !netif_queue_stopped(dev)) {
-		/* do nothing */
-	} else {
-		netif_stop_queue (dev);
+	if (np->cur_tx - np->dirty_tx >= TX_QUEUE_LEN - 1) {
+		unsigned long flags;
+
+		spin_lock_irqsave(&np->lock, flags);
+		if (np->cur_tx - np->dirty_tx >= TX_QUEUE_LEN - 1)
+			netif_stop_queue(dev);
+		spin_unlock_irqrestore(&np->lock, flags);
 	}
 	if (netif_msg_tx_queued(np)) {
 		printk (KERN_DEBUG

Re: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Ben Hutchings <hidden>
Date: 2012-01-30 14:05:19

On Mon, 2012-01-30 at 11:14 +0100, Eric Dumazet wrote:
Le lundi 30 janvier 2012 à 12:51 +0300, Denis Kirjanov a écrit :
quoted
I'll check this out. After kernel.org was cracked I've missed
@kernel.org mail account.

At first glance, start_tx() is racy against TX completion.

It does :

        if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 &&
            !netif_queue_stopped(dev)) {
                /* do nothing */
        } else {
                netif_stop_queue (dev);
        }

So it can call netif_stop_queue() while TX completion handler did a
cleanup of all queued packets right before.
Yes, I spotted that.  But no descriptors are pushed to the hardware
here; that's done in the driver's TX tasklet.  Although... maybe that
can run immediately when scheduled from here?  I've never had to deal
with tasklets so I really don't know their semantics.

Ben.
Note intr_handler() doesnt hold the queue spinlock when it does :

                if (netif_queue_stopped(dev) &&
                        np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) {
                        /* The ring is no longer full, clear busy flag. */
                        netif_wake_queue (dev);
                }

-- 
Ben Hutchings
Lowery's Law:
             If it jams, force it. If it breaks, it needed replacing anyway.

Re: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Eric Dumazet <hidden>
Date: 2012-01-30 14:29:00

Le lundi 30 janvier 2012 à 14:05 +0000, Ben Hutchings a écrit :
Yes, I spotted that.  But no descriptors are pushed to the hardware
here; that's done in the driver's TX tasklet.  Although... maybe that
can run immediately when scheduled from here?  I've never had to deal
with tasklets so I really don't know their semantics.
Thats probable on SMP ...

Re: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Ben Hutchings <hidden>
Date: 2012-01-30 14:41:33

On Mon, 2012-01-30 at 15:28 +0100, Eric Dumazet wrote:
Le lundi 30 janvier 2012 à 14:05 +0000, Ben Hutchings a écrit :
quoted
Yes, I spotted that.  But no descriptors are pushed to the hardware
here; that's done in the driver's TX tasklet.  Although... maybe that
can run immediately when scheduled from here?  I've never had to deal
with tasklets so I really don't know their semantics.
Thats probable on SMP ...
The bug report is for a UP system running a kernel built with
SMP-alternatives.

Ben.

-- 
Ben Hutchings
Lowery's Law:
             If it jams, force it. If it breaks, it needed replacing anyway.

Re: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Eric Dumazet <hidden>
Date: 2012-01-30 14:57:40

Le lundi 30 janvier 2012 à 14:41 +0000, Ben Hutchings a écrit :
On Mon, 2012-01-30 at 15:28 +0100, Eric Dumazet wrote:
quoted
Le lundi 30 janvier 2012 à 14:05 +0000, Ben Hutchings a écrit :
quoted
Yes, I spotted that.  But no descriptors are pushed to the hardware
here; that's done in the driver's TX tasklet.  Although... maybe that
can run immediately when scheduled from here?  I've never had to deal
with tasklets so I really don't know their semantics.
Thats probable on SMP ...
The bug report is for a UP system running a kernel built with
SMP-alternatives.
Hmm, TX _completion_ is not run from tasklet but hardware IRQ, this is
why I added the spin_lock_irqsave().


Tasklet fires the TX, but hardware IRQ does the TX completion part.

This driver is ... interesting :)

Re: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Eric Dumazet <hidden>
Date: 2012-01-30 15:21:44

Le lundi 30 janvier 2012 à 15:57 +0100, Eric Dumazet a écrit :
Hmm, TX _completion_ is not run from tasklet but hardware IRQ, this is
why I added the spin_lock_irqsave().


Tasklet fires the TX, but hardware IRQ does the TX completion part.

This driver is ... interesting :)
Oh well, we also must make sure we held np->lock in TX completion when
doing our test to eventually call netif_wake_queue(), I missed it was
released too early.

here is a more complete patch.
diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c
index 28a3a9b..d5e9472 100644
--- a/drivers/net/ethernet/dlink/sundance.c
+++ b/drivers/net/ethernet/dlink/sundance.c
@@ -1099,11 +1099,13 @@ start_tx (struct sk_buff *skb, struct net_device *dev)
 	tasklet_schedule(&np->tx_tasklet);
 
 	/* On some architectures: explicitly flush cache lines here. */
-	if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 &&
-	    !netif_queue_stopped(dev)) {
-		/* do nothing */
-	} else {
-		netif_stop_queue (dev);
+	if (np->cur_tx - np->dirty_tx >= TX_QUEUE_LEN - 1) {
+		unsigned long flags;
+
+		spin_lock_irqsave(&np->lock, flags);
+		if (np->cur_tx - np->dirty_tx >= TX_QUEUE_LEN - 1)
+			netif_stop_queue(dev);
+		spin_unlock_irqrestore(&np->lock, flags);
 	}
 	if (netif_msg_tx_queued(np)) {
 		printk (KERN_DEBUG
@@ -1242,8 +1244,8 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
 			hw_frame_id = ioread8(ioaddr + TxFrameId);
 		}
 
+		spin_lock(&np->lock);
 		if (np->pci_dev->revision >= 0x14) {
-			spin_lock(&np->lock);
 			for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) {
 				int entry = np->dirty_tx % TX_RING_SIZE;
 				struct sk_buff *skb;
@@ -1267,9 +1269,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
 				np->tx_ring[entry].frag[0].addr = 0;
 				np->tx_ring[entry].frag[0].length = 0;
 			}
-			spin_unlock(&np->lock);
 		} else {
-			spin_lock(&np->lock);
 			for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) {
 				int entry = np->dirty_tx % TX_RING_SIZE;
 				struct sk_buff *skb;
@@ -1286,7 +1286,6 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
 				np->tx_ring[entry].frag[0].addr = 0;
 				np->tx_ring[entry].frag[0].length = 0;
 			}
-			spin_unlock(&np->lock);
 		}
 
 		if (netif_queue_stopped(dev) &&
@@ -1294,6 +1293,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
 			/* The ring is no longer full, clear busy flag. */
 			netif_wake_queue (dev);
 		}
+		spin_unlock(&np->lock);
 		/* Abnormal error summary/uncommon events handlers. */
 		if (intr_status & (IntrPCIErr | LinkChange | StatsMax))
 			netdev_error(dev, intr_status);

Bug#656476: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Mike . <hidden>
Date: 2012-02-01 14:42:12

Oh well, we also must make sure we held np->lock in TX completion when
doing our test to eventually call netif_wake_queue(), I missed it was
released too early.

here is a more complete patch.
I applied the patch, recompiled the module, loaded it into the kernel and started testing traffic on the interface with the following result :

[ 1124.008030] ------------[ cut here ]------------
[ 1124.008101] WARNING: at /build/buildd-linux-2.6_3.2.1-2-i386-4wAPNj/linux-2.6-3.2.1/debian/build/source_i386_none/net/sched/sch_generic.c:255 dev_watchdog+0xb1/0x104()
[ 1124.008201] Hardware name:
[ 1124.008252] NETDEV WATCHDOG: eth1 (sundance): transmit queue 0 timed out
[ 1124.008309] Modules linked in: sundance(O) p4_clockmod cpufreq_powersave cpufreq_userspace cpufreq_conservative cpufreq_stats speedstep_lib mperf fuse w83627ehf hwmon_vid coretemp loop ohci_hcd snd_intel8x0 snd_ac97_codec ehci_hcd ac97_bus snd_pcm usbcore snd_seq snd_timer snd_seq_device shpchp psmouse snd sis900 pci_hotplug serio_raw pcspkr mii evdev soundcore parport_pc snd_page_alloc parport processor tpm_tis tpm tpm_bios thermal_sys button usb_common ext3 jbd mbcache sd_mod crc_t10dif ata_generic sata_sis pata_sis libata scsi_mod [last unloaded: sundance]
[ 1124.010147] Pid: 5122, comm: gnome-terminal Tainted: G           O 3.2.0-1-686-pae #1
[ 1124.010219] Call Trace:
[ 1124.010286]  [<c1038280>] ? warn_slowpath_common+0x68/0x79
[ 1124.010344]  [<c1229e38>] ? dev_watchdog+0xb1/0x104
[ 1124.010399]  [<c10382f9>] ? warn_slowpath_fmt+0x29/0x2d
[ 1124.010455]  [<c1229e38>] ? dev_watchdog+0xb1/0x104
[ 1124.010511]  [<c103ccb5>] ? local_bh_enable+0x2/0x2
[ 1124.010567]  [<c1041e78>] ? run_timer_softirq+0x150/0x1f3
[ 1124.010622]  [<c1229d87>] ? netif_tx_unlock+0x3a/0x3a
[ 1124.010678]  [<c103ccb5>] ? local_bh_enable+0x2/0x2
[ 1124.010733]  [<c103cd49>] ? __do_softirq+0x94/0x12f
[ 1124.010788]  [<c103ccb5>] ? local_bh_enable+0x2/0x2
[ 1124.010841]  <IRQ>  [<c103cf3a>] ? irq_exit+0x32/0x80
[ 1124.010931]  [<c101e6f4>] ? smp_apic_timer_interrupt+0x5b/0x65
[ 1124.012339]  [<c12b9b11>] ? apic_timer_interrupt+0x31/0x38
[ 1124.012397]  [<c12b007b>] ? set_cpu_sibling_map+0x200/0x250
[ 1124.012452] ---[ end trace d55b57d11770d7d5 ]---

After this the same repeat of transmit timeouts (as posted earlier) in the log untill I down the interface.

Mike.

 		 	   		  

Re: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Jonathan Nieder <hidden>
Date: 2012-03-16 22:04:31

Hi again,

Mike . wrote:
quoted
Oh well, we also must make sure we held np->lock in TX completion when
doing our test to eventually call netif_wake_queue(), I missed it was
released too early.

here is a more complete patch.
I applied the patch, recompiled the module, loaded it into the kernel and
started testing traffic on the interface with the following result :

[ 1124.008030] ------------[ cut here ]------------
[ 1124.008101] WARNING: at /build/buildd-linux-2.6_3.2.1-2-i386-4wAPNj/linux-2.6-3.2.1/debian/build/source_i386_none/net/sched/sch_generic.c:255 dev_watchdog+0xb1/0x104()
[ 1124.008201] Hardware name:
[ 1124.008252] NETDEV WATCHDOG: eth1 (sundance): transmit queue 0 timed out
[...]
After this the same repeat of transmit timeouts (as posted earlier) in the
log untill I down the interface.
Thanks.  I assume current 3.3 release candidates behave the same way.

Based on [2], it looks like v2.6.25-rc9~99^2~24 ([NET]: Add preemption
point in qdisc_run, 2008-03-28) made this easier to trip.

As for the next step: I'd suggest posting a summary of the symptoms,
which kernel versions you have tested, and a link to [1] at
http://bugzilla.kernel.org/, product Drivers, component Network, and
letting us know the bug number so we can track it without forgetting
what has already been learned.

Hope that helps,
Jonathan

[1] http://thread.gmane.org/gmane.linux.network/219101

Re: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Jonathan Nieder <hidden>
Date: 2012-03-16 22:11:36

Jonathan Nieder wrote:
Thanks.  I assume current 3.3 release candidates behave the same way.

Based on [2], it looks like v2.6.25-rc9~99^2~24 ([NET]: Add preemption
point in qdisc_run, 2008-03-28) made this easier to trip.

As for the next step: I'd suggest posting a summary of the symptoms,
which kernel versions you have tested, and a link to [1] at
http://bugzilla.kernel.org/
Here's the missing footnote[2].  Sorry for the noise.

[...]
[1] http://thread.gmane.org/gmane.linux.network/219101
[2] http://bugs.debian.org/514833

Bug#656476: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

From: Mike . <hidden>
Date: 2012-04-23 15:34:36

Hi,

Sorry for the delay, couldn't test for quite some time due to some fried hardware, kernel.org bug report has been created now : https://bugzilla.kernel.org/show_bug.cgi?id=43152

Cheers,

Mike.
Date: Fri, 16 Mar 2012 17:04:13 -0500
From: jrnieder@gmail.com
To: mike-bugreport@hotmail.com
CC: eric.dumazet@gmail.com; ben@decadent.org.uk; kirjanov@gmail.com; netdev@vger.kernel.org; benoit.mortier@opensides.be; herbert@gondor.apana.org.au
Subject: Re: Sundance network driver (D-Link DFE-580TX) timeouts rendering interface unusable

Hi again,

Mike . wrote:
quoted
quoted
Oh well, we also must make sure we held np->lock in TX completion when
doing our test to eventually call netif_wake_queue(), I missed it was
released too early.

here is a more complete patch.
I applied the patch, recompiled the module, loaded it into the kernel and
started testing traffic on the interface with the following result :

[ 1124.008030] ------------[ cut here ]------------
[ 1124.008101] WARNING: at /build/buildd-linux-2.6_3.2.1-2-i386-4wAPNj/linux-2.6-3.2.1/debian/build/source_i386_none/net/sched/sch_generic.c:255 dev_watchdog+0xb1/0x104()
[ 1124.008201] Hardware name:
[ 1124.008252] NETDEV WATCHDOG: eth1 (sundance): transmit queue 0 timed out
[...]
quoted
After this the same repeat of transmit timeouts (as posted earlier) in the
log untill I down the interface.
Thanks.  I assume current 3.3 release candidates behave the same way.

Based on [2], it looks like v2.6.25-rc9~99^2~24 ([NET]: Add preemption
point in qdisc_run, 2008-03-28) made this easier to trip.

As for the next step: I'd suggest posting a summary of the symptoms,
which kernel versions you have tested, and a link to [1] at
http://bugzilla.kernel.org/, product Drivers, component Network, and
letting us know the bug number so we can track it without forgetting
what has already been learned.

Hope that helps,
Jonathan

[1] http://thread.gmane.org/gmane.linux.network/219101
 		 	   		  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help