NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/56312: re(4) - card not working reliably - patch attached



>Number:         56312
>Category:       kern
>Synopsis:       re(4) - card not working reliably - patch attached
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 15 19:45:00 +0000 2021
>Originator:     Ralf Doering
>Release:        9.2
>Organization:
>Environment:
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
>Description:
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]



>How-To-Repeat:
Get my hardware ;)
>Fix:

Index: sys/dev/ic/rtl8169.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/rtl8169.c,v
retrieving revision 1.159.2.1
diff -u -r1.159.2.1 rtl8169.c
--- sys/dev/ic/rtl8169.c	28 Jan 2020 11:12:30 -0000	1.159.2.1
+++ sys/dev/ic/rtl8169.c	15 Jul 2021 19:17:58 -0000
@@ -613,6 +613,7 @@
 			    RTKQ_NOJUMBO;
 			break;
 		case RTK_HWREV_8168H:
+		case RTK_HWREV_8168GU:
 		case RTK_HWREV_8168FP:
 			sc->sc_quirk |= RTKQ_DESCV2 | RTKQ_NOEECMD |
 			    RTKQ_MACSTAT | RTKQ_CMDSTOP | RTKQ_PHYWAKE_PM |



Home | Main Index | Thread Index | Old Index