[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/56312: re(4) - card not working reliably - patch attached
>Synopsis: re(4) - card not working reliably - patch attached
>Arrival-Date: Thu Jul 15 19:45:00 +0000 2021
>Originator: Ralf Doering
NetBSD nbsd 9.2 NetBSD 9.2 (GENERIC) #0: Wed May 12 13:15:55 UTC 2021 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
I've got a system with a Realtek based card which did not work reliably. Just after booting with a static IP configuration the system wasn't reachable and could not ping it's gateway. Usually letting tcpdump run for some time got the card into a somewhat working state.
Digging through the logs I found:
[ 1.048531] re0 at pci3 dev 0 function 0: RealTek 8168/8111 PCIe Gigabit Ethernet (rev. 0x10)
[ 1.048531] re0: interrupting at msix3 vec 0
[ 1.048531] re0: Unknown revision (0x50800000)
[ 1.048531] re0: Ethernet address c8:d3:ff:35:9f:4b
[ 1.048531] re0: using 256 tx descriptors
After reading through the source this "unknown revision" means that default quirks/flags are used in the end instead of chip specific one.
Revision 0x50800000 seems to be RTK_HWREV_8168GU as defined in rtl81x9reg.h, but it is not handled in rtl8169.c. I had a quick look over to the FreeBSD sources, they handle this chip the same as RTK_HWREV_8168H. So the patch to try was quite simple, see patch.
With this compiled in IP is working from the beginning without any tricks.
The card in question according to pcictl is:
003:00:0: 0x816810ec (0x02000010) [re0]
Get my hardware ;)
RCS file: /cvsroot/src/sys/dev/ic/rtl8169.c,v
retrieving revision 184.108.40.206
diff -u -r220.127.116.11 rtl8169.c
--- sys/dev/ic/rtl8169.c 28 Jan 2020 11:12:30 -0000 18.104.22.168
+++ sys/dev/ic/rtl8169.c 15 Jul 2021 19:17:58 -0000
@@ -613,6 +613,7 @@
+ case RTK_HWREV_8168GU:
sc->sc_quirk |= RTKQ_DESCV2 | RTKQ_NOEECMD |
RTKQ_MACSTAT | RTKQ_CMDSTOP | RTKQ_PHYWAKE_PM |
Main Index |
Thread Index |