From: Jakub Kicinski <kuba@kernel.org>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, linux-kselftest@vger.kernel.org,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net-next] selftests: drv-net: add checksum tests
Date: Wed, 1 May 2024 18:06:57 -0700 [thread overview]
Message-ID: <20240501180657.3eb1ef99@kernel.org> (raw)
In-Reply-To: <20240501185432.3593168-1-willemdebruijn.kernel@gmail.com>
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
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.
> - 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?
next prev parent reply other threads:[~2024-05-02 1:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-01 18:51 [PATCH net-next] selftests: drv-net: add checksum tests Willem de Bruijn
2024-05-02 1:06 ` Jakub Kicinski [this message]
2024-05-02 1:38 ` Willem de Bruijn
2024-05-02 1:49 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240501180657.3eb1ef99@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).