Created attachment 265874 [details] traffic dump Bad udp checksum, when `txcsum` enabled on `epair` interface Host mashine ``` bge1: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=c009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWTSO,LINKSTATE> ether c4:34:6b:b8:e4:39 media: Ethernet autoselect (1000baseT <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> bridge1: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=0 ether 58:9c:fc:10:ff:ca 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 member: epair1a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> ifmaxaddr 0 port 19 priority 128 path cost 2000 member: bge1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> ifmaxaddr 0 port 2 priority 128 path cost 55 groups: bridge epair1a: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=20000b<RXCSUM,TXCSUM,VLAN_MTU,RXCSUM_IPV6> ether 02:ef:5d:1e:0d:0a groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=9<PERFORMNUD,IFDISABLED> ``` Inside jail ``` epair1b: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=20000b<RXCSUM,TXCSUM,VLAN_MTU,RXCSUM_IPV6> ether 02:ef:5d:1e:0d:0b inet 193.34.20.8 netmask 0xfffffff0 broadcast 193.34.20.15 groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> ``` 193.34.20.4 - neighbors machine Trying `drill i.ua @193.34.20.4` inside jail On neighbor machine `bad checksum` counter increased by three ``` # netstat -sp udp udp: 5505590454 datagrams received 0 with incomplete header 17 with bad data length field 46288 with bad checksum ``` PCAP file attached first three packets - unanswered (bad checksum) fourth packet - with disabled `txcsum` on 'epair1a` fifth packet - answer to the fourth enable/disable txcsum on bge1 interface - does not give results enable/disable net.inet.udp.checksum - does not give results Additional dev.bge.3.forced_udpcsum: 0 dev.bge.2.forced_udpcsum: 0 dev.bge.1.forced_udpcsum: 0 dev.bge.0.forced_udpcsum: 0 =============================================================================== ALSO. It's unbelievable - but it's true I have no idea why it works this way. Inside Jail # ping 193.34.20.5 PING 193.34.20.5 (193.34.20.5): 56 data bytes ^C --- 193.34.20.5 ping statistics --- 2 packets transmitted, 0 packets received, 100.0% packet loss Press any key to continue... # ping 193.34.20.4 PING 193.34.20.4 (193.34.20.4): 56 data bytes 64 bytes from 193.34.20.4: icmp_seq=0 ttl=64 time=0.702 ms 64 bytes from 193.34.20.4: icmp_seq=1 ttl=64 time=0.465 ms
Copy/paste mistake ``` bge1: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=c009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWTSO,LINKSTATE> ether c4:34:6b:b8:e4:39 inet 193.34.20.5 netmask 0xfffffff0 broadcast 193.34.20.15 media: Ethernet autoselect (1000baseT <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> ``` in total 193.34.20.5 - on bge1 on host machine 193.34.20.8 - on epair1b inside jail 193.34.20.4 - neighbor machine with DNS server
Let us try to reproduce this...
In addition I think, checksum depends on the IP address drill i.ua @1.1.1.1 - work drill i.ua @8.8.8.8 - not work
Could you test something with txcsum enabled? (This is just based on reading the man page of bge) Can you set sysctl dev.bge.1.forced_udpcsum=1 and then run ifconfig bge1 down ifconfig bge1 up and retry drill i.ua @193.34.20.4 from within the jail? Can you also using TCP from within the jail to some external host? Like ssh'ing from the jail to 193.34.20.4? Please keep net.inet.udp.checksum to the default value of 1.
(In reply to Michael Tuexen from comment #4) TCP work fine. Problem only with UDP. I can only do the experiment on Monday, otherwise I might lose access to the hardware. This configuration worked fine on the September build FreeBSD 14.3-STABLE without any changes. It was only when I updated to the December build that problems appeared.
(In reply to Michael Tuexen from comment #4) On host machine ``` root@DL360_Gen9_m19:/home/mitya # sysctl sysctl dev.bge.1.forced_udpcsum=1 dev.bge.1.forced_udpcsum: 0 -> 1 root@DL360_Gen9_m19:/home/mitya # ifconfig bge1 down root@DL360_Gen9_m19:/home/mitya # ifconfig bge1 up root@DL360_Gen9_m19:/home/mitya # ifconfig bge1 bge1: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=c009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWTSO,LINKSTATE> ether c4:34:6b:b8:e4:39 inet 193.34.20.5 netmask 0xfffffff0 broadcast 193.34.20.15 media: Ethernet autoselect (1000baseT <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> root@DL360_Gen9_m19:/home/mitya # ifconfig epair1a epair1a: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=20000b<RXCSUM,TXCSUM,VLAN_MTU,RXCSUM_IPV6> ether 02:ef:5d:1e:0d:0a groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=9<PERFORMNUD,IFDISABLED> ``` Inside jail ``` root@mail:/ # ifconfig epair1b epair1b: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=20000b<RXCSUM,TXCSUM,VLAN_MTU,RXCSUM_IPV6> ether 02:ef:5d:1e:0d:0b inet 193.34.20.8 netmask 0xfffffff0 broadcast 193.34.20.15 groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> root@mail:/ # drill i.ua @193.34.20.4 ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 12682 ;; flags: qr rd ra ; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;; i.ua. IN A ;; ANSWER SECTION: i.ua. 21 IN A 104.18.2.81 i.ua. 21 IN A 104.18.3.81 ;; AUTHORITY SECTION: ;; ADDITIONAL SECTION: ;; Query time: 0 msec ;; SERVER: 193.34.20.4 ;; WHEN: Mon Dec 8 12:32:25 2025 ;; MSG SIZE rcvd: 54 ``` BUT ``` root@mail:/ # ping 193.34.20.5 PING 193.34.20.5 (193.34.20.5): 56 data bytes ^C --- 193.34.20.5 ping statistics --- 4 packets transmitted, 0 packets received, 100.0% packet loss root@mail:/ # ping 193.34.20.4 PING 193.34.20.4 (193.34.20.4): 56 data bytes 64 bytes from 193.34.20.4: icmp_seq=0 ttl=64 time=0.482 ms 64 bytes from 193.34.20.4: icmp_seq=1 ttl=64 time=0.283 ms 64 bytes from 193.34.20.4: icmp_seq=2 ttl=64 time=0.479 ms 64 bytes from 193.34.20.4: icmp_seq=3 ttl=64 time=0.323 ms ^C --- 193.34.20.4 ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.283/0.392/0.482/0.090 ms ```
I searched my update history. Previous version on host and jail machine - 14.3-STABLE from 2025-08-22 I have one more jail with epair on this host machine ``` bridge1: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=0 ether 58:9c:fc:10:ff:ca 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 member: epair1a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> ifmaxaddr 0 port 19 priority 128 path cost 2000 member: epair0a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> ifmaxaddr 0 port 17 priority 128 path cost 2000 member: bge1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> ifmaxaddr 0 port 2 priority 128 path cost 55 groups: bridge epair0a: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=200009<RXCSUM,CXCSUM,VLAN_MTU,RXCSUM_IPV6> ether 02:15:ec:28:01:0a groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active ``` Iside jail ``` epair0b: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=20000b<RXCSUM,TXCSUM,VLAN_MTU,RXCSUM_IPV6> ether 02:15:ec:28:01:0b inet 193.34.20.6 netmask 0xfffffff0 broadcast 193.34.20.15 groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> root@unbound:/ # drill i.ua @193.34.20.6 ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 56983 ;; flags: qr rd ra ; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;; i.ua. IN A ;; ANSWER SECTION: i.ua. 149 IN A 104.18.3.81 i.ua. 149 IN A 104.18.2.81 ;; AUTHORITY SECTION: ;; ADDITIONAL SECTION: ;; Query time: 0 msec ;; SERVER: 193.34.20.6 ;; WHEN: Mon Dec 8 13:03:44 2025 ;; MSG SIZE rcvd: 54 ``` BUT ''' root@unbound:/ # ping 193.34.20.5 PING 193.34.20.5 (193.34.20.5): 56 data bytes ^C --- 193.34.20.5 ping statistics --- 3 packets transmitted, 0 packets received, 100.0% packet loss root@unbound:/ # ping 193.34.20.4 PING 193.34.20.4 (193.34.20.4): 56 data bytes 64 bytes from 193.34.20.4: icmp_seq=0 ttl=64 time=0.410 ms 64 bytes from 193.34.20.4: icmp_seq=1 ttl=64 time=0.388 ms ^C --- 193.34.20.4 ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.388/0.399/0.410/0.011 ms root@unbound:/ # ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8): 56 data bytes 64 bytes from 8.8.8.8: icmp_seq=0 ttl=120 time=24.884 ms 64 bytes from 8.8.8.8: icmp_seq=1 ttl=120 time=24.976 ms ^C --- 8.8.8.8 ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 24.884/24.930/24.976/0.046 ms root@unbound:/ # arp -an ? (193.34.20.5) at c4:34:6b:b8:e4:39 on epair0b expires in 1192 seconds [ethernet] ? (193.34.20.4) at 94:57:a5:55:a2:21 on epair0b expires in 996 seconds [ethernet] ? (193.34.20.8) at 02:ef:5d:1e:0d:0b on epair0b expires in 793 seconds [ethernet] '''
On host machine from first jail ``` root@DL360_Gen9_m19:/home/mitya # tcpdump -envv -i bge1 host 193.34.20.8 and proto ICMP tcpdump: listening on bge1, link-type EN10MB (Ethernet), snapshot length 262144 bytes 15:01:51.478254 02:ef:5d:1e:0d:0b > c4:34:6b:b8:e4:39, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 26254, offset 0, flags [none], proto ICMP (1), length 84) 193.34.20.8 > 193.34.20.5: ICMP echo request, id 50894, seq 0, length 64 15:01:52.478934 02:ef:5d:1e:0d:0b > c4:34:6b:b8:e4:39, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 26255, offset 0, flags [none], proto ICMP (1), length 84) 193.34.20.8 > 193.34.20.5: ICMP echo request, id 50894, seq 1, length 64 15:01:53.511342 02:ef:5d:1e:0d:0b > c4:34:6b:b8:e4:39, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 1919, offset 0, flags [none], proto ICMP (1), length 84) 193.34.20.8 > 193.34.20.5: ICMP echo request, id 50894, seq 2, length 64 15:01:54.515891 02:ef:5d:1e:0d:0b > c4:34:6b:b8:e4:39, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 51781, offset 0, flags [none], proto ICMP (1), length 84) 193.34.20.8 > 193.34.20.5: ICMP echo request, id 50894, seq 3, length 64 15:01:55.426640 02:ef:5d:1e:0d:0b > 88:28:fb:29:a4:6c, ethertype IPv4 (0x0800), length 78: (tos 0x0, ttl 64, id 54890, offset 0, flags [none], proto ICMP (1), length 64) 193.34.20.8 > 87.120.191.127: ICMP 193.34.20.8 udp port 123 unreachable, length 44 (tos 0x0, ttl 249, id 54321, offset 0, flags [none], proto UDP (17), length 36) 87.120.191.127.36373 > 193.34.20.8.123: [no cksum] NTPv2, Reserved, length 8 Leap indicator: (0) ^C 5 packets captured 7462 packets received by filter 0 packets dropped by kernel ``` from second jail ``` root@DL360_Gen9_m19:/home/mitya # tcpdump -envv -i bge1 host 193.34.20.5 and proto ICMP tcpdump: listening on bge1, link-type EN10MB (Ethernet), snapshot length 262144 bytes 15:02:54.598806 02:15:ec:28:01:0b > c4:34:6b:b8:e4:39, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 55087, offset 0, flags [none], proto ICMP (1), length 84) 193.34.20.6 > 193.34.20.5: ICMP echo request, id 60110, seq 0, length 64 15:02:55.604780 02:15:ec:28:01:0b > c4:34:6b:b8:e4:39, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 11515, offset 0, flags [none], proto ICMP (1), length 84) 193.34.20.6 > 193.34.20.5: ICMP echo request, id 60110, seq 1, length 64 15:02:56.607245 02:15:ec:28:01:0b > c4:34:6b:b8:e4:39, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 11516, offset 0, flags [none], proto ICMP (1), length 84) 193.34.20.6 > 193.34.20.5: ICMP echo request, id 60110, seq 2, length 64 15:02:57.610034 02:15:ec:28:01:0b > c4:34:6b:b8:e4:39, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 11517, offset 0, flags [none], proto ICMP (1), length 84) 193.34.20.6 > 193.34.20.5: ICMP echo request, id 60110, seq 3, length 64 15:02:58.613346 02:15:ec:28:01:0b > c4:34:6b:b8:e4:39, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 11518, offset 0, flags [none], proto ICMP (1), length 84) 193.34.20.6 > 193.34.20.5: ICMP echo request, id 60110, seq 4, length 64 15:02:59.613541 02:15:ec:28:01:0b > c4:34:6b:b8:e4:39, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 22118, offset 0, flags [none], proto ICMP (1), length 84) 193.34.20.6 > 193.34.20.5: ICMP echo request, id 60110, seq 5, length 64 ^C 6 packets captured 6957 packets received by filter 0 packets dropped by kernel ```
On host machine mitya@DL360_Gen9_m19:/etc# arp -an ? (193.34.20.6) at 02:15:ec:28:01:0b on bge1 expires in 853 seconds [ethernet] ? (193.34.20.5) at c4:34:6b:b8:e4:39 on bge1 permanent [ethernet] ? (193.34.20.8) at 02:ef:5d:1e:0d:0b on bge1 expires in 594 seconds [ethernet]
I am pretty sure that https://cgit.freebsd.org/src/commit/sys/net/if_epair.c?h=stable/14&id=503bf058cd0adfe3d5e66340b13d32b4516390cb results in the problem you are experiencing. If you disable txcsum on the epair interface, the problem goes away. I just want to understand the root cause of the problem. If I understand your data correctly, then the problem goes away if you set forced_udpcsum to 1. I think the problem should be limited to UDP, because bge devices announce TXCSUM support, but only do this for TCP, whereas the implicit assumption by the rest of the system is that TCP and UDP is supported. Setting forced_udpcsum to 1 enforces support for UDP. The default is forced_udpcsum = 0, since Broadcom NICs don't compute the UDP always correctly (I am not sure if this is currently fixed). We try to reproduce it in my lab, but we need to test it on a system with a Broadcom NIC. Once it is clear, we will work on a solution. As a workaround you can just disable txcsum for the epair interface.
Problem with UDP goes away, when I set `dev.bge.1.forced_udpcsum=1` or `ifconfig epair1a -txcsum` But problem with ICMP, when a machine from jail doesn't see, the interface on the host machine remains.
(In reply to Dmitry Lukhtionov from comment #11) Timo was able to reproduce the problem. The checksum problem is specific to bge devices and the root cause is understood. We are still contemplating how to deal with it. Most likely, we will disable txcsum per default for epair. A longer term fix will improve the bridge device to handle checksum offloading. I think that the ICMP problem is not related to this. When Timo configured the IP address not on the bge member of the bridge, but on the bridge itself, it worked. Can you double check?
(In reply to Michael Tuexen from comment #12) by the way, what is the concept of checksum offloading for pure virtual epair interface to hardware device bde, which has no direct relation with epair interface? bde is used just as "checksum co-processor"?
(In reply to vova from comment #13) Yes, the idea is that the computation is delayed until the packet is sent on a physical NIC and then make use of the NIC capabilities, if possible.
(In reply to Michael Tuexen from comment #14) so, if tcpdump on traffic after passing epair and before packets out via physical interface there will be no correct checksums?
(In reply to vova from comment #15) Correct. Even if you capture outgoing traffic on the bge interface. This is always the case: If you capture an outgoing packet with delayed checksum, the checksum will not contain the correct checksum, but only the header checksum.
(In reply to Michael Tuexen from comment #16) aha, what if system has multiple exit interfaces and some of them have no offloading? what if system has virtual exit interfaces (like tunnels)? all these cases are up to adminstrator or kernel should always calculate checksum on exit via non-local interfaces if it was delayed?
(In reply to vova from comment #17) > what if system has multiple exit interfaces and some of them have no offloading? There's no problem here. If the interface doesn't support offloading, you need to calculate checksums. Just like in Linux. Check the flags in mbuf and if_hwassist; if anything doesn't match, calculate it software-based.
(In reply to vova from comment #17) The kernel will take care. The problem here is that bge interfaces announce TXCSUM support, but only do this for TCP. All other interfaces I know of, support no checksum offloading at all, TCP and UDP, or SCTP, TCP and UDP. Only TCP is what breaks here UDP traffic. Setting forced_udpcsum to 1, adds support for UDP checksum offloading. Unfortunately, the hardware implementation does not handle the case where the computation gives 0 correctly. That is why the default is off. Disabling TXCSUM also avoids being hit by the problem, since then no checksum offloading at all is done. The long term solution will most likely be to add the capability to the bridge interface to compute the checksum in software when needed. The short term solution might be just to disable TXCSUM per default for epair...
(In reply to Michael Tuexen from comment #12) On host machine ``` root@DL360_Gen9_m19:/home/mitya # sysctl net.link.bridge.member_ifaddrs net.link.bridge.member_ifaddrs: 1 root@DL360_Gen9_m19:/home/mitya # ifconfig bge1 | grep inet inet 193.34.20.5 netmask 0xfffffff0 broadcast 193.34.20.15 root@DL360_Gen9_m19:/home/mitya # ifconfig bge1 delete 193.34.20.5 root@DL360_Gen9_m19:/home/mitya # ifconfig bridge1 inet 193.34.20.5/24 ``` Iside jail ``` root@mail:/ # ping 193.34.20.5 PING 193.34.20.5 (193.34.20.5): 56 data bytes ^C --- 193.34.20.5 ping statistics --- 2 packets transmitted, 0 packets received, 100.0% packet loss root@mail:/ # ping 193.34.20.5 PING 193.34.20.5 (193.34.20.5): 56 data bytes 64 bytes from 193.34.20.5: icmp_seq=0 ttl=64 time=0.199 ms 64 bytes from 193.34.20.5: icmp_seq=1 ttl=64 time=0.154 ms ^C --- 193.34.20.5 ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.154/0.176/0.199/0.022 ms ```
Can you imagine the problem when the address from inside jail+epair is not accessible when accessed from the host machine from the address on the physical interface, and vice versa?
I encountered the same problem with a slightly different setup that does not involve bge, and then reproduced it on 15.0-RELEASE in a VM with only vtnet, epair, bridge, tap devices involved. A bridge with two vnet jails attached to it. One jail running unbound. The second jail running bhyve and an Ubuntu VM with the vm jail's networking setup being another bridge of the vnet epair and the tap. The host handles routing for the bridge network for outside connectivity. The VM cannot use the unbound server running in the dns jail for DNS, the UDP packets have just a partial checksum (according to Wireshark, and it just not working). The VM can use external DNS servers just fine. If one disables txcsum on the dns jails epair interface it starts working. At least ICMP between the VM and the DNS jail works fine regardless of the txcsum setting. As does DNS from the jail running bhyve. (Out of curiosity I tried if adding the patches for txcsum support for tap devices ( review D51289, review D51291, review D51688) would make a difference (but still on 14-stable) and that also did not change anything.) If it is useful I could provide this test VM image. Host network ``` bridge0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=10<VLAN_HWTAGGING> ether 58:9c:fc:10:95:97 inet 172.16.0.1 netmask 0xfff00000 broadcast 172.31.255.255 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<> member: e0a_vmjail flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> port 7 priority 128 path cost 2000 vlan protocol 802.1q member: e0a_dns flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> port 4 priority 128 path cost 2000 vlan protocol 802.1q groups: bridge nd6 options=3<PERFORMNUD,ACCEPT_RTADV> e0a_dns: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 description: vnet0 host interface for Bastille jail dns options=60000b<RXCSUM,TXCSUM,VLAN_MTU,RXCSUM_IPV6,TXCSUM_IPV6> ether 58:9c:fc:7f:2f:6a hwaddr 58:9c:fc:10:c5:5f groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> e0a_vmjail: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 description: vnet0 host interface for Bastille jail vmjail options=20000b<RXCSUM,TXCSUM,VLAN_MTU,RXCSUM_IPV6> ether 58:9c:fc:6c:b0:ca hwaddr 58:9c:fc:10:67:eb groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> ``` vmjail network: ``` vnet0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 description: jail interface for bridge0 options=20000b<RXCSUM,TXCSUM,VLAN_MTU,RXCSUM_IPV6> ether 58:9c:fc:6c:b0:cb hwaddr 58:9c:fc:10:13:af groups: epair media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> bridge1: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=10<VLAN_HWTAGGING> ether 9a:e7:95:53:f9:56 inet 172.16.0.2 netmask 0xffffff00 broadcast 172.16.0.255 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<> member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> port 11 priority 128 path cost 2000000 vlan protocol 802.1q member: vnet0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> port 8 priority 128 path cost 2000 vlan protocol 802.1q groups: bridge vm-switch viid-4c918@ nd6 options=9<PERFORMNUD,IFDISABLED> tap0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 description: vmnet/linvm/0/public options=80000<LINKSTATE> ether 0e:79:d9:96:d3:03 groups: tap vm-port media: Ethernet 1000baseT <full-duplex> status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> Opened by PID 10785 ```
I would expect that in your vmjail network the bridge0 would disable TXCSUM on vnet0, because tap0 has it disabled. Did you manually change that?
In the test with the few applied patches for txcsum support for tap/bhyve on 14-stable I manually changed that, yes. In the 15.0-RELEASE variant (which the network configuration is from) I also manually changed that, but given it lacks the txcsum patches there was no change. I'll try to test on this configuration with those txcsum patches too. If the jail's bridge turns of txsum then somehow that does not seem to propagate via the epair to the host's bridge however.
(In reply to leper from comment #24) Things are a little fragile if you manually configure things. The bridge interface tries to enforce a consistent state whenever an interface is added. My current understanding is that this should result in TXCSUM being disabled. I'll talk to Timo on Monday to see if we can reproduce this locally.
(In reply to Michael Tuexen from comment #25) I did configure TXCSUM on the tap device before adding it to the jail's bridge. But I guess the reconfiguration of the bridge interface happening only when an interface is added/removed might explain why the host bridge does not seem to adjust to a possible lack of TXCSUM properly.
(In reply to leper from comment #22) Thanks for sharing your setup. If I got it right, it looks like this: DNS-Jail Host VM-Jail Ubuntu-VM e0b_dns---e0a_dns e0a_vmjail---e0b_vmjail tap0---vtnet0 \ / \ / bridge0 bridge1 That's a good example where bridge capability synchronization fails. In an unpatched FreeBSD tap0 has no txcsum and it cannot be enabled. When adding tap0 to bridge1, the bridge disables txcsum on all other member interfaces (and will disable txcsum on interfaces newly added to that bridge). Thus, it disables txcsum on e0b_vmjail, which, due to the capability sync between epair interfaces, will disable txcsum on e0a_vmjail. The core problem here is that the bridge does not notice changes made after adding an interface. In this example, disabling txcsum on e0a_vmail does not result in disabling txcsum on e0a_dns, which would disable txcsum on e0b_dns. With txcsum enabled on e0b_dns, the DNS-Server uses checksum offloading for outgoing packets and writes only the header checksum in the checksum field. For a packet to the Ubuntu-VM, bridge1 forwards the packet that still needs a valid checksum out over tap0 which has txcsum disabled. I guess we need to add txcsum to the bridge, which then computes the checksum in software if the outgoing interface does not support txcsum.
(In reply to Timo Voelker from comment #27) Yes, that's how the setup looks. Thank you for the detailed explanation, I'm now wondering why my attempt on 14-stable (which was not reduced like that yet) failed.
A patch is under review D54486. Is it possible to test it? This should get a bridge setup working as long as no manual twiddling of checksum capabilities are performed.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=bbd30927b1af44226c8de0512912a7fedfce2824 commit bbd30927b1af44226c8de0512912a7fedfce2824 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2026-01-16 12:32:13 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2026-01-16 12:36:53 +0000 bge: disable TXCSUM if UDP transmit checksum offloading is disabled The bge interface is special with respect to transmit checksumi offloading. In the default settings, an bge interface announces TXCSUM capabilities, but only supports TCP/IPv4 and not UDP/IPv4 due to limitations of some of the NICs. This results in problems when the bge interface becomes a member of a bridge. Since currently only the TXCSUM capabilities are synced when a member is added to a bridge and not the protocol specific capabilities, this can result in a situation where UDP packets are sent out using a bge interface without having a correct checksum. To mitigate this problem, initially don't announce TXCSUM capabilities, when UDP transmit checksum is disabled. It is still possible to enable TXCSUM capabilities via ifconfig. PR: 291420 Reviewed by: Timo Voelker MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54486 share/man/man4/bge.4 | 10 +++++++++- sys/dev/bge/if_bge.c | 14 +++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=39a25aa8a736a827f7a99e682fdb1579af4e8df5 commit 39a25aa8a736a827f7a99e682fdb1579af4e8df5 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2026-01-16 12:32:13 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2026-01-21 14:11:56 +0000 bge: disable TXCSUM if UDP transmit checksum offloading is disabled The bge interface is special with respect to transmit checksumi offloading. In the default settings, an bge interface announces TXCSUM capabilities, but only supports TCP/IPv4 and not UDP/IPv4 due to limitations of some of the NICs. This results in problems when the bge interface becomes a member of a bridge. Since currently only the TXCSUM capabilities are synced when a member is added to a bridge and not the protocol specific capabilities, this can result in a situation where UDP packets are sent out using a bge interface without having a correct checksum. To mitigate this problem, initially don't announce TXCSUM capabilities, when UDP transmit checksum is disabled. It is still possible to enable TXCSUM capabilities via ifconfig. PR: 291420 Reviewed by: Timo Voelker Differential Revision: https://reviews.freebsd.org/D54486 (cherry picked from commit bbd30927b1af44226c8de0512912a7fedfce2824) share/man/man4/bge.4 | 10 +++++++++- sys/dev/bge/if_bge.c | 14 +++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a148f7e54c4ac521d650a256126a0d33af4c2023 commit a148f7e54c4ac521d650a256126a0d33af4c2023 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2026-01-16 12:32:13 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2026-01-21 19:51:34 +0000 bge: disable TXCSUM if UDP transmit checksum offloading is disabled The bge interface is special with respect to transmit checksumi offloading. In the default settings, an bge interface announces TXCSUM capabilities, but only supports TCP/IPv4 and not UDP/IPv4 due to limitations of some of the NICs. This results in problems when the bge interface becomes a member of a bridge. Since currently only the TXCSUM capabilities are synced when a member is added to a bridge and not the protocol specific capabilities, this can result in a situation where UDP packets are sent out using a bge interface without having a correct checksum. To mitigate this problem, initially don't announce TXCSUM capabilities, when UDP transmit checksum is disabled. It is still possible to enable TXCSUM capabilities via ifconfig. PR: 291420 Reviewed by: Timo Voelker Differential Revision: https://reviews.freebsd.org/D54486 (cherry picked from commit bbd30927b1af44226c8de0512912a7fedfce2824) share/man/man4/bge.4 | 10 +++++++++- sys/dev/bge/if_bge.c | 14 +++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-)