2022-03-10 13:18 UTC+0100 ~ Niklas Söderlund <niklas.soderlund@xxxxxxxxxxxx> > Commit 1a56c18e6c2e4e74 ("bpftool: Stop supporting BPF offload-enabled > feature probing") removed the support to probe for BPF offload features. > This is still something that is useful for NFP NIC that can support > offloading of BPF programs. > > The reason for the dropped support was that libbpf starting with v1.0 > would drop support for passing the ifindex to the BPF prog/map/helper > feature probing APIs. In order to keep this useful feature for NFP > restore the functionality by moving it directly into bpftool. > > The code restored is a simplified version of the code that existed in > libbpf which supposed passing the ifindex. The simplification is that it > only targets the cases where ifindex is given and call into libbpf for > the cases where it's not. > > Before restoring support for probing offload features: > > # bpftool feature probe dev ens4np0 > Scanning system call availability... > bpf() syscall is available > > Scanning eBPF program types... > > Scanning eBPF map types... > > Scanning eBPF helper functions... > eBPF helpers supported for program type sched_cls: > eBPF helpers supported for program type xdp: > > Scanning miscellaneous eBPF features... > Large program size limit is NOT available > Bounded loop support is NOT available > ISA extension v2 is NOT available > ISA extension v3 is NOT available > > With support for probing offload features restored: > > # bpftool feature probe dev ens4np0 > Scanning system call availability... > bpf() syscall is available > > Scanning eBPF program types... > eBPF program_type sched_cls is available > eBPF program_type xdp is available > > Scanning eBPF map types... > eBPF map_type hash is available > eBPF map_type array is available > > Scanning eBPF helper functions... > eBPF helpers supported for program type sched_cls: > - bpf_map_lookup_elem > - bpf_get_prandom_u32 > - bpf_perf_event_output > eBPF helpers supported for program type xdp: > - bpf_map_lookup_elem > - bpf_get_prandom_u32 > - bpf_perf_event_output > - bpf_xdp_adjust_head > - bpf_xdp_adjust_tail > > Scanning miscellaneous eBPF features... > Large program size limit is NOT available > Bounded loop support is NOT available > ISA extension v2 is NOT available > ISA extension v3 is NOT available > > Signed-off-by: Niklas Söderlund <niklas.soderlund@xxxxxxxxxxxx> > Signed-off-by: Simon Horman <simon.horman@xxxxxxxxxxxx> Looks good to me, thank you! Reviewed-by: Quentin Monnet <quentin@xxxxxxxxxxxxx>