NetBSD Problem Report #57704

From www@netbsd.org  Sat Nov 18 18:10:50 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id E736E1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 18 Nov 2023 18:10:49 +0000 (UTC)
Message-Id: <20231118181048.6FFB81A923A@mollari.NetBSD.org>
Date: Sat, 18 Nov 2023 18:10:48 +0000 (UTC)
From: bbartlomiej.mail@gmail.com
Reply-To: bbartlomiej.mail@gmail.com
To: gnats-bugs@NetBSD.org
Subject: re0: RTL8168H/8111H (0x5400) unable to send or receive data. Watchdog timeout.
X-Send-Pr-Version: www-1.0

>Number:         57704
>Category:       kern
>Synopsis:       re0: RTL8168H/8111H (0x5400) unable to send or receive data. Watchdog timeout.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 18 18:15:00 +0000 2023
>Last-Modified:  Mon Jan 08 21:00:02 +0000 2024
>Originator:     Bartlomiej Krawcyzk
>Release:        10.0_RC1
>Organization:
>Environment:
NetBSD NetBSD 10.0_RC1 NetBSD 10.0_RC1 (GENERIC) #0: Sun Nov  5 18:30:08 UTC 2023  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
Earlier using NetBSD-current and now using 10.0_RC1 I am unable to reliably use my re(4) ethernet adapter. I am reliably using the same adapter in this machine on Linux and Windows 10/11.

I get constant "re0: watchdog timeout" messages and tcpdump doesn't show any received traffic. It does show traffic sent but those packets never reach the other end of the cable (cable is fine, it works on other systems). When I manually assign an IP address I am unable to ping my gateway and the switch in path doesn't receive any packets from this adapter.

[     1.026877] re0 at pci4 dev 0 function 0: RealTek 8168/8111 PCIe Gigabit Ethernet (rev. 0x15)
[     1.026877] re0: interrupting at msix3 vec 0
[     1.026877] re0: RTL8168H/8111H (0x5400)
[     1.026877] re0: Ethernet address d4:5d:64:7f:f0:27
[     1.026877] re0: using 256 tx descriptors
[     1.026877] rgephy0 at re0 phy 7: RTL8251 1000BASE-T media interface, rev. 0
[    24.878627] re0: watchdog timeout
[    37.888665] re0: watchdog timeout
[    56.898721] re0: watchdog timeout
[    69.908759] re0: watchdog timeout
[    75.918777] re0: watchdog timeout
[   103.933809] re0: watchdog timeout


NetBSD# ifconfig re0
re0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        capabilities=0x3f80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx>
        capabilities=0x3f80<UDP4CSUM_Rx,UDP4CSUM_Tx>
        enabled=0
        ec_capabilities=0x3<VLAN_MTU,VLAN_HWTAGGING>
        ec_enabled=0
        address: d4:5d:64:7f:f0:27
        media: Ethernet autoselect (1000baseT full-duplex)
        status: active
        inet6 fe80::49af:946d:7378:7120%re0/64 flags 0 scopeid 0x1
        inet 192.168.2.22/24 broadcast 192.168.2.255 flags 0
        inet 169.254.135.169/16 broadcast 169.254.255.255 flags 0



NetBSD# ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1): 56 data bytes
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down
^C
----192.168.2.1 PING Statistics----
6 packets transmitted, 0 packets received, 100.0% packet loss
NetBSD# tcpdump -i re0 -n -Q in
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on re0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel

NetBSD# arp -a
? (192.168.2.1) at (incomplete) on re0 15s I

NetBSD# vmstat -i
interrupt       total rate
TLB shootdown  370021  288
cpu0 timer     128177   99
msix0 vec 1       112    0
msix0 vec 2         2    0
msix0 vec 4        16    0
msix0 vec 6         1    0
msix0 vec 7         1    0
msix0 vec 8        91    0
msix0 vec 9         1    0
msix0 vec 12        1    0
msi1 vec 0         14    0
msi2 vec 0      35104   27
msix3 vec 0         1    0
msi4 vec 0      57838   45
msix6 vec 0     26465   20
Total          617845  481

I remember it working intermittently on -current 2-3 months ago (rebooting sometimes helped) but now on 10.0_RC1 I can't get it to work.

Any ideas on how to troubleshoot this further?
>How-To-Repeat:
Use 10.0_RC1 with re0: RTL8168H/8111H (0x5400)
>Fix:

>Audit-Trail:
From: Bartlomiej Krawczyk <bbartlomiej.mail@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/57704: re0: RTL8168H/8111H (0x5400) unable to send or
 receive data. Watchdog timeout.
Date: Mon, 8 Jan 2024 21:56:12 +0100

 On 11/18/23 19:15, bbartlomiej.mail@gmail.com wrote:
 > [     1.026877] re0 at pci4 dev 0 function 0: RealTek 8168/8111 PCIe Gigabit Ethernet (rev. 0x15)
 > [     1.026877] re0: interrupting at msix3 vec 0
 > [     1.026877] re0: RTL8168H/8111H (0x5400)
 > [     1.026877] re0: Ethernet address d4:5d:64:7f:f0:27
 > [     1.026877] re0: using 256 tx descriptors
 > [     1.026877] rgephy0 at re0 phy 7: RTL8251 1000BASE-T media interface, rev. 0
 > [    24.878627] re0: watchdog timeout
 > [    37.888665] re0: watchdog timeout
 > [    56.898721] re0: watchdog timeout
 > [    69.908759] re0: watchdog timeout
 > [    75.918777] re0: watchdog timeout
 > [   103.933809] re0: watchdog timeout

 What I consistently experience now is if I get any "re0: watchdog 
 timeout" messages during boot I know network will not work. A workaround 
 for me is to shut down the system completely and turn the power off so 
 the network card gets fully powered down. Then after a fresh boot it's 
 been working so far.
 I get the same issues (intermittent again) on 10.0RC2 (fresh installation).

 I don't get the same experience with Windows 11 nor with Fedora Linux 38 
 and 39. Seems like sometimes hardware is in an awkward state and NetBSD 
 driver doesn't do whatever it needs to do to make it sane.

 -- 
 Regards,
 Bartlomiej Krawczyk

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.