samples/bpf/xdp_sample_user.h

Source file repositories/reference/linux-study-clean/samples/bpf/xdp_sample_user.h

File Facts

System
Linux kernel
Corpus path
samples/bpf/xdp_sample_user.h
Extension
.h
Size
4556 bytes
Lines
111
Domain
Support Tooling And Documentation
Bucket
samples
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

sample_setup_maps((struct bpf_map *[]){                        \
			skel->maps.rx_cnt, skel->maps.redir_err_cnt,           \
			skel->maps.cpumap_enqueue_cnt,                         \
			skel->maps.cpumap_kthread_cnt,                         \
			skel->maps.exception_cnt, skel->maps.devmap_xmit_cnt,  \
			skel->maps.devmap_xmit_cnt_multi });                   \
	})

#define DEFINE_SAMPLE_INIT(name)                                               \
	static int sample_init(struct name *skel, int mask)                    \
	{                                                                      \
		int ret;                                                       \
		ret = __sample_init(mask);                                     \
		if (ret < 0)                                                   \
			return ret;                                            \
		if (mask & SAMPLE_REDIRECT_MAP_CNT)                            \
			__attach_tp(tp_xdp_redirect_map);                      \
		if (mask & SAMPLE_REDIRECT_CNT)                                \
			__attach_tp(tp_xdp_redirect);                          \
		if (mask & SAMPLE_REDIRECT_ERR_MAP_CNT)                        \
			__attach_tp(tp_xdp_redirect_map_err);                  \
		if (mask & SAMPLE_REDIRECT_ERR_CNT)                            \
			__attach_tp(tp_xdp_redirect_err);                      \
		if (mask & SAMPLE_CPUMAP_ENQUEUE_CNT)                          \
			__attach_tp(tp_xdp_cpumap_enqueue);                    \
		if (mask & SAMPLE_CPUMAP_KTHREAD_CNT)                          \
			__attach_tp(tp_xdp_cpumap_kthread);                    \
		if (mask & SAMPLE_EXCEPTION_CNT)                               \
			__attach_tp(tp_xdp_exception);                         \
		if (mask & SAMPLE_DEVMAP_XMIT_CNT)                             \
			__attach_tp(tp_xdp_devmap_xmit);                       \
		if (mask & SAMPLE_DEVMAP_XMIT_CNT_MULTI)                       \
			__attach_tp(tp_xdp_devmap_xmit_multi);                 \
		return 0;                                                      \
	}

#endif

Annotation

Implementation Notes