All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Jackman <jackmanb@google.com>
To: Hou Tao <houtao1@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Martin KaFai Lau <kafai@fb.com>, Yonghong Song <yhs@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next] bpf, x86: remove unnecessary handling of BPF_SUB atomic op
Date: Thu, 27 Jan 2022 11:48:02 +0100	[thread overview]
Message-ID: <CA+i-1C2HBja-8Am4gHkcrYdkruw0+sOaGDejc9DS-HfYVXVfyQ@mail.gmail.com> (raw)
In-Reply-To: <20220127083240.1425481-1-houtao1@huawei.com>

Yep - BPF_SUB is also excluded in Documentation/networking/filter.rst,
plus the interpreter and verifier don't support it.

Thanks,

Acked-by: Brendan Jackman <jackmanb@google.com>


On Thu, 27 Jan 2022 at 09:17, Hou Tao <houtao1@huawei.com> wrote:
>
> According to the LLVM commit (https://reviews.llvm.org/D72184),
> sync_fetch_and_sub() is implemented as a negation followed by
> sync_fetch_and_add(), so there will be no BPF_SUB op and just
> remove it.
>
> Signed-off-by: Hou Tao <houtao1@huawei.com>
> ---
>  arch/x86/net/bpf_jit_comp.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
> index ce1f86f245c9..5d643ebb1e56 100644
> --- a/arch/x86/net/bpf_jit_comp.c
> +++ b/arch/x86/net/bpf_jit_comp.c
> @@ -787,7 +787,6 @@ static int emit_atomic(u8 **pprog, u8 atomic_op,
>         /* emit opcode */
>         switch (atomic_op) {
>         case BPF_ADD:
> -       case BPF_SUB:
>         case BPF_AND:
>         case BPF_OR:
>         case BPF_XOR:
> --
> 2.29.2
>

  reply	other threads:[~2022-01-27 10:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  8:32 [PATCH bpf-next] bpf, x86: remove unnecessary handling of BPF_SUB atomic op Hou Tao
2022-01-27 10:48 ` Brendan Jackman [this message]
2022-01-27 21:51   ` Daniel Borkmann
2022-01-28  2:40     ` John Fastabend
2022-01-27 21:50 ` patchwork-bot+netdevbpf

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=CA+i-1C2HBja-8Am4gHkcrYdkruw0+sOaGDejc9DS-HfYVXVfyQ@mail.gmail.com \
    --to=jackmanb@google.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=houtao1@huawei.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yhs@fb.com \
    /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.