All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Andrii Nakryiko <andrii@kernel.org>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com,
	daniel@iogearbox.net, kernel-team@fb.com
Subject: Re: [PATCH bpf-next 4/5] libbpf: streamline error reporting for high-level APIs
Date: Mon, 24 May 2021 16:49:05 -0700	[thread overview]
Message-ID: <20210524234905.n6ycfsmgqhn5ai3p@ast-mbp> (raw)
In-Reply-To: <20210521234258.1289307-1-andrii@kernel.org>

On Fri, May 21, 2021 at 04:42:58PM -0700, Andrii Nakryiko wrote:
>  
> +/* this goes away in libbpf 1.0 */
> +enum libbpf_strict_mode libbpf_mode = LIBBPF_STRICT_NONE;
> +
> +int libbpf_set_strict_mode(enum libbpf_strict_mode mode)
> +{
> +	/* __LIBBPF_STRICT_LAST is the last power-of-2 value used + 1, so to
> +	 * get all possible values we compensate last +1, and then (2*x - 1)
> +	 * to get the bit mask
> +	 */
> +	if (mode != LIBBPF_STRICT_ALL
> +	    && mode & ~((__LIBBPF_STRICT_LAST - 1) * 2 - 1))
> +		return libbpf_err(-EINVAL);
> +
> +	libbpf_mode = mode;
> +	return 0;
> +}

This hunk should be in patch 1, right?
Otherwise bisection will be broken.

  reply	other threads:[~2021-05-24 23:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 23:42 [PATCH bpf-next 4/5] libbpf: streamline error reporting for high-level APIs Andrii Nakryiko
2021-05-24 23:49 ` Alexei Starovoitov [this message]
2021-05-25  0:15   ` Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210524234905.n6ycfsmgqhn5ai3p@ast-mbp \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.