selftests: net: move xdp_helper to net/lib

Move xdp_helper to net/lib to make it easier for other selftests to use
the helper.

Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/20250425071018.36078-2-minhquangbui99@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Bui Quang Minh
2025-04-25 14:10:15 +07:00
committed by Jakub Kicinski
parent c0b0a360ed
commit 59dd07db92
8 changed files with 5 additions and 5 deletions

View File

@@ -1,3 +1,2 @@
# SPDX-License-Identifier: GPL-2.0-only
napi_id_helper
xdp_helper

View File

@@ -8,7 +8,6 @@ TEST_INCLUDES := $(wildcard lib/py/*.py) \
TEST_GEN_FILES := \
napi_id_helper \
xdp_helper \
# end of TEST_GEN_FILES
TEST_PROGS := \

View File

@@ -8,7 +8,7 @@
#include <arpa/inet.h>
#include <sys/socket.h>
#include "ksft.h"
#include "../../net/lib/ksft.h"
int main(int argc, char *argv[])
{

View File

@@ -26,13 +26,13 @@ def nl_get_queues(cfg, nl, qtype='rx'):
def check_xsk(cfg, nl, xdp_queue_id=0) -> None:
# Probe for support
xdp = cmd(f'{cfg.test_dir / "xdp_helper"} - -', fail=False)
xdp = cmd(f'{cfg.net_lib_dir / "xdp_helper"} - -', fail=False)
if xdp.ret == 255:
raise KsftSkipEx('AF_XDP unsupported')
elif xdp.ret > 0:
raise KsftFailEx('unable to create AF_XDP socket')
with bkg(f'{cfg.test_dir / "xdp_helper"} {cfg.ifindex} {xdp_queue_id}',
with bkg(f'{cfg.net_lib_dir / "xdp_helper"} {cfg.ifindex} {xdp_queue_id}',
ksft_wait=3):
rx = tx = False

View File

@@ -1,2 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only
csum
xdp_helper

View File

@@ -10,6 +10,7 @@ TEST_FILES += ../../../../net/ynl
TEST_GEN_FILES += csum
TEST_GEN_FILES += $(patsubst %.c,%.o,$(wildcard *.bpf.c))
TEST_GEN_FILES += xdp_helper
TEST_INCLUDES := $(wildcard py/*.py sh/*.sh)