mbox series

[net-next,0/4] selftests: move bpf-offload test from bpf to net

Message ID 20240409031549.3531084-1-kuba@kernel.org (mailing list archive)
Headers show
Series selftests: move bpf-offload test from bpf to net | expand

Message

Jakub Kicinski April 9, 2024, 3:15 a.m. UTC
The test_offload.py test fits in networking and bpf equally
well. We started adding more Python tests in networking
and some of the code in test_offload.py can be reused,
so move it to networking. Looks like it bit rotted over
time and some fixes are needed.

Admittedly more code could be extracted but I only had
the time for a minor cleanup :(

Jakub Kicinski (4):
  selftests: move bpf-offload test from bpf to net
  selftests: net: bpf_offload: wait for maps
  selftests: net: declare section names for bpf_offload
  selftests: net: reuse common code in bpf_offload

 tools/testing/selftests/bpf/Makefile          |   1 -
 tools/testing/selftests/net/Makefile          |  11 +-
 .../test_offload.py => net/bpf_offload.py}    | 138 +++++-------------
 tools/testing/selftests/net/lib/py/nsim.py    |   9 +-
 .../sample_map_ret0.bpf.c}                    |   2 +-
 .../sample_ret0.c => net/sample_ret0.bpf.c}   |   3 +
 6 files changed, 57 insertions(+), 107 deletions(-)
 rename tools/testing/selftests/{bpf/test_offload.py => net/bpf_offload.py} (93%)
 rename tools/testing/selftests/{bpf/progs/sample_map_ret0.c => net/sample_map_ret0.bpf.c} (96%)
 rename tools/testing/selftests/{bpf/progs/sample_ret0.c => net/sample_ret0.bpf.c} (70%)

Comments

Stanislav Fomichev April 9, 2024, 4:10 p.m. UTC | #1
On 04/08, Jakub Kicinski wrote:
> The test_offload.py test fits in networking and bpf equally
> well. We started adding more Python tests in networking
> and some of the code in test_offload.py can be reused,
> so move it to networking. Looks like it bit rotted over
> time and some fixes are needed.
> 
> Admittedly more code could be extracted but I only had
> the time for a minor cleanup :(

Acked-by: Stanislav Fomichev <sdf@google.com>

Far too often I've seen this test broken because it's not in the CI :-(
Hope you can put it in the netdev one so we get a better signal.
Jakub Kicinski April 9, 2024, 4:19 p.m. UTC | #2
On Tue, 9 Apr 2024 09:10:04 -0700 Stanislav Fomichev wrote:
> Acked-by: Stanislav Fomichev <sdf@google.com>

Thanks!

> Far too often I've seen this test broken because it's not in the CI :-(
> Hope you can put it in the netdev one so we get a better signal.

We use kselftest infra directly, so they got auto-included.
But I gotta investigate what's going on on the runner because 
it seems to be failing right now:
https://netdev.bots.linux.dev/contest.html?test=bpf-offload-py
Martin KaFai Lau April 9, 2024, 6:12 p.m. UTC | #3
On 4/8/24 8:15 PM, Jakub Kicinski wrote:
> The test_offload.py test fits in networking and bpf equally
> well. We started adding more Python tests in networking
> and some of the code in test_offload.py can be reused,
> so move it to networking. Looks like it bit rotted over
> time and some fixes are needed.

Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Jakub Kicinski April 9, 2024, 9:31 p.m. UTC | #4
On Tue, 9 Apr 2024 09:19:08 -0700 Jakub Kicinski wrote:
> > Far too often I've seen this test broken because it's not in the CI :-(
> > Hope you can put it in the netdev one so we get a better signal.  
> 
> We use kselftest infra directly, so they got auto-included.
> But I gotta investigate what's going on on the runner because 
> it seems to be failing right now:
> https://netdev.bots.linux.dev/contest.html?test=bpf-offload-py

FWIW looks like iproute2 on the worker was built without libbpf support.
Fixed now, let's see if it turns green :)
patchwork-bot+netdevbpf@kernel.org April 10, 2024, 9:20 p.m. UTC | #5
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  8 Apr 2024 20:15:45 -0700 you wrote:
> The test_offload.py test fits in networking and bpf equally
> well. We started adding more Python tests in networking
> and some of the code in test_offload.py can be reused,
> so move it to networking. Looks like it bit rotted over
> time and some fixes are needed.
> 
> Admittedly more code could be extracted but I only had
> the time for a minor cleanup :(
> 
> [...]

Here is the summary with links:
  - [net-next,1/4] selftests: move bpf-offload test from bpf to net
    https://git.kernel.org/netdev/net-next/c/e59f0e93e92e
  - [net-next,2/4] selftests: net: bpf_offload: wait for maps
    https://git.kernel.org/netdev/net-next/c/fc50c698c28b
  - [net-next,3/4] selftests: net: declare section names for bpf_offload
    https://git.kernel.org/netdev/net-next/c/b1c2ce11d428
  - [net-next,4/4] selftests: net: reuse common code in bpf_offload
    https://git.kernel.org/netdev/net-next/c/6ce2b689932b

You are awesome, thank you!