xref: /linux/tools/testing/selftests/drivers/net/hw/Makefile (revision 69050f8d6d075dc01af7a5f2f550a8067510366f)
1# SPDX-License-Identifier: GPL-2.0+ OR MIT
2
3# Check if io_uring supports zero-copy receive
4HAS_IOURING_ZCRX := $(shell \
5	echo -e '#include <liburing.h>\n' \
6	     'void *func = (void *)io_uring_register_ifq;\n' \
7	     'int main() {return 0;}' | \
8	$(CC) -luring -x c - -o /dev/null 2>&1 && echo y)
9
10ifeq ($(HAS_IOURING_ZCRX),y)
11COND_GEN_FILES += iou-zcrx
12else
13$(warning excluding iouring tests, liburing not installed or too old)
14endif
15
16TEST_GEN_FILES := \
17	$(COND_GEN_FILES) \
18# end of TEST_GEN_FILES
19
20TEST_PROGS = \
21	csum.py \
22	devlink_port_split.py \
23	devlink_rate_tc_bw.py \
24	devmem.py \
25	ethtool.sh \
26	ethtool_extended_state.sh \
27	ethtool_mm.sh \
28	ethtool_rmon.sh \
29	hw_stats_l3.sh \
30	hw_stats_l3_gre.sh \
31	iou-zcrx.py \
32	irq.py \
33	loopback.sh \
34	nic_timestamp.py \
35	pp_alloc_fail.py \
36	rss_api.py \
37	rss_ctx.py \
38	rss_drv.py \
39	rss_flow_label.py \
40	rss_input_xfrm.py \
41	toeplitz.py \
42	tso.py \
43	xsk_reconfig.py \
44	#
45
46TEST_FILES := \
47	ethtool_lib.sh \
48	#
49
50TEST_INCLUDES := \
51	$(wildcard lib/py/*.py ../lib/py/*.py) \
52	../../../net/lib.sh \
53	../../../net/forwarding/ipip_lib.sh \
54	../../../net/forwarding/lib.sh \
55	../../../net/forwarding/tc_common.sh \
56	#
57
58# YNL files, must be before "include ..lib.mk"
59YNL_GEN_FILES := \
60	ncdevmem \
61	toeplitz \
62# end of YNL_GEN_FILES
63TEST_GEN_FILES += $(YNL_GEN_FILES)
64TEST_GEN_FILES += $(patsubst %.c,%.o,$(wildcard *.bpf.c))
65
66include ../../../lib.mk
67
68# YNL build
69YNL_GENS := \
70	ethtool \
71	netdev \
72# end of YNL_GENS
73
74include ../../../net/ynl.mk
75
76include ../../../net/bpf.mk
77
78ifeq ($(HAS_IOURING_ZCRX),y)
79$(OUTPUT)/iou-zcrx: LDLIBS += -luring
80endif
81