Bug 245449

Summary: link down bge0 when bge_attach()
Product: Base System Reporter: ASOU Masato <asou>
Component: kernAssignee: freebsd-net (Nobody) <net>
Status: New ---    
Severity: Affects Only Me Keywords: patch
Priority: ---    
Version: 12.1-STABLE   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
dmesg after applied `STACKUP` patch. none

Description ASOU Masato 2020-04-08 07:37:06 UTC
Created attachment 213188 [details]
dmesg after applied `STACKUP` patch.

I have HPE ProLiant DL20 Gen9.  This PC have `Broadcom BCM5720 A0' as below:

$ dmesg
...snip...
FreeBSD 12.1-STABLE #28 r359720M: Wed Apr  8 15:26:49 JST 2020
  root@tornado-hp:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
...snip...
bge0: <Broadcom BCM5720 A0, ASIC rev. 0x5720000> mem 0x92b30000-0x92b3ffff,0x92b40000-0x92b4ffff,0x92b50000-0x92b5ffff at device 0.0 numa-domain 0 on pci4
bge0: APE FW version: NCSI v1.3.16.0
bge0: CHIP ID 0x05720000; ASIC REV 0x5720; CHIP REV 0x57200; PCI-E
miibus0: <MII bus> numa-domain 0 on bge0
brgphy0: <BCM5720C 1000BASE-T media interface> PHY 1 on miibus0
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
bge0: Using defaults for TSO: 65518/35/2048
bge0: Ethernet address: 98:f2:b3:8f:0c:94
pci0:2:0:1: failed to read VPD data.
bge1: <Broadcom BCM5720 A0, ASIC rev. 0x5720000> mem 0x92b00000-0x92b0ffff,0x92b10000-0x92b1ffff,0x92b20000-0x92b2ffff at device 0.1 numa-domain 0 on pci4
bge1: APE FW version: NCSI v1.3.16.0
bge1: CHIP ID 0x05720000; ASIC REV 0x5720; CHIP REV 0x57200; PCI-E
miibus1: <MII bus> numa-domain 0 on bge1
brgphy1: <BCM5720C 1000BASE-T media interface> PHY 2 on miibus1
brgphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
bge1: Using defaults for TSO: 65518/35/2048
bge1: Ethernet address: 98:f2:b3:8f:0c:95
...snip...



bge0 is assigned to IPMI and bge1 assigned to use from FreeBSD.

First, connect IPMI port by command `ipmitool -I lanplus -H 192.168.1.101  -U Administrator sol activate'.  The next step is to reboot FreeBSD.  Then, the IPMI connection will be broken.

I found this problem is occurred when bge_attach() was called.  I added the following STACKUP to bge_reset(), and the IPMI connection is not broken.

$ svnlite diff
Index: sys/dev/bge/if_bge.c
===================================================================
--- sys/dev/bge/if_bge.c        (revision 359720)
+++ sys/dev/bge/if_bge.c        (working copy)
@@ -3958,6 +3958,9 @@
                goto fail;
        }
 
+       /* Tell firmware we're alive. */
+       BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP);
+
        /* Attach driver netdump methods. */
        NETDUMP_SET(ifp, bge);
 

I don't think this fix is proper, but I think it's a hint to solve this problem.