Describe the bug
The checksum offloading capabilities of an Ethernet interface are not respected for virtual network interfaces as the function need_calc_checksum() in "net_if.c" always returns true for the virtual interfaces. This increases CPU utilization as checksums are calculated in software even though they would be automatically calculated by the Ethernet MAC. Even worse, some Ethernet MACs require the checksum to be cleared to zero for TX checksum offloading as otherwise an incorrect checksum will be generated by the Ethernet MAC (for example NXP MIMXRT1060-EVK).
disable IPv6 as IPv6 will disable TX/RX checksum offloading on i.MX RT1060 (CONFIG_NET_IPV6=n)
west build --pristine -b mimxrt1060_evk samples/net/vlan
west flash
From PC, ping 192.0.2.1 (untagged, working)
From PC, ping 198.51.100.1 (VLAN 100, request timed out)
Incorrect checksum (0xffff) for IP header and ICMP message will be shown in Wireshark for the Echo reply
Expected behavior
TX/RX checksum offloading should also work on virtual network interfaces used for Virtual LAN (VLAN).
Impact
TX/RX checksum offloading can be disabled for i.MX RT1060 by setting CONFIG_ETH_NXP_ENET_HW_ACCELERATION=n. Therefore, impact is mainly the increased CPU utilization.
Describe the bug The checksum offloading capabilities of an Ethernet interface are not respected for virtual network interfaces as the function
need_calc_checksum()
in "net_if.c" always returns true for the virtual interfaces. This increases CPU utilization as checksums are calculated in software even though they would be automatically calculated by the Ethernet MAC. Even worse, some Ethernet MACs require the checksum to be cleared to zero for TX checksum offloading as otherwise an incorrect checksum will be generated by the Ethernet MAC (for example NXP MIMXRT1060-EVK).To Reproduce Use the Virtual LAN sample
CONFIG_NET_IPV6=n
)Expected behavior TX/RX checksum offloading should also work on virtual network interfaces used for Virtual LAN (VLAN).
Impact TX/RX checksum offloading can be disabled for i.MX RT1060 by setting
CONFIG_ETH_NXP_ENET_HW_ACCELERATION=n
. Therefore, impact is mainly the increased CPU utilization.Environment: