All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bpf: Replace 0 with BPF_K
@ 2022-06-22  3:19 Simon wang
  2022-06-23 23:44 ` John Fastabend
  2022-06-24 13:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Simon wang @ 2022-06-22  3:19 UTC (permalink / raw)
  To: ast, daniel, andrii; +Cc: netdev, bpf, linux-kernel, Simon Wang

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] bpf: Replace 0 with BPF_K
  2022-06-22  3:19 [PATCH] bpf: Replace 0 with BPF_K Simon wang
@ 2022-06-23 23:44 ` John Fastabend
  2022-06-24 13:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: John Fastabend @ 2022-06-23 23:44 UTC (permalink / raw)
  To: Simon wang, ast, daniel, andrii; +Cc: netdev, bpf, linux-kernel, Simon Wang

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bpf: Replace 0 with BPF_K
  2022-06-22  3:19 [PATCH] bpf: Replace 0 with BPF_K Simon wang
  2022-06-23 23:44 ` John Fastabend
@ 2022-06-24 13:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-24 13:50 UTC (permalink / raw)
  To: Simon wang; +Cc: ast, daniel, andrii, netdev, bpf, linux-kernel

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Tue, 21 Jun 2022 23:19:23 -0400 you 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(-)

Here is the summary with links:
  - bpf: Replace 0 with BPF_K
    https://git.kernel.org/bpf/bpf-next/c/395e942d34a2

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-24 13:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22  3:19 [PATCH] bpf: Replace 0 with BPF_K Simon wang
2022-06-23 23:44 ` John Fastabend
2022-06-24 13:50 ` patchwork-bot+netdevbpf

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.