[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHap4zuWvKru+rMztAPdJk+BES5pZCJy-tOegV4h03TX3vbkjQ@mail.gmail.com>
Date: Fri, 4 Feb 2022 17:24:35 -0500
From: Mauricio Vásquez Bernal <mauricio@...volk.io>
To: Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Quentin Monnet <quentin@...valent.com>
Subject: Re: [PATCH bpf-next] libbpf: Fix strict mode calculation
On Fri, Feb 4, 2022 at 5:05 PM Mauricio Vásquez <mauricio@...volk.io> wrote:
>
> The correct formula to get all possible values is
> ((__LIBBPF_STRICT_LAST - 1) * 2 - 1) as stated in
> libbpf_set_strict_mode().
>
> Fixes: 93b8952d223a ("libbpf: deprecate legacy BPF map definitions")
>
> Signed-off-by: Mauricio Vásquez <mauricio@...volk.io>
This patch fixes the problem but I'm not totally convinced it's the
right approach. As a user I'd expected that `LIBBPF_STRICT_ALL &
~LIBBPF_STRICT_MAP_DEFINITIONS` disables
`LIBBPF_STRICT_MAP_DEFINITIONS`, but it doesn't work because the test
at libbpf_set_strict_mode() returns -EINVAL.
What about using one of the following ideas instead?
1. Remove the check from libbpf_set_strict_mode().
2. Define `LIBBPF_STRICT_ALL` containing only the bits set of the
existing options. `LIBBPF_STRICT_ALL = ((__LIBBPF_STRICT_LAST - 1) *
2)- 1`.
Powered by blists - more mailing lists