NetBSD Problem Report #55010

From tsutsui@ceres.dti.ne.jp  Mon Feb 24 07:30:52 2020
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-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 A12FB1A9213
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 24 Feb 2020 07:30:52 +0000 (UTC)
Message-Id: <202002240730.01O7Ugwh003683@ceres.dti.ne.jp>
Date: Mon, 24 Feb 2020 16:30:42 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: dhcpcd(8) fails to detect carrier change on tlp(4) 21041
X-Send-Pr-Version: 3.95

>Number:         55010
>Category:       bin
>Synopsis:       dhcpcd(8) fails to detect carrier change on tlp(4) 21041
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 24 07:35:01 +0000 2020
>Last-Modified:  Sun Jul 05 11:10:01 +0000 2020
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.0
>Organization:
>Environment:
System: 
Architecture: mipsel
Machine: cobalt
>Description:
On tlp(4) on DECchip 21041 on Cobalt Qube 2700, dhcpcd(8) cannot
detect carrier change of the interface.

Restarting dhcpcd(8), or executing "ifconfig tlp0 up"
before starting dhcpcd(8) works as expected.

---
Mon Feb 24 14:54:19 UTC 2020

NetBSD/cobalt (Amnesiac) (ttyZ0)

login: Feb 24 14:54:22  getty[565]: /dev/tty00: Device not configured
root
Feb 24 14:54:30  login: ROOT LOGIN (root) on tty ttyZ0
Last login: Mon Feb 24 14:51:59 2020 on ttyZ0
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
    2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 9.0 (GENERIC) #0: Mon Feb 24 03:01:07 JST 2020

Welcome to NetBSD!

We recommend that you create a non-root account and use su(1) for root access.
# dmesg -t | grep tlp
tlp0 at pci0 dev 7 function 0: DECchip 21041 Ethernet, pass 2.1
tlp0: interrupting at level 2
tlp0: Ethernet address 00:10:e0:00:09:46
tlp0: 10baseT, 10baseT-FDX, 10base2, 10base5
# ifconfig tlp0
tlp0: flags=0x8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ec_capabilities=1<VLAN_MTU>
        ec_enabled=0
        address: 00:10:e0:00:09:46
        media: Ethernet 10baseT
        status: no carrier
# dhcpcd -d
dhcpcd-8.1.6 starting
tlp0: executing `/libexec/dhcpcd-run-hooks' PREINIT
tlp0: executing `/libexec/dhcpcd-run-hooks' NOCARRIER
no interfaces have a carrier
forking to background
forked to background, child pid 520

  [ wait a minutes ]

# kill 520
# ifconfig tlp0
tlp0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ec_capabilities=1<VLAN_MTU>
        ec_enabled=0
        address: 00:10:e0:00:09:46
        media: Ethernet 10baseT
        status: active
# dhcpcd -d
dhcpcd-8.1.6 starting
tlp0: executing `/libexec/dhcpcd-run-hooks' PREINIT
tlp0: executing `/libexec/dhcpcd-run-hooks' CARRIER
DUID 00:01:00:01:25:e6:a0:56:00:10:e0:00:09:46
tlp0: IAID e0:00:09:46
tlp0: adding address fe80::4b15:3b7f:7442:89dd
tlp0: pltime infinity, vltime infinity
tlp0: delaying IPv6 router solicitation for 0.9 seconds
tlp0: delaying IPv4 for 0.2 seconds
tlp0: reading lease `/var/db/dhcpcd/tlp0.lease'
tlp0: rebinding lease of 10.0.0.150
tlp0: sending REQUEST (xid 0x59a7d2ed), next in 4.2 seconds
tlp0: acknowledged 10.0.0.150 from 10.0.0.254 `10.0.0.254'
tlp0: adding IP address 10.0.0.150/8 broadcast 10.255.255.255
tlp0: soliciting an IPv6 router
tlp0: delaying Router Solicitation for LL address
tlp0: sending Router Solicitation
tlp0: sending Router Solicitation
tlp0: DAD completed for 10.0.0.150
tlp0: leased 10.0.0.150 for 600 seconds
tlp0: renew in 300 seconds, rebind in 525 seconds
tlp0: writing lease `/var/db/dhcpcd/tlp0.lease'
tlp0: IP address 10.0.0.150/8 already exists
tlp0: adding route to 10.0.0.0/8
tlp0: adding default route via 10.0.0.254
tlp0: executing `/libexec/dhcpcd-run-hooks' BOUND
tlp0: Setting hostname: localhost
forking to background
forked to background, child pid 636
# 

---
Mon Feb 24 14:58:49 UTC 2020

NetBSD/cobalt (Amnesiac) (ttyZ0)

login: Feb 24 14:58:53  getty[573]: /dev/tty00: Device not configured
root
Feb 24 14:59:17  login: ROOT LOGIN (root) on tty ttyZ0
Last login: Mon Feb 24 14:54:30 2020 on ttyZ0
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
    2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 9.0 (GENERIC) #0: Mon Feb 24 03:01:07 JST 2020

Welcome to NetBSD!

We recommend that you create a non-root account and use su(1) for root access.
# ifconfig tlp0
tlp0: flags=0x8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ec_capabilities=1<VLAN_MTU>
        ec_enabled=0
        address: 00:10:e0:00:09:46
        media: Ethernet 10baseT
        status: no carrier
# ifconfig tlp0 up
# ifconfig tl;p0
tlp0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ec_capabilities=1<VLAN_MTU>
        ec_enabled=0
        address: 00:10:e0:00:09:46
        media: Ethernet 10baseT
        status: active
        inet6 fe80::210:e0ff:fe00:946%tlp0/64 flags 0x0 scopeid 0x1
# dhcpcd -d
dhcpcd-8.1.6 starting
tlp0: executing `/libexec/dhcpcd-run-hooks' PREINIT
tlp0: executing `/libexec/dhcpcd-run-hooks' CARRIER
DUID 00:01:00:01:25:e6:a0:56:00:10:e0:00:09:46
tlp0: IAID e0:00:09:46
tlp0: delaying IPv6 router solicitation for 0.5 seconds
tlp0: delaying IPv4 for 0.8 seconds
tlp0: soliciting an IPv6 router
tlp0: sending Router Solicitation
tlp0: reading lease `/var/db/dhcpcd/tlp0.lease'
tlp0: rebinding lease of 10.0.0.150
tlp0: sending REQUEST (xid 0x93023e81), next in 3.2 seconds
tlp0: acknowledged 10.0.0.150 from 10.0.0.254 `10.0.0.254'
tlp0: adding IP address 10.0.0.150/8 broadcast 10.255.255.255
tlp0: sending Router Solicitation
tlp0: DAD completed for 10.0.0.150
tlp0: leased 10.0.0.150 for 600 seconds
tlp0: renew in 300 seconds, rebind in 525 seconds
tlp0: writing lease `/var/db/dhcpcd/tlp0.lease'
tlp0: IP address 10.0.0.150/8 already exists
tlp0: adding route to 10.0.0.0/8
tlp0: adding default route via 10.0.0.254
tlp0: executing `/libexec/dhcpcd-run-hooks' BOUND
tlp0: Setting hostname: localhost
forking to background
forked to background, child pid 671
# 
---

Note in this case the DHCP server is connected via cross UTP cable
(no HUB in there) and the server has the following interface:
---
re0 at pci2 dev 0 function 0: RealTek 8100E/8101E/8102E/8102EL PCIe 10/100BaseTX (rev. 0x02)
re0: interrupting at msix1 vec 0
re0: Ethernet address xx:xx:xx:xx:xx:xx
re0: using 256 tx descriptors
rlphy0 at re0 phy 7: RTL8201L 10/100 media interface, rev. 1
rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
---

>How-To-Repeat:
See above.

>Fix:
No idea.
More generic method (dumb periodic polling etc.) is required for
such old non-MII PHY interfaces?

---
Izumi Tsutsui

>Audit-Trail:
From: Jason Thorpe <thorpej@me.com>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: bin/55010: dhcpcd(8) fails to detect carrier change on tlp(4)
 21041
Date: Sun, 1 Mar 2020 12:24:04 -0800

 > On Feb 23, 2020, at 11:35 PM, Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> =
 wrote:
 >=20
 > On tlp(4) on DECchip 21041 on Cobalt Qube 2700, dhcpcd(8) cannot
 > detect carrier change of the interface.
 >=20
 > Restarting dhcpcd(8), or executing "ifconfig tlp0 up"
 > before starting dhcpcd(8) works as expected.

 Perhaps on non-MII interfaces, we should mark them as "not capable of =
 updating link"?  There is a flag for that in the extended flags, I =
 think.  Not sure if it would help, but might be worth a shot.

 -- thorpej

From: Roy Marples <roy@marples.name>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/55010: dhcpcd(8) fails to detect carrier change on tlp(4)
Date: Sun, 5 Jul 2020 12:04:55 +0100

 dhcpcd-9.1.3 has grown the option --poll <msec=100> to poll the interface 
 periodically to see if it has carrier or not and take appropriate action.

 It should be noted that this is a workaround and the driver is really expected 
 to do better here.

 Roy

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.