Bug report https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221122 documented an unfortunate behavior of Intel network cards and how it's triggered by bhyve vm's. I stumbled across it having the same problem on a 13.5-RELEASE install where my em0 would go down and come back up leading to a ~7 second network pause when the first vm was started or last vm stopped. I attempted the work-around in the bug report. I checked em0 for the features enabled, started the vm and checked again to see which features the bridge disabled. I came up with this /etc/rc.conf line: ifconfig_em0="DHCP -tso -lro -txcsum -rxcsum -txcsum6 -vlanmtu -vlanhwtag -vlanhwfilter -vlanhwtso -vlanhwcsum" Unfortunately this is not a complete solution. Before starting the first vm: options=4802020<JUMBO_MTU,WOL_MAGIC,NOMAP> After starting the first VM: options=802020<JUMBO_MTU,WOL_MAGIC> The bridge is still removing the option "NOMAP", and I believe that is what is still causing the network to flap. Unfortunately there is no ifconfig option to disable NOMAP. In fact, there appears to be no real documentation about it at all anywhere. Indeed, the only place I can even find this in the source is https://github.com/freebsd/freebsd-src/blob/main/sbin/ifconfig/ifconfig.c#L1674 where ifconfig prints it out. Should there be a "-nocap" for ifconfig? Is there some better solution?
Regarding "NOMAP" flag, bit 26, it's curious that the code names it IFCAP_B_MEXTPG / IFCAP_MEXTPG.
I see the other bug (where I burned a decent amount of time testing and got zero feedback) was closed: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221122 Is this truly fixed or not? The test case I outlined seemed pretty straightforward and my shoddy "fix" fixed it, but I'm not sure what came of all that, if anything, as there's no message noting how or if the bug was fixed.
I think saying "the bug" is a bit ambiguous. There appear to be multiple components to this problem: #1 Some Intel NICs drop link when particular capabilities are changed, like hardware offload. I have never seen clear documentation if this is a problem with the FreeBSD driver, or if this is firmware inside the NIC that is the responsibility of Intel. The attitude in several bug reports is "that's just the way it is with those NICs", but no one has ever documented WHY in any of the posts I have seen. #2 When a bridge is brought up it has to force all component interfaces to have the same set of capabilities. It appears in older code this was not documented, but somewhere along the way was documented and is now spelled out in the man 4 bridge page. While the paragraph is clear, I suspect many people would not understand the implications from just reading the man page. #3 A workaround for the combination of #1 and #2 is to manually disable the capabilities on one or more interfaces so that when the bridge starts up everything matches and the bridge code does not need to change them. This seems like a mostly reasonable workaround to me, and was the one I was trying to implement. It was in the process of implementing that I found this capability "NOMAP" which there appears to be no cli way to turn off, appears to be virtually undocumented, but which bridge must turn off, which means the entire workaround does not work. #4 An unstated workaround is to replace the Intel card with a non-Intel NIC that does not have this problem. In this bug report my main goal is to get an argument to ifconfig to disable "NOMAP" so the workaround is a functional workaround again. That would make me happy. However I can see how other people would prefer that #1 be fixed, either by fixing the FreeBSD driver or by getting Intel to fix their card. Given Intel generally produces high quality NIC cards that people like I can see how getting it fixed could be a priority for some.
this feels like a lot of words to discredit that this has a large impact on people that run lots of virtualized things. The reason some were asking for a toggle was to let the "it's not a problem" crowd carry on while those who found it not acceptable for their environment could change the behavior from default. In a server environment, it's not really an option to be either a) swapping out all your servers or b) adding new ethernet cards to expensive 1U servers that already include a high quality pair of NICs that operate fine under other OSes.
Does ifconfig em0 -mextpg fix the problem? I don't understand why ifconfig reports it as NOMAP instead of MEXTPG.
(In reply to Mark Johnston from comment #5) Yes! Adding -mextpg fixes it for me and removes the NOMAP option. So, should ifconfig output something like "MEXTPG" instead of "NOMAP"? Should "NOMAP" be added to the ifconfig man page?
(In reply to Leo Bicknell from comment #6) Well, the plot thickens... on one system I have em1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=4e504bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,LRO,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG> i.e., MEXTPG is listed instead of NOMAP. I don't understand how, the string "MEXTPG" doesn't appear anywhere in the ifconfig sources, but I do see "NOMAP".
ahh, this was implicitly fixed when ifconfig was converted to use netlink. Now the name comes from ifcap_bit_names in sys/net/if_strings.h. So, I believe the problem now is "just fixed". We should update the string in the non-netlink case too.
(In reply to Mark Johnston from comment #7) The reporter is on FreeBSD 13.5 . The IFCAP_NOMAP was introduced by John via commit https://cgit.freebsd.org/src/commit/?id=82334850ea451f7f6903be20e4836118e6a77460 , and later it was refactored by Gleb, and converted to IFCAP_MEXTPG via commit https://cgit.freebsd.org/src/commit/?id=3f43ada98c89bce5ae416e203ba0e81595a5cd88 . The commit was MFCed to stable/13 and is in releng/13.5 . It appears the refactoring is not complete. The `\33NOMAP` in ifconfig.c was left unchanged. I think that should be converted to `\33MEXTPG` ( for stable/13 ) . CC @Gleb .
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5017fdb728811fd3e15d7151524378f49a49aee1 commit 5017fdb728811fd3e15d7151524378f49a49aee1 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2025-09-19 19:18:27 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2025-09-19 19:18:27 +0000 ifconfig: Fix the display of the IFCAP_MEXTPG capability without netlink Historically this capability is IFCAP_NOMAP but it was renamed to IFCAP_MEXTPG. Catch up with the change 3f43ada98c89. PR: 289545 Fixes: 3f43ada98c89 Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG MFC after: 3 days sbin/ifconfig/ifconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5f472754ba6f9cc95607956c6e2ad6483c9dd157 commit 5f472754ba6f9cc95607956c6e2ad6483c9dd157 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2025-09-19 19:18:27 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2025-09-24 13:29:24 +0000 ifconfig: Fix the display of the IFCAP_MEXTPG capability without netlink Historically this capability is IFCAP_NOMAP but it was renamed to IFCAP_MEXTPG. Catch up with the change 3f43ada98c89. PR: 289545 Fixes: 3f43ada98c89 Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG MFC after: 3 days (cherry picked from commit 5017fdb728811fd3e15d7151524378f49a49aee1) sbin/ifconfig/ifconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=6a2eca1b38d762776676065d72518d30d1f1f348 commit 6a2eca1b38d762776676065d72518d30d1f1f348 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2025-09-19 19:18:27 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2025-09-27 15:11:40 +0000 ifconfig: Fix the display of the IFCAP_MEXTPG capability without netlink Historically this capability is IFCAP_NOMAP but it was renamed to IFCAP_MEXTPG. Catch up with the change 3f43ada98c89. PR: 289545 Fixes: 3f43ada98c89 Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG MFC after: 3 days (cherry picked from commit 5017fdb728811fd3e15d7151524378f49a49aee1) (cherry picked from commit 5f472754ba6f9cc95607956c6e2ad6483c9dd157) sbin/ifconfig/ifconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d334e045a471d2bb0db2f9bb750eb7e67ef0823f commit d334e045a471d2bb0db2f9bb750eb7e67ef0823f Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2025-09-19 19:18:27 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2025-10-04 16:43:27 +0000 ifconfig: Fix the display of the IFCAP_MEXTPG capability Historically this capability is IFCAP_NOMAP but it was renamed to IFCAP_MEXTPG. Catch up with the change 3f43ada98c89. This is a direct commit to stable/13. PR: 289545 Fixes: 3f43ada98c89 Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG sbin/ifconfig/ifconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)