xref: /linux/tools/testing/selftests/drivers/net/hw/Makefile (revision 5d3b12d1a24b72e147fbb585158f51585593f640)
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	ethtool_std_stats.sh \
30	gro_hw.py \
31	hw_stats_l3.sh \
32	hw_stats_l3_gre.sh \
33	iou-zcrx.py \
34	irq.py \
35	loopback.sh \
36	nic_timestamp.py \
37	nk_netns.py \
38	nk_qlease.py \
39	ntuple.py \
40	pp_alloc_fail.py \
41	rss_api.py \
42	rss_ctx.py \
43	rss_drv.py \
44	rss_flow_label.py \
45	rss_input_xfrm.py \
46	toeplitz.py \
47	tso.py \
48	uso.py \
49	xdp_metadata.py \
50	xsk_reconfig.py \
51	#
52
53TEST_FILES := \
54	ethtool_lib.sh \
55	#
56
57TEST_INCLUDES := \
58	$(wildcard lib/py/*.py ../lib/py/*.py) \
59	../../../net/lib.sh \
60	../../../net/forwarding/ipip_lib.sh \
61	../../../net/forwarding/lib.sh \
62	../../../net/forwarding/tc_common.sh \
63	#
64
65# YNL files, must be before "include ..lib.mk"
66YNL_GEN_FILES := \
67	ncdevmem \
68	toeplitz \
69# end of YNL_GEN_FILES
70TEST_GEN_FILES += $(YNL_GEN_FILES)
71TEST_GEN_FILES += $(patsubst %.c,%.o,$(wildcard *.bpf.c))
72
73include ../../../lib.mk
74
75# YNL build
76YNL_GENS := \
77	ethtool \
78	netdev \
79# end of YNL_GENS
80
81include ../../../net/ynl.mk
82
83include ../../../net/bpf.mk
84
85ifeq ($(HAS_IOURING_ZCRX),y)
86$(OUTPUT)/iou-zcrx: LDLIBS += -luring
87endif
88