Skip to content

bpftool: fix feature output when helper probes fail

Milan Landaverde bpf lkml netdev 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpftool: adjust for error codes from libbpf probestools/bpf/bpftool/feature.c+2 -20 repliesApplied
2/2bpftool: output message if no helpers found in feature probingtools/bpf/bpftool/feature.c+15 -30 repliesApplied

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchQuentin Monnet
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH bpf-next 0/2] bpftool: fix feature output when helper probes fail

Currently in bpftool's feature probe, we incorrectly tell the user that all of the helper functions are supported for program types where helper probing fails or is explicitly unsupported[1]:

$ bpftool feature probe
...
eBPF helpers supported for program type tracing:
	- bpf_map_lookup_elem
	- bpf_map_update_elem
	- bpf_map_delete_elem
	...
	- bpf_redirect_neigh
	- bpf_check_mtu
	- bpf_sys_bpf
	- bpf_sys_close

This patch adjusts bpftool to relay to the user when helper support can't be determined:

$ bpftool feature probe
...
eBPF helpers supported for program type lirc_mode2:
    Program type not supported
eBPF helpers supported for program type tracing:
    Could not determine which helpers are available
eBPF helpers supported for program type struct_opts:
    Could not determine which helpers are available
eBPF helpers supported for program type ext:
    Could not determine which helpers are available

Rather than imply that no helpers are available for the program type, we let the user know that helper function probing failed entirely.

[1] https://lore.kernel.org/bpf/[email protected]/

Milan Landaverde (2):
bpftool: adjust for error codes from libbpf probes
bpftool: output message if no helpers found in feature probing

 tools/bpf/bpftool/feature.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

--
2.32.0