summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2021-10-20 08:06:45 +0000
committermsaitoh <msaitoh@NetBSD.org>2021-10-20 08:06:45 +0000
commit645ea366f7c10e37ab03eb29cfebc7055a351e04 (patch)
treef9810aa6032d032d20469eba469ae5b06c188a7e /sys/dev
parent596a5637f6d6b9c42d5c092b5f872d2ccaa5243e (diff)
Disable printf()s in wm_flush_desc_rings() because the code is verified.
The problem was very rare, so I added those printf()s as we can see. Last week, knakahara and I found a procedure to reproduce the problem and verified it worked correctly. To reproduce the problem: 0) Use I219 V1 to V5. Not all of them have the problem and newer than V5 may have the problem. I used V2 for the test. 1) Define WM_DEBUG or add printf in wm_flush_desc_rings() to see DESCRING_STATUS_FLUSH_REQ bit. 2) Run "iperf -s" on the DUT. 3) Run "iperf3 -R -u -c 192.168.1.110 -w 8m -b 1g" repeatedly on another machine. Note that kern.sbmax should be increased on both machines. 4) run while true; do ifconfig wm0 down up sleep 30 done 5) After DESCRING_STATUS_FLUSH_REQ is set, without wm_flush_desc_rings(), TX stalls and reboot is required to recover from it. With wm_flush_desc_rings(), no device hang. 6) If you can't see the DESCRING_STATUS_FLUSH_REQ is set, change the media to 100BASE-T. Note that if_wm.c rev. 1.710 originally written by chuq is required for the test. Without the change, the device becomes unrecoverable state before wm_flush_desc_rings() and the function doesn't recover from the problem.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_wm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/pci/if_wm.c b/sys/dev/pci/if_wm.c
index 8c031fc5081..e3a3881e7e0 100644
--- a/sys/dev/pci/if_wm.c
+++ b/sys/dev/pci/if_wm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.713 2021/10/20 08:02:07 msaitoh Exp $ */
+/* $NetBSD: if_wm.c,v 1.714 2021/10/20 08:06:45 msaitoh Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.713 2021/10/20 08:02:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.714 2021/10/20 08:06:45 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -4890,8 +4890,9 @@ wm_flush_desc_rings(struct wm_softc *sc)
* the data of the next descriptor. We don't care about the data we are
* about to reset the HW.
*/
- device_printf(sc->sc_dev, "Need TX flush (reg = %08x, len = %u)\n",
- preg, reg);
+#ifdef WM_DEBUG
+ device_printf(sc->sc_dev, "Need TX flush (reg = %08x)\n", preg);
+#endif
reg = CSR_READ(sc, WMREG_TCTL);
CSR_WRITE(sc, WMREG_TCTL, reg | TCTL_EN);
@@ -4921,7 +4922,9 @@ wm_flush_desc_rings(struct wm_softc *sc)
* Mark all descriptors in the RX ring as consumed and disable the
* rx ring.
*/
+#ifdef WM_DEBUG
device_printf(sc->sc_dev, "Need RX flush (reg = %08x)\n", preg);
+#endif
rctl = CSR_READ(sc, WMREG_RCTL);
CSR_WRITE(sc, WMREG_RCTL, rctl & ~RCTL_EN);
CSR_WRITE_FLUSH(sc);