Index | Thread | Search

From:
Jan Klemkow <jan@openbsd.org>
Subject:
em(4): detect BMC network reachable
To:
tech@openbsd.org
Date:
Fri, 6 Nov 2026 12:35:40 +0100

Download raw body.

Thread
Hi,

I'm struggling in the past to shutdown interface sharing between my OpenBSD
host system and the on-board BMC.  There might be a away to turn this off
via NVM.  But, I'm not sure about how to do this yet.

What helps users now, is to show them.  That there BMC/IPMI is reachable
via network now:

# dmesg | grep ^em
em0 at pci5 dev 0 function 0 "Intel I210" rev 0x03: msi, address 9c:6b:00:bf:20:e3
em0: BMC reachable via network
em1 at pci6 dev 0 function 0 "Intel I210" rev 0x03: msi, address 9c:6b:00:bf:20:e4

ok?

bye,
jan

Index: dev/pci/if_em.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_em.c,v
diff -u -p -r1.384 if_em.c
--- dev/pci/if_em.c	14 Aug 2026 06:40:24 -0000	1.384
+++ dev/pci/if_em.c	6 Nov 2026 10:53:19 -0000
@@ -619,6 +619,15 @@ em_attach(struct device *parent, struct 
 		printf("%s: PHY reset is blocked due to SOL/IDER session.\n",
 		    DEVNAME(sc));
 
+	/* Indicate whether the BMC is reachable via this port */
+	if (sc->hw.mac_type == em_i210 || sc->hw.mac_type == em_i350) {
+		uint32_t manc = E1000_READ_REG(&sc->hw, MANC);
+
+		if (ISSET(manc, E1000_MANC_RCV_TCO_EN) &&
+		    ISSET(manc, E1000_MANC_EN_BMC2NET))
+			printf("%s: BMC reachable via network\n", DEVNAME(sc));
+	}
+
 	/* Identify 82544 on PCI-X */
 	if (sc->hw.bus_type == em_bus_type_pcix &&
 	    sc->hw.mac_type == em_82544)
Index: dev/pci/if_em_hw.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_em_hw.h,v
diff -u -p -r1.103 if_em_hw.h
--- dev/pci/if_em_hw.h	14 Aug 2026 07:21:33 -0000	1.103
+++ dev/pci/if_em_hw.h	6 Nov 2026 10:54:29 -0000
@@ -2245,6 +2245,7 @@ struct e1000_adv_tx_context_desc {
 #define E1000_MANC_SMB_DATA_IN   0x08000000 /* SMBus Data In */
 #define E1000_MANC_SMB_DATA_OUT  0x10000000 /* SMBus Data Out */
 #define E1000_MANC_SMB_CLK_OUT   0x20000000 /* SMBus Clock Out */
+#define E1000_MANC_EN_BMC2NET    0x20000000 /* BMC gets network traffic */
 
 #define E1000_MANC_SMB_DATA_OUT_SHIFT  28 /* SMBus Data Out Shift */
 #define E1000_MANC_SMB_CLK_OUT_SHIFT   29 /* SMBus Clock Out Shift */