On 2025/02/28 23:29, Jakub Kicinski wrote:
On Fri, 28 Feb 2025 16:58:51 +0900 Akihiko Odaki wrote:
The added tests confirm tun can perform RSS and hash reporting, and
reject invalid configurations for them.
The tests may benefit from using FIXTURE_VARIANT(), up to you.
I took a look at it after seeing your suggestion, but it is
unfortunately not straightfoward to use FIXTURE_VARIANT() for them
so I'll leave it as is. The problem is that a packet for each test has a
different type and requires different functions to construct.
Tests added in "[PATCH net-next v7 4/6] selftest: tun: Test vnet ioctls
without device" are easier to adopt FIXTURE_VARIANT(), but one
exceptional test case, which is for TUNGETVNETHASHCAP, does not fit well
so I also keep the current form.
Thank you for your suggestion anyway.
The IPv4 tests fail reliably on a VM with a debug kernel
(kernel/configs/debug.config included in the config):
# 5.90 [+0.00] ok 14 tun_vnet_hash.unclassified
# 5.90 [+0.00] # RUN tun_vnet_hash.ipv4 ...
# 6.18 [+0.28] # tun.c:669:ipv4:Expected 0 (0) != tun_vnet_hash_check(self->source_fd, self->dest_fds, &packet, sizeof(packet), 0, VIRTIO_NET_HASH_REPORT_IPv4, 0x6e45d952) (0)
# 15.09 [+8.92] # ipv4: Test failed
# 15.10 [+0.00] # FAIL tun_vnet_hash.ipv4
# 15.10 [+0.00] not ok 15 tun_vnet_hash.ipv4
# 15.10 [+0.00] # RUN tun_vnet_hash.tcpv4 ...
# 15.36 [+0.26] # tun.c:689:tcpv4:Expected 0 (0) != tun_vnet_hash_check(self->source_fd, self->dest_fds, &packet, sizeof(packet), VIRTIO_NET_HDR_F_DATA_VALID, VIRTIO_NET_HASH_REPORT_TCPv4, 0xfb63539a) (0)
# 24.76 [+9.40] # tcpv4: Test failed
# 24.76 [+0.00] # FAIL tun_vnet_hash.tcpv4
# 24.76 [+0.00] not ok 16 tun_vnet_hash.tcpv4
# 24.77 [+0.00] # RUN tun_vnet_hash.udpv4 ...
# 25.05 [+0.28] # tun.c:710:udpv4:Expected 0 (0) != tun_vnet_hash_check(self->source_fd, self->dest_fds, &packet, sizeof(packet), VIRTIO_NET_HDR_F_DATA_VALID, VIRTIO_NET_HASH_REPORT_UDPv4, 0xfb63539a) (0)
# 32.11 [+7.06] # udpv4: Test failed
# 32.11 [+0.00] # FAIL tun_vnet_hash.udpv4
# 32.11 [+0.00] not ok 17 tun_vnet_hash.udpv4
I cannot reproduce the failure. What commit did you apply this patch
series on? What architecture did the kernel run on?