Re: [PATCH bpf-next v2 3/4] bpftool: migrate from bpf_prog_test_run_xattr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 27, 2022 at 5:23 PM Delyan Kratunov <delyank@xxxxxx> wrote:
>
> bpf_prog_test_run_xattr is being deprecated in favor of bpf_prog_test_run_opts.
>
> Signed-off-by: Delyan Kratunov <delyank@xxxxxx>
> ---
>  tools/bpf/bpftool/prog.c | 55 ++++++++++++++++++++--------------------
>  1 file changed, 27 insertions(+), 28 deletions(-)
>
> diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
> index 87593f98d2d1..4f96c229ba77 100644
> --- a/tools/bpf/bpftool/prog.c
> +++ b/tools/bpf/bpftool/prog.c
> @@ -1272,12 +1272,12 @@ static int do_run(int argc, char **argv)
>  {
>         char *data_fname_in = NULL, *data_fname_out = NULL;
>         char *ctx_fname_in = NULL, *ctx_fname_out = NULL;
> -       struct bpf_prog_test_run_attr test_attr = {0};
>         const unsigned int default_size = SZ_32K;
>         void *data_in = NULL, *data_out = NULL;
>         void *ctx_in = NULL, *ctx_out = NULL;
>         unsigned int repeat = 1;
>         int fd, err;
> +       LIBBPF_OPTS(bpf_test_run_opts, topts);

let's name it "test_attr" and avoid most of the code churn?

Otherwise it looks good, thanks!

>
>         if (!REQ_ARGS(4))
>                 return -1;

[...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux