Re: [PATCH net-next v11 05/13] page_pool: convert to use netmem

2024-06-12 Thread Jakub Kicinski
On Fri, 7 Jun 2024 00:51:15 + Mina Almasry wrote: > Abstrace the memory type from the page_pool so we can later add support > for new memory types. Convert the page_pool to use the new netmem type > abstraction, rather than use struct page directly. > > As of this patch the netmem type is a

Re: [PATCH net-next v7 1/2] tls: receive msg again for sk_redirect

2024-06-12 Thread Jakub Kicinski
On Wed, 12 Jun 2024 17:19:03 +0800 Geliang Tang wrote: > tls_sw doesn't work for sk_redirect in nonblock mode, sk_msg_recvmsg() > returns 0 in that case in tls_sw_recvmsg(). This patch fixes this by using > "continue" to receive msg again instead of ending it if strp isn't ready > and rx_list is

Re: [PATCH net-next v6 1/2] tls: wait for receiving next skb for sk_redirect

2024-06-11 Thread Jakub Kicinski
On Tue, 11 Jun 2024 17:13:34 +0800 Geliang Tang wrote: > tls_sw_recvmsg() doesn't work in nonblock mode, it returns -EAGAIN in > that case. This patch fixes it, always wait for receiving the next skb > for sk_redirect. Is this commit message basically saying "block in nonblock mode" or am I

Re: [PATCH net-next] selftests: hsr: Extend the hsr_redbox.sh test to use fixed MAC addresses

2024-06-05 Thread Jakub Kicinski
On Mon, 3 Jun 2024 11:33:22 +0200 Lukasz Majewski wrote: > Fixed MAC addresses help with debugging as last four bytes identify the > network namespace. > > Moreover, it allows to mimic the real life setup with for example bridge > having the same MAC address on each port. Doesn't seem like a

Re: [PATCH net-next 1/2] selftests: openvswitch: fix action formatting

2024-06-03 Thread Jakub Kicinski
On Mon, 03 Jun 2024 15:00:03 -0400 Aaron Conole wrote: > I agree, this is an issue. BUT I think it might be better to just > filter by field type up front. See: > >

Re: [PATCH v5 00/68] Define _GNU_SOURCE for sources using

2024-05-22 Thread Jakub Kicinski
On Wed, 22 May 2024 10:19:33 -0600 Shuah Khan wrote: > On 5/21/24 18:56, Edward Liaw wrote: > > Centralizes the definition of _GNU_SOURCE into KHDR_INCLUDES and removes > > redefinitions of _GNU_SOURCE from source code. > > > > 809216233555 ("selftests/harness: remove use of LINE_MAX") introduced

Re: [PATCHv2 net] selftests/net: use tc rule to filter the na packet

2024-05-17 Thread Jakub Kicinski
On Fri, 17 May 2024 10:14:02 +0100 Simon Horman wrote: > Jakub, is there a way to tell how long a test took to execute? > Perhaps it's obvious, but I couldn't see it. It's not obvious, and it was broken. There's an 'info' file with extra metadata in the directory with results:

Re: [PATCH net] selftests/net: use tc rule to filter the na packet

2024-05-16 Thread Jakub Kicinski
On Tue, 14 May 2024 15:11:30 +0800 Hangbin Liu wrote: > Hi Jakub, would you please help check if this fix the > arp_ndisc_untracked_subnets flake issue on debug kernel? It didn't get ingested by the CI because there's a conflict with something else that got merged into lib.sh. Could you rebase /

[PATCH net v3] selftests: net: local_termination: annotate the expected failures

2024-05-16 Thread Jakub Kicinski
test which always fails prevents us from catching regressions. Report the cases we know may fail as XFAIL. Signed-off-by: Jakub Kicinski --- CC: liuhang...@gmail.com CC: sh...@kernel.org CC: linux-kselftest@vger.kernel.org CC: Petr Machata CC: vladimir.olt...@nxp.com v3: - use xfail_on_veth

Re: [PATCH net-next] selftests: net: local_termination: annotate the expected failures

2024-05-15 Thread Jakub Kicinski
on, cause these construct will not filter either. If I'm not making sense - I'm probably confused, I can code up what you suggested, it will work, just more LoC :) --->8-- From 7a645eb425530f647e88590ba7ba01681e73812e Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Thu, 9 May 2024 16:28:4

Re: [PATCH net-next] selftests: net: local_termination: annotate the expected failures

2024-05-14 Thread Jakub Kicinski
On Mon, 13 May 2024 15:25:38 +0200 Petr Machata wrote: > For veth specifically there is xfail_on_veth: > > xfail_on_veth $rcv_if_name \ > check_rcv $rcv_if_name "Unicast IPv4 to unknown MAC address" \ > "$smac > $UNKNOWN_UC_ADDR1, ethertype IPv4 (0x0800)" \ >

Re: [PATCH net-next v10 2/3] net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment

2024-05-14 Thread Jakub Kicinski
On Tue, 14 May 2024 17:56:44 +0200 Richard Gobert wrote: > > Hi Richard, any chance of getting this fixed within the next 2 hours? > > I can't send the net-next PR if it doesn't build on one of the arches.. > > Hi Jakub and Geert, > I'm only seeing this mail now, sorry for the late response. >

Re: [PATCH net-next v10 2/3] net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment

2024-05-14 Thread Jakub Kicinski
On Tue, 14 May 2024 14:13:21 +0200 Geert Uytterhoeven wrote: > On Thu, May 9, 2024 at 9:09 PM Richard Gobert > wrote: > > {inet,ipv6}_gro_receive functions perform flush checks (ttl, flags, > > iph->id, ...) against all packets in a loop. These flush checks are used in > > all merging UDP and

Re: [PATCH net-next v9 00/14] Device Memory TCP

2024-05-13 Thread Jakub Kicinski
On Fri, 10 May 2024 16:21:11 -0700 Mina Almasry wrote: > Device Memory TCP Sorry Mina, this is too big to apply during the merge window :( -- pw-bot: defer

[PATCH net-next v2] selftests: net: local_termination: annotate the expected failures

2024-05-10 Thread Jakub Kicinski
test which always fails prevents us from catching regressions. Report the cases we know may fail as XFAIL. Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: Jakub Kicinski --- CC: liuhang...@gmail.com CC: sh...@kernel.org CC: linux-kselftest@vger.kernel.org v2: - remove

Re: [PATCH net-next 1/2] selftests: net: fix timestamp not arriving in cmsg_time.sh

2024-05-10 Thread Jakub Kicinski
On Thu, 09 May 2024 22:49:50 -0400 Willem de Bruijn wrote: > > struct sock_extended_err *see; > > struct scm_timestamping *ts; > > + unsigned int ts_seen = 0; > > nit: mixing unsigned long and unsigned int Fixed when applying, thanks!

Re: [PATCH net-next] selftests: net: use upstream mtools

2024-05-10 Thread Jakub Kicinski
On Fri, 10 May 2024 14:28:56 +0300 Vladimir Oltean wrote: > Check that the deployed mtools version is 3.0 or above. Note that the > version check breaks compatibility with my fork And Joachim's tree from before the tag, the PR was merged a while back ;) > where I didn't bump the version, but I

Re: [PATCH net-next] selftests: net: local_termination: annotate the expected failures

2024-05-09 Thread Jakub Kicinski
On Fri, 10 May 2024 11:15:58 +0800 Hangbin Liu wrote: > I may missed something, I saw there is already a log_test_xfail() in lib.sh > > log_test_skip() > { > RET=$ksft_skip retmsg= log_test "$@" > } > > log_test_xfail() > { > RET=$ksft_xfail retmsg= log_test "$@" > } > >

[PATCH net-next 2/2] selftests: net: increase the delay for relative cmsg_time.sh test

2024-05-09 Thread Jakub Kicinski
l returned '', expected 'OK' Signed-off-by: Jakub Kicinski --- CC: sh...@kernel.org CC: linux-kselftest@vger.kernel.org --- tools/testing/selftests/net/cmsg_sender.c | 32 +-- tools/testing/selftests/net/cmsg_time.sh | 7 +++-- 2 files changed, 23 insertions(+), 16 deletion

[PATCH net-next 1/2] selftests: net: fix timestamp not arriving in cmsg_time.sh

2024-05-09 Thread Jakub Kicinski
the "TXTIME abs" failures on debug kernels, like: Case ICMPv4 - TXTIME abs returned '', expected 'OK' Signed-off-by: Jakub Kicinski --- CC: sh...@kernel.org CC: linux-kselftest@vger.kernel.org --- tools/testing/selftests/net/cmsg_sender.c | 20 +++- 1 file changed, 15

[PATCH net-next] selftests: net: local_termination: annotate the expected failures

2024-05-09 Thread Jakub Kicinski
test which always fails prevents us from catching regressions. Report the cases we know may fail as XFAIL. Signed-off-by: Jakub Kicinski --- CC: vladimir.olt...@nxp.com CC: sh...@kernel.org CC: pe...@nvidia.com CC: liuhang...@gmail.com CC: bpoir...@nvidia.com CC: linux-kselftest@vger.kernel.org

Re: [PATCH net] selftests: net: move amt to socat for better compatibility

2024-05-09 Thread Jakub Kicinski
On Thu, 09 May 2024 19:39:36 +0200 Paolo Abeni wrote: > Acked-by: Paolo Abeni Thanks! > As a minor note, shell variable expansion should already trim all the > trailing/leading spaces from the socat command output, so it should not > be necessary replace the string comparison with the grep

Re: [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h

2024-05-09 Thread Jakub Kicinski
On Thu, 9 May 2024 13:08:36 +0800 Tao Su wrote: > > SGTM, FWIW. The print is printing a test summary line, printing more > > than 1k seems rather unreasonable. Other facilities, like TH_LOG(), > > should be used for displaying longer info. > > Thanks, do you think 1k is enough for test_name?

Re: [PATCH net] selftests: net: avoid waiting for server in amt.sh forever when it fails.

2024-05-09 Thread Jakub Kicinski
On Wed, 8 May 2024 04:06:43 + Taehee Yoo wrote: > In the forwarding testcase, it opens a server and a client with the nc. > The server receives the correct message from NC, it prints OK. > The server prints FAIL if it receives the wrong message from the client. > > But If the server can't

[PATCH net] selftests: net: move amt to socat for better compatibility

2024-05-09 Thread Jakub Kicinski
don't set exit code (|| true) and print the pass / fail rather then silently moving over the test and just setting non-zero exit code with no output indicating what failed. Fixes: c08e8baea78e ("selftests: add amt interface selftest script") Signed-off-by: Jakub Kicinski --- CC: sh...@ker

[PATCH net] selftests: net: add missing config for amt.sh

2024-05-09 Thread Jakub Kicinski
Test needs IPv6 multicast. smcroute currently crashes when trying to install a route in a kernel without IPv6 multicast. Fixes: c08e8baea78e ("selftests: add amt interface selftest script") Signed-off-by: Jakub Kicinski --- CC: sh...@kernel.org CC: ap420...@gmail.com CC: linux

Re: [PATCH net-next v3] selftest: epoll_busy_poll: epoll busy poll tests

2024-05-08 Thread Jakub Kicinski
On Tue, 7 May 2024 19:21:50 -0700 Joe Damato wrote: > On Wed, May 08, 2024 at 12:43:26AM +, Joe Damato wrote: > > Add a simple test for the epoll busy poll ioctls, using the kernel > > selftest harness. > > > > This test ensures that the ioctls have the expected return codes and > > that the

Re: [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h

2024-05-08 Thread Jakub Kicinski
On Wed, 8 May 2024 10:55:05 +0800 Tao Su wrote: > Back to commit 38c957f07038, I don't see any advantage in using LINE_MAX. > Can we use a fixed value instead of LINE_MAX? E.g., 1024, 2048. Then we > just need to revert commit 809216233555. SGTM, FWIW. The print is printing a test summary line,

Re: [PATCH net-next v9 0/3] net: gro: remove network_header use, move p->{flush/flush_id} calculations to L4

2024-05-07 Thread Jakub Kicinski
On Tue, 7 May 2024 18:23:45 +0200 Richard Gobert wrote: > The cb fields network_offset and inner_network_offset are used instead of > skb->network_header throughout GRO. > > These fields are then leveraged in the next commit to remove flush_id state > from napi_gro_cb, and stateful code in

Re: [PATCH net-next v2] selftest: epoll_busy_poll: epoll busy poll tests

2024-05-06 Thread Jakub Kicinski
On Mon, 6 May 2024 18:40:00 -0700 Joe Damato wrote: > Ah, sorry -- this is because I had assumed the test would run without > CAP_NET_ADMIN, but since: > > epoll_busy_poll.c:204:test_set_invalid:Expected -1 (-1) == ret (0) > > succeeds (ret = 0), clearly I am mistaken. Sorry about that. > > I

Re: [PATCH net-next v2] selftest: epoll_busy_poll: epoll busy poll tests

2024-05-06 Thread Jakub Kicinski
On Mon, 6 May 2024 20:53:22 + Joe Damato wrote: > Add a simple test for the epoll busy poll ioctls, using the kernel > selftest harness. > > This test ensures that the ioctls have the expected return codes and > that the kernel properly gets and sets epoll busy poll parameters. > > The test

Re: [PATCH net-next v3 2/2] selftests/net: add ICMP unreachable over IPsec tunnel

2024-05-06 Thread Jakub Kicinski
On Mon, 6 May 2024 17:37:54 +0200 Antony Antony wrote: > This appears to be an error from the v2 run, which was sent yesterday. > The v3 patch should have superseded it. > > The branch net-dev-testing/net-next-2024-05-06--12-00 contains the v2 patch. > I wonder if net-dev testing recognized v3

Re: [PATCH net-next v3 2/2] selftests/net: add ICMP unreachable over IPsec tunnel

2024-05-06 Thread Jakub Kicinski
On Mon, 6 May 2024 10:05:54 +0200 Antony Antony wrote: > Add IPsec tunnel, aka xfrm state, tests with ICMP flags enabled. > IPv4 and IPv6, unreachable tests over xfrm/IPsec tunnels, > xfrm SA with "flag icmp" set. Doesn't seem to work: # selftests: net: xfrm_state.sh # ./xfrm_state.sh: line 91:

Re: [PATCH net-next] selftest: epoll_busy_poll: epoll busy poll tests

2024-05-03 Thread Jakub Kicinski
On Fri, 3 May 2024 16:09:45 -0700 Joe Damato wrote: > > "GEN" is for files which are built for other tests to use. > > IOW unless there's also a wrapper script under TEST_PROGS > > (or the C code is itself under TEST_PROGS) this test won't > > be executed by most CIs. > > Ah, I see. OK. > > If

Re: [PATCH net-next] selftest: epoll_busy_poll: epoll busy poll tests

2024-05-03 Thread Jakub Kicinski
On Thu, 2 May 2024 21:20:11 + Joe Damato wrote: > --- a/tools/testing/selftests/net/Makefile > +++ b/tools/testing/selftests/net/Makefile > @@ -84,6 +84,7 @@ TEST_GEN_FILES += sctp_hello > TEST_GEN_FILES += csum > TEST_GEN_FILES += ip_local_port_range > TEST_GEN_FILES += bind_wildcard >

Re: [PATCH net-next] selftests: drv-net: add checksum tests

2024-05-01 Thread Jakub Kicinski
On Wed, 01 May 2024 21:38:24 -0400 Willem de Bruijn wrote: > A few more may be in scope eventually: toeplitz, udpgso_bench, gro, > so_txtime. Move them on a case-by-case basis? If you plan to use them all in hw tests - no preference, you can move them all in one fell swoop if you prefer. > >

Re: [PATCH net-next] selftests: drv-net: add checksum tests

2024-05-01 Thread Jakub Kicinski
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

Re: [PATCH v3 0/9] Fix Kselftest's vfork() side effects

2024-04-30 Thread Jakub Kicinski
On Tue, 30 Apr 2024 15:54:38 +0200 Mickaël Salaün wrote: > Jakub, can you please review it? I looked thru it. I don't have the cycles to investigate and suggest a better approach but the sprinkling of mmaps(), if nothing else, feels a bit band-aid-y 路️

Re: [PATCH v2 4/9] selftests/harness: Fix interleaved scheduling leading to race conditions

2024-04-29 Thread Jakub Kicinski
On Mon, 29 Apr 2024 08:52:36 -0700 Kees Cook wrote: > > +/* Wait for the child process to end but without sharing memory mapping. */ > > +static pid_t __attribute__((__unused__)) clone3_vfork(void) > > Why "unused"? Right, static inline is enough

Re: [PATCH net-next 6/6] selftests: drv-net-hw: add test for memory allocation failures with page pool

2024-04-29 Thread Jakub Kicinski
On Mon, 29 Apr 2024 11:02:51 -0400 Willem de Bruijn wrote: > The only interesting points so far are the use of deploy (which I > assume you have on some internal patch already) Yup, they need a touch more cleaning up but the PSP tests use it. > and that with bkg would not fail the test if the

Re: [PATCH net-next 0/6] selftests: net: page_poll allocation error injection

2024-04-29 Thread Jakub Kicinski
On Mon, 29 Apr 2024 17:01:55 +0200 Andrew Lunn wrote: > > I'm not super happy with the traffic generation using iperf3, > > my initial approach was to use mausezahn. But it turned out to be > > 5x slower in terms of PPS. Hopefully this is good enough for now. > > How important is PPS? In order

Re: [PATCH net-next 6/6] selftests: drv-net-hw: add test for memory allocation failures with page pool

2024-04-29 Thread Jakub Kicinski
On Mon, 29 Apr 2024 17:12:29 +0200 Andrew Lunn wrote: > > # ./drivers/net/hw/pp_alloc_fail.py > > KTAP version 1 > > 1..1 > > # ethtool -G change retval: success > > ok 1 pp_alloc_fail.test_pp_alloc > > # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 > > If i'm reading the

Re: [PATCH net-next 6/6] selftests: drv-net-hw: add test for memory allocation failures with page pool

2024-04-29 Thread Jakub Kicinski
On Sat, 27 Apr 2024 09:49:28 -0400 Willem de Bruijn wrote: > Eventually probably want a more generic fault injection class. > > And for both fault injection and background traffic the with object > construct to ensure cleanup in all cases. > > Maybe even the same for ethtool, as ip and ethtool

[PATCH net-next v2 6/6] selftests: drv-net-hw: add test for memory allocation failures with page pool

2024-04-29 Thread Jakub Kicinski
blem fixed in commit 730117730709 ("eth: bnxt: fix counting packets discarded due to OOM and netpoll"). Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski --- .../testing/selftests/drivers/net/hw/Makefile | 1 + .../selftests/drivers/net/hw/pp_alloc_fail.py | 129 +

[PATCH net-next v2 5/6] selftests: drv-net: support generating iperf3 load

2024-04-29 Thread Jakub Kicinski
While we are not very interested in testing performance it's useful to be able to generate a lot of traffic. iperf is the simplest way of getting relatively high PPS. Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski --- v2: - fix import order in __init__.py --- .../selftests

[PATCH net-next v2 4/6] selftests: net: py: avoid all ports < 10k

2024-04-29 Thread Jakub Kicinski
When picking TCP ports to use, avoid all below 10k. This should lower the chance of collision or running afoul whatever random policies may be on the host. Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski --- tools/testing/selftests/net/lib/py/utils.py | 2 +- 1 file changed, 1

[PATCH net-next v2 3/6] selftests: net: py: extract tool logic

2024-04-29 Thread Jakub Kicinski
rt the --json switch. To avoid having to wrap all of them individually create a tool() helper. Switch from -j to --json (for ethtool). While at it consume the netns attribute at the ip() level. Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski --- v2: - use consistent quote type

[PATCH net-next v2 2/6] selftests: drv-net-hw: support using Python from net hw tests

2024-04-29 Thread Jakub Kicinski
de Bruijn Signed-off-by: Jakub Kicinski --- tools/testing/selftests/Makefile | 2 +- tools/testing/selftests/drivers/net/hw/Makefile | 1 + .../selftests/drivers/net/hw/lib/py/__init__.py | 16 .../testing/selftests/drivers/net/lib/py/env.py | 10 -

[PATCH net-next v2 1/6] net: page_pool: support error injection

2024-04-29 Thread Jakub Kicinski
Because of caching / recycling using the general page allocation failures to induce errors in page pool allocation is very hard. Add direct error injection support to page_pool_alloc_pages(). Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski --- CC: h...@kernel.org CC: ilias.apalodi

[PATCH net-next v2 0/6] selftests: net: page_poll allocation error injection

2024-04-29 Thread Jakub Kicinski
t to be 5x slower in terms of PPS. Hopefully this is good enough for now. v2: - fix the string formatting for tool wrapper change (patch 3) - fix import order for load.py v1: https://lore.kernel.org/all/20240426232400.624864-1-k...@kernel.org/ Jakub Kicinski (6): net: page_pool: support error

Re: [PATCH net-next 3/6] selftests: net: py: extract tool logic

2024-04-29 Thread Jakub Kicinski
On Sat, 27 Apr 2024 09:51:01 -0400 Willem de Bruijn wrote: > > +def ip(args, json=None, ns=None, host=None): > > +if ns: > > +args = '-netns ' + ns + " " + args > > Minor: inconsistent use of single and double comma strings. Maybe > there's a reasoning that I'm just missing. I also

[PATCH net-next 6/6] selftests: drv-net-hw: add test for memory allocation failures with page pool

2024-04-26 Thread Jakub Kicinski
blem fixed in commit 730117730709 ("eth: bnxt: fix counting packets discarded due to OOM and netpoll"). Signed-off-by: Jakub Kicinski --- .../testing/selftests/drivers/net/hw/Makefile | 1 + .../selftests/drivers/net/hw/pp_alloc_fail.py | 129 ++ tools/testing/selftests/net/lib

[PATCH net-next 5/6] selftests: drv-net: support generating iperf3 load

2024-04-26 Thread Jakub Kicinski
While we are not very interested in testing performance it's useful to be able to generate a lot of traffic. iperf is the simplest way of getting relatively high PPS. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/__init__.py | 1 + .../selftests/drivers/net/lib/py/load.py

[PATCH net-next 4/6] selftests: net: py: avoid all ports < 10k

2024-04-26 Thread Jakub Kicinski
When picking TCP ports to use, avoid all below 10k. This should lower the chance of collision or running afoul whatever random policies may be on the host. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/net/lib/py/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH net-next 3/6] selftests: net: py: extract tool logic

2024-04-26 Thread Jakub Kicinski
rt the --json switch. To avoid having to wrap all of them individually create a tool() helper. Switch from -j to --json (for ethtool). While at it consume the netns attribute at the ip() level. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/net/lib/py/utils.py | 12 +--- 1 file c

[PATCH net-next 2/6] selftests: drv-net-hw: support using Python from net hw tests

2024-04-26 Thread Jakub Kicinski
We created a separate directory for HW-only tests, recently. Glue in the Python test library there, Python is a bit annoying when it comes to using library code located "lower" in the directory structure. Reuse the Env class, but let tests require non-nsim setup. Signed-off-by: Jaku

[PATCH net-next 0/6] selftests: net: page_poll allocation error injection

2024-04-26 Thread Jakub Kicinski
t to be 5x slower in terms of PPS. Hopefully this is good enough for now. Jakub Kicinski (6): net: page_pool: support error injection selftests: drv-net-hw: support using Python from net hw tests selftests: net: py: extract tool logic selftests: net: py: avoid all ports < 10k selft

[PATCH net-next 1/6] net: page_pool: support error injection

2024-04-26 Thread Jakub Kicinski
Because of caching / recycling using the general page allocation failures to induce errors in page pool allocation is very hard. Add direct error injection support to page_pool_alloc_pages(). Signed-off-by: Jakub Kicinski --- CC: h...@kernel.org CC: ilias.apalodi...@linaro.org --- net/core

[PATCH net-next v2 3/3] selftests: drv-net: validate the environment

2024-04-25 Thread Jakub Kicinski
Throw a slightly more helpful exception when env variables are partially populated. Prior to this change we'd get a dictionary key exception somewhere later on. Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski --- v2: - check "both or none" for addresses --- .../selftes

[PATCH net-next v2 1/3] selftests: drv-net: extend the README with more info and example

2024-04-25 Thread Jakub Kicinski
Add more info to the README. It's also now copied to GitHub for increased visibility: https://github.com/linux-netdev/nipa/wiki/Running-driver-tests Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski --- .../testing/selftests/drivers/net/README.rst | 97 --- 1 file

[PATCH net-next v2 2/3] selftests: drv-net: reimplement the config parser

2024-04-25 Thread Jakub Kicinski
The shell lexer is not helping much, do very basic parsing manually. Reviewed-by: Willem de Bruijn Signed-off-by: Jakub Kicinski --- v2: - use split() to split the line on = --- .../selftests/drivers/net/lib/py/env.py | 26 ++- 1 file changed, 14 insertions(+), 12

[PATCH net-next v2 0/3] selftests: drv-net: round some sharp edges

2024-04-25 Thread Jakub Kicinski
I had to explain how to run the driver tests twice already. Improve the README so we can just point to it. Improve the config validation. v2: - use split() in patch 2 - more validation in last patch v1: https://lore.kernel.org/r/20240424221444.4194069-1-k...@kernel.org/ Jakub Kicinski (3

Re: [PATCH net-next 0/4] selftests: drv-net: round some sharp edges

2024-04-25 Thread Jakub Kicinski
On Wed, 24 Apr 2024 21:45:49 -0400 Willem de Bruijn wrote: > Left two minor points comments inline, but nothing important. I'll respin, apply your suggestions and drop the unfortunate patch.

Re: [ovs-dev] selftests: openvswitch: Questions about possible enhancements

2024-04-25 Thread Jakub Kicinski
On Thu, 25 Apr 2024 19:57:19 +0100 Simon Horman wrote: > openvswitch.sh does not appear to have any dependencies on Open vSwitch > user-space. My understanding is that, rather, it makes use of > tools/testing/selftests/net/openvswitch/ovs-dpctl.py to talk to the Kernel > using Netlink (which is

Re: selftests: openvswitch: Questions about possible enhancements

2024-04-24 Thread Jakub Kicinski
On Wed, 24 Apr 2024 17:44:05 +0100 Simon Horman wrote: > I have recently been exercising the Open vSwitch kernel selftests, > using vng, Speaking of ovs tests, we currently don't run them in CI (and suffer related skips in pmtu.sh) because Amazon Linux doesn't have ovs packaged and building it

Re: ynl: maybe minor bug?

2024-04-24 Thread Jakub Kicinski
On Wed, 24 Apr 2024 16:19:49 -0700 Joe Damato wrote: > I'm not sure whether: > > 1. tools/net/ynl/lib/ynl.py should be raising NlError when there is an >extack in this case (I think this is probably the way to go?), or > > 2. the tests should be changed so that they don't expect an exception

Re: [PATCH net-next 1/4] selftests: drv-net: force pseudo-terminal allocation in ssh

2024-04-24 Thread Jakub Kicinski
On Wed, 24 Apr 2024 15:14:41 -0700 Jakub Kicinski wrote: > This is not yet needed, because we don't terminate remote background > commands. But once we do, if we run ssh without -t the ssh session > may close and the program may carry on happily running. > > I have hit this proble

[PATCH net-next 3/4] selftests: drv-net: reimplement the config parser

2024-04-24 Thread Jakub Kicinski
The shell lexer is not helping much, do very basic parsing manually. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 26 ++- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/drivers/net/lib/py/env.py b

[PATCH net-next 4/4] selftests: drv-net: validate the environment

2024-04-24 Thread Jakub Kicinski
Throw a slightly more helpful exception when env variables are partially populated. Prior to this change we'd get a dictionary key exception somewhere later on. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 20 +++ 1 file changed, 20

[PATCH net-next 2/4] selftests: drv-net: extend the README with more info and example

2024-04-24 Thread Jakub Kicinski
Add more info to the README. It's also now copied to GitHub for increased visibility: https://github.com/linux-netdev/nipa/wiki/Running-driver-tests Signed-off-by: Jakub Kicinski --- .../testing/selftests/drivers/net/README.rst | 97 --- 1 file changed, 85 insertions(+), 12

[PATCH net-next 1/4] selftests: drv-net: force pseudo-terminal allocation in ssh

2024-04-24 Thread Jakub Kicinski
time debugging it. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/drivers/net/lib/py/remote_ssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/lib/py/remote_ssh.py b/tools/testing/selftests/drivers/net/lib/py/remote_ssh.py

[PATCH net-next 0/4] selftests: drv-net: round some sharp edges

2024-04-24 Thread Jakub Kicinski
I had to explain how to run the driver tests twice already. Improve the README so we can just point to it. Also fix a potential problem with the SSH remote sessions. Jakub Kicinski (4): selftests: drv-net: force pseudo-terminal allocation in ssh selftests: drv-net: extend the README with more

Re: [PATCH net-next v5 0/7] selftests: drv-net: support testing with a remote system

2024-04-24 Thread Jakub Kicinski
On Wed, 24 Apr 2024 10:13:41 -0400 Willem de Bruijn wrote: > > I haven't thought about this part much, TBH. I'm not aware of any > > scheme used in other tests. > > IIUC the problem is that we need root locally, and then try to SSH > > over to remote. But normally the SSH keys belong to the

Re: [PATCH net-next v5 0/7] selftests: drv-net: support testing with a remote system

2024-04-23 Thread Jakub Kicinski
On Tue, 23 Apr 2024 13:57:45 -0400 Willem de Bruijn wrote: > Only possible non-obvious observation is that some kselftests expect > as root, and the ssh remote logic extends that to expecting ssh > root access to the remote host. > > Would it make sense to explicitly add sudo for all privileged >

Re: [PATCH net-next 1/4] netdev: support dumping a single netdev in qstats

2024-04-22 Thread Jakub Kicinski
On Sun, 21 Apr 2024 13:32:24 -0600 David Ahern wrote: > On 4/21/24 1:17 PM, Eric Dumazet wrote: > > I wonder if NLM_F_DUMP_FILTERED should not be reported to user space ? > > good point. We do set that flag for other dumps when a filter has been > used to limit data returned. That flag appears

[PATCH net-next v5 7/7] selftests: drv-net: add require_XYZ() helpers for validating env

2024-04-19 Thread Jakub Kicinski
Wrap typical checks like whether given command used by the test is available in helpers. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 29 ++- tools/testing/selftests/drivers/net/ping.py | 6 2 files changed, 34 insertions(+), 1

[PATCH net-next v5 6/7] selftests: drv-net: add a TCP ping test case (and useful helpers)

2024-04-19 Thread Jakub Kicinski
resses being wrapped in [], it's not the only command which requires this format, so add the wrapped address to env. The hope is to save test code from checking if address is v6. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 5 +++ tools/testing/selftests/driver

[PATCH net-next v5 5/7] selftests: net: support matching cases by name prefix

2024-04-19 Thread Jakub Kicinski
(). Let the author list the desired prefixes. globals() need to be passed explicitly, IDK how to work around that. Signed-off-by: Jakub Kicinski --- v4: - spell the code out a little to make it clearer --- tools/testing/selftests/drivers/net/ping.py | 3 +-- tools/testing/selftests/net/lib/py

[PATCH net-next v5 4/7] selftests: drv-net: add a trivial ping test

2024-04-19 Thread Jakub Kicinski
ping.test_v4 # ok 2 ping.test_v6 # SKIP Test requires IPv6 connectivity # # Totals: pass:1 fail:0 xfail:1 xpass:0 skip:0 error:0 Signed-off-by: Jakub Kicinski --- v4: - move adding the "require_XYZ()" checks to last patch --- tools/testing/selftests/drivers/net/Makefile | 5 +++- tools

[PATCH net-next v5 3/7] selftests: drv-net: construct environment for running tests which require an endpoint

2024-04-19 Thread Jakub Kicinski
Nothing surprising here, hopefully. Wrap the variables from the environment into a class or spawn a netdevsim based env and pass it to the tests. Signed-off-by: Jakub Kicinski --- .../testing/selftests/drivers/net/README.rst | 33 +++ .../selftests/drivers/net/lib/py/env.py | 98

[PATCH net-next v5 2/7] selftests: drv-net: factor out parsing of the env

2024-04-19 Thread Jakub Kicinski
The tests with a remote end will use a different class, for clarity, but will also need to parse the env. So factor parsing the env out to a function. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 43 +++ 1 file changed, 26 insertions(+), 17

[PATCH net-next v5 1/7] selftests: drv-net: define endpoint structures

2024-04-19 Thread Jakub Kicinski
tion methods without bothering upstream code base. Stick to the "simple" / "no unnecessary abstractions" model for referring to the remote endpoints. The host / remote object are passed as an argument to the usual cmd() or ip() invocation. For example: ip("link show&qu

[PATCH net-next v5 0/7] selftests: drv-net: support testing with a remote system

2024-04-19 Thread Jakub Kicinski
6004556.1618804-1-k...@kernel.org - rename endpoint -> remote - use 2001:db8:: v6 prefix - add a note about persistent SSH connections - add the kernel config v1: https://lore.kernel.org/all/20240412233705.1066444-1-k...@kernel.org Jakub Kicinski (7): selftests: drv-net: define endpoi

[PATCH net-next 4/4] selftests: drv-net: test dumping qstats per device

2024-04-19 Thread Jakub Kicinski
Add a test for dumping qstats device by device. ksft framework grows a ksft_raises() helper, to be used under with, which should be familiar to unittest users. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/drivers/net/stats.py | 62 +++- tools/testing/selftests/net

[PATCH net-next 3/4] netlink: support all extack types in dumps

2024-04-19 Thread Jakub Kicinski
with NL_SET_BAD_ATTR() than type an English message saying "attribute XYZ is $reason-why-bad". Support all of extack. The fact that extack only gets added if it fits remains unaddressed. Signed-off-by: Jakub Kicinski --- net/netlink/af_netlink.c | 15 ++- 1 file changed,

[PATCH net-next 2/4] netlink: move extack writing helpers

2024-04-19 Thread Jakub Kicinski
Next change will need them in netlink_dump_done(), pure move. Signed-off-by: Jakub Kicinski --- net/netlink/af_netlink.c | 126 +++ 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index

[PATCH net-next 1/4] netdev: support dumping a single netdev in qstats

2024-04-19 Thread Jakub Kicinski
Having to filter the right ifindex in the tests is a bit tedious. Add support for dumping qstats for a single ifindex. Signed-off-by: Jakub Kicinski --- Documentation/netlink/specs/netdev.yaml | 1 + net/core/netdev-genl-gen.c | 1 + net/core/netdev-genl.c | 52

[PATCH net-next 0/4] netdev: support dumping a single netdev in qstats

2024-04-19 Thread Jakub Kicinski
to the net tree). Jakub Kicinski (4): netdev: support dumping a single netdev in qstats netlink: move extack writing helpers netlink: support all extack types in dumps selftests: drv-net: test dumping qstats per device Documentation/netlink/specs/netdev.yaml | 1 + net/core/netdev-genl

[PATCH net-next v4 7/7] selftests: drv-net: add require_XYZ() helpers for validating env

2024-04-18 Thread Jakub Kicinski
Wrap typical checks like whether given command used by the test is available in helpers. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 29 ++- tools/testing/selftests/drivers/net/ping.py | 6 2 files changed, 34 insertions(+), 1

[PATCH net-next v4 6/7] selftests: drv-net: add a TCP ping test case (and useful helpers)

2024-04-18 Thread Jakub Kicinski
resses being wrapped in [], it's not the only command which requires this format, so add the wrapped address to env. The hope is to save test code from checking if address is v6. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 4 +++ tools/testing/selftests/driver

[PATCH net-next v4 5/7] selftests: net: support matching cases by name prefix

2024-04-18 Thread Jakub Kicinski
(). Let the author list the desired prefixes. globals() need to be passed explicitly, IDK how to work around that. Signed-off-by: Jakub Kicinski --- v4: - spell the code out a little to make it clearer --- tools/testing/selftests/drivers/net/ping.py | 3 +-- tools/testing/selftests/net/lib/py

[PATCH net-next v4 4/7] selftests: drv-net: add a trivial ping test

2024-04-18 Thread Jakub Kicinski
ping.test_v4 # ok 2 ping.test_v6 # SKIP Test requires IPv6 connectivity # # Totals: pass:1 fail:0 xfail:1 xpass:0 skip:0 error:0 Signed-off-by: Jakub Kicinski --- v4: - move adding the "require_XYZ()" checks to last patch --- tools/testing/selftests/drivers/net/Makefile | 5 +++- tools

[PATCH net-next v4 3/7] selftests: drv-net: construct environment for running tests which require an endpoint

2024-04-18 Thread Jakub Kicinski
Nothing surprising here, hopefully. Wrap the variables from the environment into a class or spawn a netdevsim based env and pass it to the tests. Signed-off-by: Jakub Kicinski --- .../testing/selftests/drivers/net/README.rst | 33 +++ .../selftests/drivers/net/lib/py/env.py | 98

[PATCH net-next v4 2/7] selftests: drv-net: factor out parsing of the env

2024-04-18 Thread Jakub Kicinski
The tests with a remote end will use a different class, for clarity, but will also need to parse the env. So factor parsing the env out to a function. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 43 +++ 1 file changed, 26 insertions(+), 17

[PATCH net-next v4 1/7] selftests: drv-net: define endpoint structures

2024-04-18 Thread Jakub Kicinski
tion methods without bothering upstream code base. Stick to the "simple" / "no unnecessary abstractions" model for referring to the remote endpoints. The host / remote object are passed as an argument to the usual cmd() or ip() invocation. For example: ip("link show&qu

[PATCH net-next v4 0/7] selftests: drv-net: support testing with a remote system

2024-04-18 Thread Jakub Kicinski
hs (patch 3) - last two patches are new v2: https://lore.kernel.org/all/20240416004556.1618804-1-k...@kernel.org - rename endpoint -> remote - use 2001:db8:: v6 prefix - add a note about persistent SSH connections - add the kernel config v1: https://lore.kernel.org/all/20240412233705.1066444-1-k.

Re: [PATCH net-next v3 8/8] selftests: drv-net: add a TCP ping test case (and useful helpers)

2024-04-18 Thread Jakub Kicinski
On Thu, 18 Apr 2024 10:44:39 -0400 Willem de Bruijn wrote: > > +def test_tcp(cfg) -> None: > > +port = random.randrange(1024 + (1 << 15)) > > +with bkg(f"nc -l {cfg.addr} {port}") as nc: > > +wait_port_listen(port) > > + > > +cmd(f"echo ping | nc {cfg.addr} {port}", > > +

Re: [PATCH net-next v3 7/8] selftests: net: support matching cases by name prefix

2024-04-18 Thread Jakub Kicinski
On Thu, 18 Apr 2024 10:26:19 -0400 Willem de Bruijn wrote: > > -def ksft_run(cases, args=()): > > +def ksft_run(cases=None, globs=None, case_pfx=None, args=()): > > +cases = cases or [] > > + > > +if globs and case_pfx: > > +for key, value in globs.items(): > > +

[PATCH net-next v3 8/8] selftests: drv-net: add a TCP ping test case (and useful helpers)

2024-04-17 Thread Jakub Kicinski
is support to cmd() directly but it runs the command in the constructor, so by the time we __enter__ it's too late to make sure we used "background=True". Second useful helper transplanted from net_helper.sh is wait_port_listen(). Signed-off-by: Jakub Kicinski --- tools/testing/selftests

[PATCH net-next v3 7/8] selftests: net: support matching cases by name prefix

2024-04-17 Thread Jakub Kicinski
(). Let the author list the desired prefixes. globals() need to be passed explicitly, IDK how to work around that. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/drivers/net/ping.py | 3 +-- tools/testing/selftests/net/lib/py/ksft.py | 10 +- 2 files changed, 10 insertions(+), 3

  1   2   3   4   >