History log of /linux-master/tools/testing/selftests/net/udpgso_bench_tx.c
Revision Date Author Comments
# 329c9cd7 31-Jan-2023 Andrei Gherzan <andrei.gherzan@canonical.com>

selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy benchmarking

The test tool can check that the zerocopy number of completions value is
valid taking into consideration the number of datagram send calls. This can
catch the system into a state where the datagrams are still in the system
(for example in a qdisk, waiting for the network interface to return a
completion notification, etc).

This change adds a retry logic of computing the number of completions up to
a configurable (via CLI) timeout (default: 2 seconds).

Fixes: 79ebc3c26010 ("net/udpgso_bench_tx: options to exercise TX CMSG")
Signed-off-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20230201001612.515730-4-andrei.gherzan@canonical.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>


# db9b47ee 31-Jan-2023 Andrei Gherzan <andrei.gherzan@canonical.com>

selftests: net: udpgso_bench_rx/tx: Stop when wrong CLI args are provided

Leaving unrecognized arguments buried in the output, can easily hide a
CLI/script typo. Avoid this by exiting when wrong arguments are provided to
the udpgso_bench test programs.

Fixes: 3a687bef148d ("selftests: udp gso benchmark")
Signed-off-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Cc: Willem de Bruijn <willemb@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20230201001612.515730-2-andrei.gherzan@canonical.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>


# 9c1952ae 29-Dec-2021 wujianguo <wujianguo@chinatelecom.cn>

selftests/net: udpgso_bench_tx: fix dst ip argument

udpgso_bench_tx call setup_sockaddr() for dest address before
parsing all arguments, if we specify "-p ${dst_port}" after "-D ${dst_ip}",
then ${dst_port} will be ignored, and using default cfg_port 8000.

This will cause test case "multiple GRO socks" failed in udpgro.sh.

Setup sockaddr after parsing all arguments.

Fixes: 3a687bef148d ("selftests: udp gso benchmark")
Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/ff620d9f-5b52-06ab-5286-44b945453002@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>


# 670cd684 22-Oct-2019 Masami Hiramatsu <mhiramat@kernel.org>

selftests: net: Fix printf format warnings on arm

Fix printf format warnings on arm (and other 32bit arch).

- udpgso.c and udpgso_bench_tx use %lu for size_t but it
should be unsigned long long on 32bit arch.

- so_txtime.c uses %ld for int64_t, but it should be
unsigned long long on 32bit arch.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Willem de Bruijn <willemb@google.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>


# 22f1a38a 18-Jun-2019 Willem de Bruijn <willemb@google.com>

selftests/net: make udpgso_bench skip unsupported testcases

Kselftest can be run against older kernels. Instead of failing hard
when a feature is unsupported, return the KSFT_SKIP exit code.

Specifically, do not fail hard on missing udp zerocopy.

The udp gso bench test runs multiple test cases from a single script.
Fail if any case fails, else return skip if any test is skipped.

Link: https://lore.kernel.org/lkml/20190618171516.GA17547@kroah.com/
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 79ebc3c2 17-Jun-2019 Fred Klassen <fklassen@appneta.com>

net/udpgso_bench_tx: options to exercise TX CMSG

This enhancement adds options that facilitate load testing with
additional TX CMSG options, and to optionally print results of
various send CMSG operations.

These options are especially useful in isolating situations
where error-queue messages are lost when combined with other
CMSG operations (e.g. SO_ZEROCOPY).

New options:
-a - count all CMSG messages and match to sent messages
-T - add TX CMSG that requests TX software timestamps
-H - similar to -T except request TX hardware timestamps
-P - call poll() before reading error queue
-v - print detailed results

v2: Enhancements as per Willem de Bruijn <willemb@google.com>
- Updated control and buffer parameters for recvmsg
- poll() parameter cleanup
- fail on bad audit results
- remove TOS options
- improved reporting

v3: Enhancements as per Willem de Bruijn <willemb@google.com>
- add SOF_TIMESTAMPING_OPT_TSONLY to eliminate MSG_TRUNC
- general code cleanup

Signed-off-by: Fred Klassen <fklassen@appneta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 3327a9c4 06-Nov-2018 Paolo Abeni <pabeni@redhat.com>

selftests: add functionals test for UDP GRO

Extends the existing udp programs to allow checking for proper
GRO aggregation/GSO size, and run the tests via a shell script, using
a veth pair with XDP program attached to trigger the GRO code path.

rfc v3 -> v1:
- use ip route to attach the xdp helper to the veth

rfc v2 -> rfc v3:
- add missing test program options documentation
- fix sporatic test failures (receiver faster than sender)

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 3a687bef 26-Apr-2018 Willem de Bruijn <willemb@google.com>

selftests: udp gso benchmark

Send udp data between a source and sink, optionally with udp gso.
The two processes are expected to be run on separate hosts.

A script is included that runs them together over loopback in a
single namespace for functionality testing.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>