xref: /kernel/linux/linux-5.10/tools/testing/selftests/bpf/progs/metadata_used.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/tools/testing/selftests/bpf/progs/
18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci#include <linux/bpf.h>
48c2ecf20Sopenharmony_ci#include <bpf/bpf_helpers.h>
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_civolatile const char bpf_metadata_a[] SEC(".rodata") = "bar";
78c2ecf20Sopenharmony_civolatile const int bpf_metadata_b SEC(".rodata") = 2;
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciSEC("cgroup_skb/egress")
108c2ecf20Sopenharmony_ciint prog(struct xdp_md *ctx)
118c2ecf20Sopenharmony_ci{
128c2ecf20Sopenharmony_ci	return bpf_metadata_b ? 1 : 0;
138c2ecf20Sopenharmony_ci}
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_cichar _license[] SEC("license") = "GPL";
16

Indexes created Thu Nov 07 10:32:03 CST 2024