# ifconfig igb1 up # ifconfig igb1 igb1: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=4e527bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG> ether 00:e0:67:1f:29:91 media: Ethernet autoselect (1000baseT <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> by default interface has vlanhwfilter turned on (not visible above) # ifconfig bridge1 create vlanfilter addm igb1 untagged 1 tagged 20 up # ifconfig bridge1.20 create 192.168.20.77/24 up # # ifconfig bridge1 bridge1: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=10<VLAN_HWTAGGING> ether 58:9c:fc:10:e2:e3 id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 bridge flags=1<VLANFILTER> member: igb1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> port 2 priority 128 path cost 20000 vlan protocol 802.1q untagged 1 tagged 20 groups: bridge nd6 options=9<PERFORMNUD,IFDISABLED> # now try to ping gateway over vlan20: # ping -c1 192.168.20.1 PING 192.168.20.1 (192.168.20.1): 56 data bytes ping: sendto: Host is down --- 192.168.20.1 ping statistics --- 1 packets transmitted, 0 packets received, 100.0% packet loss >>> does not work now fix that: # ifconfig igb1 -vlanhwfilter # ping -c1 192.168.20.1 PING 192.168.20.1 (192.168.20.1): 56 data bytes 64 bytes from 192.168.20.1: icmp_seq=0 ttl=64 time=0.473 ms --- 192.168.20.1 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.473/0.473/0.473/0.000 ms >>> now it works side note - in both cases vlanhwfilter is not seen in ifconfig output (compare with first outut): # ifconfig igb0 igb0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 description: home options=e420bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,WOL_MAGIC,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS> ether 00:e0:67:1f:29:90 media: Ethernet autoselect (1000baseT <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> proposal - either refuse to add such interface into bridge or disable vlanhwfilter on adding
As a solution - if bridge configured with vlans, bypass this configuration into igbX according to tagged/untagged
forgot to mention: # uname -a FreeBSD ha 15.0-RELEASE FreeBSD 15.0-RELEASE releng/15.0-n280995-7aedc8de6446 GENERIC amd64
Can you please test whether the `vlanhwfilter` works without if_bridge(4) ? That is to say, ``` # ifconfig igb1 vlanhwfilter # ifconfig igb1.20 create # ifconfig igb1.20 inet 192.168.20.xxx/24 up # ping 192.168.20.1 ``` Please also be aware that you shall remove the interface igb1 out from bridge memeber firstly and then do the test.
(In reply to Zhenlei Huang from comment #3) Yes, igb0 itself + vlan works as expected: # ifconfig igb1 vlanhwfilter up # ifconfig igb1.20 create 192.168.20.88/24 up # ping -c1 192.168.20.88 PING 192.168.20.88 (192.168.20.88): 56 data bytes 64 bytes from 192.168.20.88: icmp_seq=0 ttl=64 time=0.296 ms --- 192.168.20.88 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.296/0.296/0.296/0.000 ms # # ifconfig -v igb1 igb1: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=4e527bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG> ether 00:e0:67:1f:29:91 media: Ethernet autoselect (1000baseT <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> drivername: igb1
(In reply to Zhenlei Huang from comment #3) The main problem is that the bridge doesn't set or inherit the VLAN_MTU flag. Therefore, the VLAN driver lowers the MTU because it believes the parent interface can't send packets with an MTU of 1500. Quick and dirty patch, fixes the problem: diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 9a468a8eb462..fe24991ad84f 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -871,7 +871,7 @@ bridge_clone_create(struct if_clone *ifc, char *name, size_t len, ifp->if_softc = sc; if_initname(ifp, bridge_name, ifd->unit); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_capabilities = ifp->if_capenable = IFCAP_VLAN_HWTAGGING; + ifp->if_capabilities = ifp->if_capenable = IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; ifp->if_ioctl = bridge_ioctl; #ifdef ALTQ ifp->if_start = bridge_altq_start; # ifconfig bridge1 create mtu 1500 up # ifconfig bridge1.1 create up # ifconfig bridge1.1 bridge1.1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=0 ether 58:9c:fc:10:05:32 groups: vlan vlan: 1 vlanproto: 802.1q vlanpcp: 0 parent interface: bridge1 nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> root@xenon:/home/XeNoN # ifconfig bridge1 bridge1: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=18<VLAN_MTU,VLAN_HWTAGGING> ether 58:9c:fc:10:05:32 id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 bridge flags=0<> groups: bridge nd6 options=9<PERFORMNUD,IFDISABLED>
Sorry, I mixed up the bugs. My message refers to PR 292760
(In reply to Aleksandr Fedorov from comment #5) The report by vova, now fix that: # ifconfig igb1 -vlanhwfilter # ping -c1 192.168.20.1 PING 192.168.20.1 (192.168.20.1): 56 data bytes 64 bytes from 192.168.20.1: icmp_seq=0 ttl=64 time=0.473 ms --- 192.168.20.1 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.473/0.473/0.473/0.000 ms >>> now it works drive me to think about the implementation of vlan over if_bridge(4). Currently on configuring the vid ( VLAN ID ), the vlan_config event handler is invoked to let the drivers, obviously has the IFCAP_VLAN_HWFILTER capability, to program hardware / firmware's vlan filters. The mismatched tagged packets will all be silently dropped by the hardware. Well if_bridge(4) does not register vlan_config event, hence unable to pass correct VLAN IDs to the bridge members those has IFCAP_VLAN_HWFILTER enabled. Disabling the IFCAP_VLAN_HWFILTER capability of member interface can be a rescue, since it makes the member interface into *promiscuous* mode for tagged packets. I'm CCing Lexi to see if she's working on that.
(In reply to Zhenlei Huang from comment #7) > Well if_bridge(4) does not register vlan_config event, hence unable to pass correct > VLAN IDs to the bridge members those has IFCAP_VLAN_HWFILTER enabled. I might be wrong about the above analysis. if_bridge(4) actually will put the member interfaces into promiscuous mode. So maybe igb(4) should respect promiscuous mode rather than insisting filtering out unwanted tagged packets ? I do not have igb(4) hardware to test. @vova May you please have test with the promiscuous mode ? ``` # ifconfig igb1.20 destroy # ifconfig igb1 vlanhwfilter up # ifconfig igb1 promisc # tcpdump -Kpenvi igb1 ``` then ping from other nodes on vlan20, say from 192.168.20.1 ``` # ping -c1 192.168.20.88 ``` and report the traffic capture by tcpdump on igb1. If igb(4) does not respect promiscuous mode, then the nic will definitely drop all arp requests tagged with vlan id 20, and I'll expect tcpdump(1) will see nothing from vlan 20.
(In reply to Zhenlei Huang from comment #8) yep, looks like in promisc it filters vlans: # ifconfig igb1 vlanhwfilter up # ifconfig igb1 promisc # tcpdump -Kpenvi igb1 vlan 20 tcpdump: listening on igb1, link-type EN10MB (Ethernet), snapshot length 262144 bytes ^C 0 packets captured 301 packets received by filter 0 packets dropped by kernel # ifconfig igb1 -vlanhwfilter # tcpdump -Kpenvi igb1 vlan 20 tcpdump: listening on igb1, link-type EN10MB (Ethernet), snapshot length 262144 bytes 17:18:10.786218 00:a0:98:1b:f4:df > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 60: vlan 20, p 0, ethertype ARP (0x0806), Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.20.88 tell 192.168.20.2, length 42 17:18:11.849720 00:a0:98:1b:f4:df > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 60: vlan 20, p 0, ethertype ARP (0x0806), Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.20.88 tell 192.168.20.2, length 42 17:18:12.872401 00:a0:98:1b:f4:df > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 60: vlan 20, p 0, ethertype ARP (0x0806), Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.20.88 tell 192.168.20.2, length 42 ^C 3 packets captured 19 packets received by filter 0 packets dropped by kernel
(In reply to Zhenlei Huang from comment #7) > Well if_bridge(4) does not register vlan_config event, hence unable to pass > correct VLAN IDs to the bridge members those has IFCAP_VLAN_HWFILTER enabled. > Disabling the IFCAP_VLAN_HWFILTER capability of member interface can be a rescue, > since it makes the member interface into *promiscuous* mode for tagged packets. hm ... in face after any reconfiguration - if_bridge knows set of VLANs for each member port: # ifconfig bridge0 bridge0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1504 description: igb0 options=10<VLAN_HWTAGGING> ether 58:9c:fc:10:3f:e4 id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 bridge flags=1<VLANFILTER> member: epair3a flags=943<LEARNING,DISCOVER,PRIVATE,AUTOEDGE,AUTOPTP> port 16 priority 128 path cost 2000 vlan protocol 802.1q untagged 20 tagged 1 member: epair1a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> port 9 priority 128 path cost 2000 vlan protocol 802.1q untagged 1 member: epair2a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> port 12 priority 128 path cost 2000 vlan protocol 802.1q untagged 20 member: igb0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> port 1 priority 128 path cost 55 vlan protocol 802.1q untagged 1 tagged 20 groups: bridge nd6 options=9<PERFORMNUD,IFDISABLED> The only "issue" here is who calling whom and when?
Created attachment 267578 [details] Patch to fix disabling vlan filter (In reply to vova from comment #10) Thanks for testing this ! Can you please try the uploaded patch ? Given the em(4) driver is by default statically linked into the kernel, you may want to apply the patch and build a new kernel and test with it.
(In reply to Zhenlei Huang from comment #11) con patch - works # ifconfig igb1 up # ifconfig bridge1 create vlanfilter addm igb1 untagged 1 tagged 20 up # ifconfig bridge1.20 create 192.168.20.77/24 up # ping -c1 192.168.20.1 PING 192.168.20.1 (192.168.20.1): 56 data bytes 64 bytes from 192.168.20.1: icmp_seq=0 ttl=64 time=0.209 ms --- 172.22.20.1 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.209/0.209/0.209/0.000 ms
But, is it correct approach? I mean filtering by our MAC (-promisc) is not the same as filtering by our VLANs (vlanhwfilter). Why one should turn off another? If igb0 added as addm igb0 tagged 1,2,3 - we should configure vlanhwfilter to pass VLANs 1,2,3, not turn hardware filter off?
(In reply to vova from comment #13) > But, is it correct approach? I'm focusing on the bugs in driver, so probably my previous comment >> Patch to fix disabling vlan filter is misleading. I intended to fix setting promiscuous mode of the driver. > I mean filtering by our MAC (-promisc) is not the same as filtering by our VLANs (vlanhwfilter). > Why one should turn off another? The short answer is, bridge(4) is currently designed so, see also ifconfig(8), ``` addm interface [options ...] Add the interface named by interface as a member of the bridge. The interface is put into promiscuous mode so that it can receive every packet sent on the network. ``` The bridge member will be put into promiscuous mode. > If igb0 added as addm igb0 tagged 1,2,3 - we should configure vlanhwfilter to pass > VLANs 1,2,3, not turn hardware filter off? The long answer, before Lexi brought the vlanfilter for bridge(4), the bridge(4) will want to intercept all packets, tagged or not, destined for us or not. So putting member interfaces into promiscuous mode is the simplest solution. Well indeed the NIC driver / hardware can be implemented with such feature, that it is programmed with vlan filters to accept wanted tagged packets. This requires introducing a new kind of **promiscuous mode** into the net stack, to distinguish with currently well known one. Or we introduce some breakage, that is re-purposing the promiscuous mode. The former introduce more complexity, well the latter will make people unhappy. Good news is that, the ports on modern switches can be easily configured with desired VLANs and the switch itself can do VLAN filter efficiently. So no bother the NICs to do that.
(In reply to Zhenlei Huang from comment #14) > Well indeed the NIC driver / hardware can be implemented with such feature, that > it is programmed with vlan filters to accept wanted tagged packets. This requires > introducing a new kind of **promiscuous mode** into the net stack, to distinguish > with currently well known one. Or we introduce some breakage, that is re-purposing > the promiscuous mode. Not sure what you ment under "a new kind of **promiscuous mode**" I am not sure, dimention is already here as "vlanfilter", thinking if these two dimentions are intersecting: -promisc ->> filters out non mine frames (these that as in ether dst not my address) parametrized by: my MAC(s) when ON clearly required to be OFF for bridge functioning, as it forwards packates vlanhwfilter ->> filters out VLANs I am not interested in parametrized by: my VLAN(s) for bridge it is fine to be either ON or OFF as far as VLAN(s) are propagated for me sounds more logical not connect one to another.
(In reply to vova from comment #15) > Not sure what you ment under "a new kind of **promiscuous mode**" Current promiscuous mode reads, the NIC accepts any packets it receives. That is to say, any frames, tagged or not, destined for us or not, or event bad frames ( wrong CRCs, em(4) has a knob for that ) should be passed in. That implies `allmulti` and `-vlanhwfilter`. "a new kind of **promiscuous mode**" or "a new type of **promiscuous mode**", shall be `allunicast` if I name it. It hints the driver whether the unicast frames not destined for us should be accepted or dropped. > I am not sure, dimention is already here as "vlanfilter", > thinking if these two dimentions are intersecting: > -promisc ->> filters out non mine frames (these that as in ether dst not my address) > parametrized by: my MAC(s) when ON > clearly required to be OFF for bridge functioning, as it forwards packates > vlanhwfilter ->> filters out VLANs I am not interested in > parametrized by: my VLAN(s) > for bridge it is fine to be either ON or OFF as far as VLAN(s) are propagated > for me sounds more logical not connect one to another. If we have `allunicast` mode, then bridge(4) can benefits it from putting member interface into `allunicast` and `allmulti` mode, while not loosing the capability to let member interfaces do vlan filtering when `vlanhwfilter` is available. I'm sure how many people will be interested with that idea. I can prototype it on if_em(4) when I have spare time. Are you willing to test it ? BTW, I'd like to give your credentials since you have tested the patch to fix setting the promisc mode of if_em(4). Does `vova@zote.me` looks good to you, or you are willing to use the real name?
(In reply to Zhenlei Huang from comment #16) > If we have `allunicast` mode, then bridge(4) can benefits it from putting member > interface into `allunicast` and `allmulti` mode, while not loosing the capability > to let member interfaces do vlan filtering when `vlanhwfilter` is available. So, intention is to keep promisc as more or less debug mode which will receive all traffic with no filters and saniti checks and invent different mode which will pass all traffic "as a bridge" and make if_bridge to use it? So, we will have following modes: 1. My traffic - normal host operations - VLAN filtering can be HW-offloaded - checksums validation can be HW-offloaded 2. Debug mode - bad for production / heavy load on CPU - all packates accepted - no filters can be HW-offloaded 3. Bridging mode - operating as a switch - VLAN filtering can be HW-offloaded - checksums validation can be HW-offloaded and your approach assumes: "My traffic" -> -promisc vlanhwfilter "Debug mode" -> promisc (-vlanhwfilter implied) "Bridging mode" -> allunicast (new option for many interfaces - like promisc but with no side effects) + vlanhwfilter can we consider as alternative where we no need to introduce new interface option: "My traffic" -> -promisc vlanhwfilter "Debug mode" -> promisc -vlanhwfilter "Bridging mode" -> promisc vlanhwfilter difference is that -vlanhwfilter does not implied into promisc in the seconf case, not sure which is better. > I'm sure how many people will be interested with that idea. I can prototype it > on if_em(4) when I have spare time. Are you willing to test it ? I can test it for sure, but probably worth to discuss first with net@ > Does `vova@zote.me` looks good to you, or you are willing to use the real name? absolutely fine
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e63ee5fedb8dab51f1bd6d24cc650b68d9663db5 commit e63ee5fedb8dab51f1bd6d24cc650b68d9663db5 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2026-02-02 12:26:31 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2026-02-02 12:26:31 +0000 e1000: Fix setting the promiscuous mode The variable reg_rctl stores the value read from reg E1000_RCTL. It may contain bits E1000_RCTL_VFE and E1000_RCTL_CFIEN which control VLAN hardware filter feature. The promiscuous mode implies all tagged or untagged packets should be accepted, so the VLAN hardware filter feature should be disabled when enabling the promiscuous mode. Calling em_if_vlan_filter_disable() did the task, but later writing the value of reg_rctl back to the reg E1000_RCTL may restore the feature. Move the calling of em_if_vlan_filter_disable() after writing the reg to fix that. PR: 292759 Reviewed by: kbowling Tested by: vova@zote.me Fixes: 2796f7cab107 e1000: Fix up HW vlan ops MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54973 sys/dev/e1000/if_em.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=8880678b7a47ccfdcc14d3e7cad7f137862dccea commit 8880678b7a47ccfdcc14d3e7cad7f137862dccea Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2026-02-02 12:26:31 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2026-02-05 05:12:36 +0000 e1000: Fix setting the promiscuous mode The variable reg_rctl stores the value read from reg E1000_RCTL. It may contain bits E1000_RCTL_VFE and E1000_RCTL_CFIEN which control VLAN hardware filter feature. The promiscuous mode implies all tagged or untagged packets should be accepted, so the VLAN hardware filter feature should be disabled when enabling the promiscuous mode. Calling em_if_vlan_filter_disable() did the task, but later writing the value of reg_rctl back to the reg E1000_RCTL may restore the feature. Move the calling of em_if_vlan_filter_disable() after writing the reg to fix that. PR: 292759 Reviewed by: kbowling Tested by: vova@zote.me Fixes: 2796f7cab107 e1000: Fix up HW vlan ops MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54973 (cherry picked from commit e63ee5fedb8dab51f1bd6d24cc650b68d9663db5) sys/dev/e1000/if_em.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=3cfe90545f016fa190158aa4830f3256e01a7cb2 commit 3cfe90545f016fa190158aa4830f3256e01a7cb2 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2026-02-02 12:26:31 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2026-02-05 05:14:43 +0000 e1000: Fix setting the promiscuous mode The variable reg_rctl stores the value read from reg E1000_RCTL. It may contain bits E1000_RCTL_VFE and E1000_RCTL_CFIEN which control VLAN hardware filter feature. The promiscuous mode implies all tagged or untagged packets should be accepted, so the VLAN hardware filter feature should be disabled when enabling the promiscuous mode. Calling em_if_vlan_filter_disable() did the task, but later writing the value of reg_rctl back to the reg E1000_RCTL may restore the feature. Move the calling of em_if_vlan_filter_disable() after writing the reg to fix that. PR: 292759 Reviewed by: kbowling Tested by: vova@zote.me Fixes: 2796f7cab107 e1000: Fix up HW vlan ops MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54973 (cherry picked from commit e63ee5fedb8dab51f1bd6d24cc650b68d9663db5) (cherry picked from commit 8880678b7a47ccfdcc14d3e7cad7f137862dccea) sys/dev/e1000/if_em.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=b562bbc06adf2039e00676440c83dcd7f6900fa8 commit b562bbc06adf2039e00676440c83dcd7f6900fa8 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2026-02-02 12:26:31 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2026-02-05 05:28:50 +0000 e1000: Fix setting the promiscuous mode The variable reg_rctl stores the value read from reg E1000_RCTL. It may contain bits E1000_RCTL_VFE and E1000_RCTL_CFIEN which control VLAN hardware filter feature. The promiscuous mode implies all tagged or untagged packets should be accepted, so the VLAN hardware filter feature should be disabled when enabling the promiscuous mode. Calling em_if_vlan_filter_disable() did the task, but later writing the value of reg_rctl back to the reg E1000_RCTL may restore the feature. Move the calling of em_if_vlan_filter_disable() after writing the reg to fix that. PR: 292759 Reviewed by: kbowling Tested by: vova@zote.me Fixes: 2796f7cab107 e1000: Fix up HW vlan ops MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54973 (cherry picked from commit e63ee5fedb8dab51f1bd6d24cc650b68d9663db5) (cherry picked from commit 8880678b7a47ccfdcc14d3e7cad7f137862dccea) (cherry picked from commit 3cfe90545f016fa190158aa4830f3256e01a7cb2) sys/dev/e1000/if_em.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
was this resolved by e1000 change or is there a bridge(4) issue remaining here?
(In reply to Lexi Winter from comment #22) > was this resolved by e1000 change or is there a bridge(4) issue remaining here? This is caused by a regression from 2796f7cab107 (e1000: Fix up HW vlan ops), which is barely noticed until users want vlans over bridge(4), or vlans over a bridge member (say epair or if_tap ). I believe the latter setup is rare. No action is need for bridge(4) right now.
(In reply to Lexi Winter from comment #22) Yes, for me looks fixed I can confirm that with patch - it work without special "tweaks" # cat /etc/rc.conf ifconfig_igb0="up description 'home'" ifconfig_igb1="down" cloned_interfaces="bridge0 bridge0.1" ifconfig_bridge0="vlanmtu vlanfilter addm igb0 untagged 1 tagged 20 up description igb0 mtu 1504" ifconfig_bridge0_1="192.168.9.14/24 up" # what it shows: # ifconfig igb0 igb0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1504 description: home options=e520bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS> also # ifconfig igb0 vlanhwfilter does not break nothing only open question remaning -> probably, performance-wise, instead of turning it off underneath it is better to propagate vlan ACL from bridge to igbX? but, as we discussed, it leads to pivoting from promisc to some new mode ...
(In reply to vova from comment #24) > instead of turning it off underneath it is better to propagate vlan ACL > from bridge to igbX? we still have to enable promiscuous mode because we need to receive frames for hosts on the other side of the bridge. e.g., if bridge contains igb0 and igb1, and host 11:22:33:44:55:66 is on igb1, then igb0 must receive frames for 11:22:33:44:55:66. we can't just offload the bridge host table to the NIC because we also need to receive frames for hosts we haven't learnt, so we can flood them. in theory, we could program the hardware to only rx frames for VLANs we're interested in, but stay in promiscuous mode for those VLANs, if the hardware supports that. but i think the real-world performance benefit would be very low, because why would you receive frames for a VLAN you aren't interested in to begin with? simply don't configure that VLAN on the switch side. zlei: thank you for confirmation, just wanted to make sure there's nothing i needed to do here.
(In reply to Lexi Winter from comment #25) no doubt that for bridge we should accept frames for all dst, not only for ours. my confusion was caused by slight drift in understanding - what is promisc mode and what are nics capabilityies -> filter incoming traffic by dst mac and filter incoming traffic by vlans. so, for promisc mode assumes both filters turned off, while bridge requires only first one to be turned off (by dst mac), and second one (by vlan) can be in place according to bridge port rules. And, yes, absolutely agree with you that such approach sounds like "ideal state of things", and for start we can just reuse promisc mode