mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
88cda1c9da
This patch extends the libbpf to provide API support to allow specifying BPF object name. In tools/lib/bpf/libbpf, the C symbol of the function and the map is used. Regarding section name, all maps are under the same section named "maps". Hence, section name is not a good choice for map's name. To be consistent with map, bpf_prog also follows and uses its function symbol as the prog's name. This patch adds logic to collect function's symbols in libbpf. There is existing codes to collect the map's symbols and no change is needed. The bpf_load_program_name() and bpf_map_create_name() are added to take the name argument. For the other bpf_map_create_xxx() variants, a name argument is directly added to them. In samples/bpf, bpf_load.c in particular, the symbol is also used as the map's name and the map symbols has already been collected in the existing code. For bpf_prog, bpf_load.c does not collect the function symbol name. We can consider to collect them later if there is a need to continue supporting the bpf_load.c. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Alexei Starovoitov <ast@fb.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net> |
||
---|---|---|
.. | ||
gnu | ||
include/uapi/linux | ||
.gitignore | ||
bpf_endian.h | ||
bpf_helpers.h | ||
bpf_util.h | ||
config | ||
Makefile | ||
sockmap_parse_prog.c | ||
sockmap_verdict_prog.c | ||
test_align.c | ||
test_iptunnel_common.h | ||
test_kmod.sh | ||
test_l4lb.c | ||
test_lpm_map.c | ||
test_lru_map.c | ||
test_maps.c | ||
test_obj_id.c | ||
test_pkt_access.c | ||
test_pkt_md_access.c | ||
test_progs.c | ||
test_tag.c | ||
test_tcp_estats.c | ||
test_verifier.c | ||
test_xdp_meta.c | ||
test_xdp_meta.sh | ||
test_xdp_redirect.c | ||
test_xdp_redirect.sh | ||
test_xdp.c |