lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6632ee9092206_37f3af294a7@willemb.c.googlers.com.notmuch>
Date: Wed, 01 May 2024 21:38:24 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Jakub Kicinski <kuba@...nel.org>, 
 Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: netdev@...r.kernel.org, 
 davem@...emloft.net, 
 edumazet@...gle.com, 
 pabeni@...hat.com, 
 linux-kselftest@...r.kernel.org, 
 Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net-next] selftests: drv-net: add checksum tests

Jakub Kicinski wrote:
> Great! I run it on a couple of older machines. 
> 
> mlx5:
> 
> TAP version 13
> 1..1
> # timeout set to 0
> # selftests: drivers/net/hw: csum.py
> # KTAP version 1
> # 1..12
> # ok 1 csum.ipv4_rx_tcp # SKIP Test requires IPv4 connectivity
> # ok 2 csum.ipv4_rx_tcp_invalid # SKIP Test requires IPv4 connectivity
> # ok 3 csum.ipv4_rx_udp # SKIP Test requires IPv4 connectivity
> # ok 4 csum.ipv4_rx_udp_invalid # SKIP Test requires IPv4 connectivity
> # ok 5 csum.ipv4_tx_udp_csum_offload # SKIP Test requires IPv4 connectivity
> # ok 6 csum.ipv4_tx_udp_zero_checksum # SKIP Test requires IPv4 connectivity
> # ok 7 csum.ipv6_rx_tcp
> # ok 8 csum.ipv6_rx_tcp_invalid
> # ok 9 csum.ipv6_rx_udp
> # ok 10 csum.ipv6_rx_udp_invalid
> # ok 11 csum.ipv6_tx_udp_csum_offload
> # ok 12 csum.ipv6_tx_udp_zero_checksum
> # # Totals: pass:6 fail:0 xfail:0 xpass:0 skip:6 error:0
> ok 1 selftests: drivers/net/hw: csum.py
> 
> bnxt:
> 
> TAP version 13
> 1..1
> # timeout set to 0
> # selftests: drivers/net/hw: csum.py
> # KTAP version 1
> # 1..12
> # ok 1 csum.ipv4_rx_tcp # SKIP Test requires IPv4 connectivity
> # ok 2 csum.ipv4_rx_tcp_invalid # SKIP Test requires IPv4 connectivity
> # ok 3 csum.ipv4_rx_udp # SKIP Test requires IPv4 connectivity
> # ok 4 csum.ipv4_rx_udp_invalid # SKIP Test requires IPv4 connectivity
> # ok 5 csum.ipv4_tx_udp_csum_offload # SKIP Test requires IPv4 connectivity
> # ok 6 csum.ipv4_tx_udp_zero_checksum # SKIP Test requires IPv4 connectivity
> # ok 7 csum.ipv6_rx_tcp
> # ok 8 csum.ipv6_rx_tcp_invalid
> # ok 9 csum.ipv6_rx_udp
> # ok 10 csum.ipv6_rx_udp_invalid
> # ok 11 csum.ipv6_tx_udp_csum_offload # SKIP Test requires tx checksum offload on eth0
> # ok 12 csum.ipv6_tx_udp_zero_checksum # SKIP Test requires tx checksum offload on eth0
> # # Totals: pass:4 fail:0 xfail:0 xpass:0 skip:8 error:0
> ok 1 selftests: drivers/net/hw: csum.py

Nice, thanks for testing!

> On Wed,  1 May 2024 14:51:34 -0400 Willem de Bruijn wrote:
> > Run tools/testing/selftest/net/csum.c as part of drv-net.
> > This binary covers multiple scenarios, based on arguments given,
> > for both IPv4 and IPv6:
> 
> The use of csum.c is the only real concern I have. Could you move it to
> net/lib? I made net/lib into an automatically included target in commit
> b86761ff6374 ("selftests: net: add scaffolding for Netlink tests in Python").
> 
> It has a makefile like any selftest directory, so you should be able to
> do a simple move and minor path adjustments.
> 
> Without this if someone builds and deploys just the drivers/net{,/hw}
> targets the csum binary won't be there :( We could auto-include all of
> net but using the lib target felt a little cleaner.

Can do.

A few more may be in scope eventually: toeplitz, udpgso_bench, gro,
so_txtime. Move them on a case-by-case basis?
 
> > - Accept UDP correct checksum
> > - Detect UDP invalid checksum
> > - Accept TCP correct checksum
> > - Detect TCP invalid checksum
> > 
> > - Transmit UDP: basic checksum offload
> > - Transmit UDP: zero checksum conversion
> > 
> > The test direction is reversed between receive and transmit tests, so
> > that the NIC under test is always the local machine.
> > 
> > In total this adds up to 12 testcases, with more to follow. For
> > conciseness, I replaced individual functions with a function factory.
> > It saves a lot of boilerplate, but is a little harder to follow, so
> > partially here as a point for discussion.
> 
> LGTM, FWIW, but let's hear if anyone feels it's too magical.
> 
> > Warning that for now transmit errors are not detected, as for those
> > the receiver runs remotely and failures with bkg are ignored.
> 
> Should I send a fix for that?

Please do. I did not grasp your suggestion well enough to take a
stab. I may have already spotted the zero conversion test returning
success, while explicit logging of the stderr output shows otherwise.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ