mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
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:
committed by
Jakub Kicinski
parent
c0b0a360ed
commit
59dd07db92
@@ -1,3 +1,2 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
napi_id_helper
|
||||
xdp_helper
|
||||
|
||||
@@ -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 := \
|
||||
|
||||
@@ -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[])
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
1
tools/testing/selftests/net/lib/.gitignore
vendored
1
tools/testing/selftests/net/lib/.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
csum
|
||||
xdp_helper
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user