Index | Thread | Search

From:
Jan Klemkow <jan@openbsd.org>
Subject:
Re: em(4): detect BMC network reachable
To:
Theo de Raadt <deraadt@openbsd.org>
Cc:
tech@openbsd.org
Date:
Fri, 6 Nov 2026 14:00:20 +0100

Download raw body.

Thread
On Fri, Nov 06, 2026 at 05:44:56AM -0600, Theo de Raadt wrote:
> I would use a warning that makes people worry more, something like:
> 
> %s: warning - BMC is enabled on this interface
> 
> That does not tell them how to fix it, but we know that's more difficult.
> It can also be slightly untrue.  The card has it's BMC decode logic enabled, but
> the BMC itself might be missing or corretcly disabled (not possible on some
> machines), but these situations cannoe be determined here.

Your right, this diff adds an explanation of the message to manpage.
So, users have a change to do the right actions.

ok?

thanks,
jan

Index: sys/dev/pci/if_em.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_em.c,v
diff -u -p -r1.384 if_em.c
--- sys/dev/pci/if_em.c	14 Aug 2026 06:40:24 -0000	1.384
+++ sys/dev/pci/if_em.c	6 Nov 2026 12:23:51 -0000
@@ -619,6 +619,16 @@ 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: warning - BMC is enabled on this interface\n",
+			    DEVNAME(sc));
+	}
+
 	/* Identify 82544 on PCI-X */
 	if (sc->hw.bus_type == em_bus_type_pcix &&
 	    sc->hw.mac_type == em_82544)
Index: sys/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
--- sys/dev/pci/if_em_hw.h	14 Aug 2026 07:21:33 -0000	1.103
+++ sys/dev/pci/if_em_hw.h	6 Nov 2026 12:22:13 -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 /* MC <-> 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 */
Index: share/man/man4/em.4
===================================================================
RCS file: /cvs/src/share/man/man4/em.4,v
diff -u -p -r1.55 em.4
--- share/man/man4/em.4	8 Sep 2021 20:29:21 -0000	1.55
+++ share/man/man4/em.4	6 Nov 2026 12:52:35 -0000
@@ -193,6 +193,17 @@ Only full-duplex mode is supported at th
 .Pp
 For more information on configuring this device, see
 .Xr ifconfig 8 .
+.Sh DIAGNOSTICS
+.Bl -tag -width Ds
+.It "warning - BMC is enabled on this interface"
+.Pp
+A baseboard management controller (BMC) shares this interface with the
+host and is reachable via the connected network.
+Traffic to and from the BMC is handled by the controller's management
+firmware and is not visible to the operating system.
+Depending on the system, the BMC's network access can be disabled
+in the BIOS or BMC configuration.
+.El
 .Sh SEE ALSO
 .Xr arp 4 ,
 .Xr gcu 4 ,