On Thu, 24 Jan 2019 13:09:49 +0100 Jesper Dangaard Brouer <bro...@redhat.com> wrote:
> On Thu, 24 Jan 2019 12:56:36 +0100 > Daniel Borkmann <dan...@iogearbox.net> wrote: > > > > Please feel free to deprecate or remove the xdp_redirect_cpu --prognum > > > option. I would prefer if this was indeed converted to selecting the > > > program based on the name in the _kern.c file, instead of a number. > > > > Given this is BPF sample code, there is no need to deprecate, lets just > > remove --prognum option and add a new one for selection by name. > > I agree, just remove --prognum option. > Actually we can convert it to --progname and use it for providing the section name of program to be loaded. On Wed, 23 Jan 2019 15:11:09 +0100 Daniel Borkmann <dan...@iogearbox.net> wrote: > > can live with this. In case of typo and program being not found it would be > > good to print out the section names to choose from in usage(). > > Agree, might be nice as well via libbpf. Would it be acceptable to print them from within libbpf? Something as trivial as: void bpf_object__print_type_sections(struct bpf_object *obj, enum bpf_prog_type type) { struct bpf_program *prog; bpf_object__for_each_program(prog, obj) { if (bpf_program__is_type(prog, type)) pr_info("section %s\n", prog->section_name); } } Or do we want to add a accessor for section_name and go through programs in application?