From: John Fastabend <john.fastabend@gmail.com>
To: Simon wang <wangchuanguo@inspur.com>,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org,
Simon Wang <wangchuanguo@inspur.com>
Subject: RE: [PATCH] bpf: Replace 0 with BPF_K
Date: Thu, 23 Jun 2022 16:44:28 -0700 [thread overview]
Message-ID: <62b4fadc6aaf_26268208bf@john.notmuch> (raw)
In-Reply-To: <20220622031923.65692-1-wangchuanguo@inspur.com>
Simon wang wrote:
> From: Simon Wang <wangchuanguo@inspur.com>
>
> Enhance readability.
>
> Signed-off-by: Simon Wang <wangchuanguo@inspur.com>
> ---
> kernel/bpf/verifier.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 2859901ffbe3..29060f15daab 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -9064,7 +9064,7 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)
>
> if (opcode == BPF_END || opcode == BPF_NEG) {
> if (opcode == BPF_NEG) {
> - if (BPF_SRC(insn->code) != 0 ||
> + if (BPF_SRC(insn->code) != BPF_K ||
> insn->src_reg != BPF_REG_0 ||
> insn->off != 0 || insn->imm != 0) {
> verbose(env, "BPF_NEG uses reserved fields\n");
> --
> 2.27.0
>
Code is fine and seems everywhere else we do this check with
BPF_SRC(insn->code) != BPF_K
One thing though this should have [PATCH bpf-next] in the title so its
clear the code is targeted for bpf-next. Although in this case its
obvious from the content.
Acked-by: John Fastabend <john.fastabend@gmail.com>
next prev parent reply other threads:[~2022-06-23 23:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 3:19 [PATCH] bpf: Replace 0 with BPF_K Simon wang
2022-06-23 23:44 ` John Fastabend [this message]
2022-06-24 13: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=62b4fadc6aaf_26268208bf@john.notmuch \
--to=john.fastabend@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wangchuanguo@inspur.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).