xref: /linux/tools/testing/selftests/drivers/net/hw/Makefile (revision 84318277d6334c6981ab326d4acc87c6a6ddc9b8)
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_flow_label.py \
39	rss_input_xfrm.py \
40	toeplitz.py \
41	tso.py \
42	xsk_reconfig.py \
43	#
44
45TEST_FILES := \
46	ethtool_lib.sh \
47	#
48
49TEST_INCLUDES := \
50	$(wildcard lib/py/*.py ../lib/py/*.py) \
51	../../../net/lib.sh \
52	../../../net/forwarding/ipip_lib.sh \
53	../../../net/forwarding/lib.sh \
54	../../../net/forwarding/tc_common.sh \
55	#
56
57# YNL files, must be before "include ..lib.mk"
58YNL_GEN_FILES := \
59	ncdevmem \
60	toeplitz \
61# end of YNL_GEN_FILES
62TEST_GEN_FILES += $(YNL_GEN_FILES)
63TEST_GEN_FILES += $(patsubst %.c,%.o,$(wildcard *.bpf.c))
64
65include ../../../lib.mk
66
67# YNL build
68YNL_GENS := \
69	ethtool \
70	netdev \
71# end of YNL_GENS
72
73include ../../../net/ynl.mk
74
75include ../../../net/bpf.mk
76
77ifeq ($(HAS_IOURING_ZCRX),y)
78$(OUTPUT)/iou-zcrx: LDLIBS += -luring
79endif
80