netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch bpf-next] bpf: remove unused parameter from ___bpf_prog_run
@ 2021-03-31  7:51 He Fengqing
  2021-03-31 16:13 ` Song Liu
  2021-04-02 23:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: He Fengqing @ 2021-03-31  7:51 UTC (permalink / raw)
  To: linux-kernel, bpf, netdev
  Cc: kpsingh, john.fastabend, yhs, songliubraving, kafai, andrii, daniel, ast

'stack' parameter is not used in ___bpf_prog_run,
the base address have been set to FP reg. So consequently remove it.

Signed-off-by: He Fengqing <hefengqing@huawei.com>
---
 kernel/bpf/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index f5423251c118..5e31ee9f7512 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -1363,11 +1363,10 @@ u64 __weak bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr)
  *	__bpf_prog_run - run eBPF program on a given context
  *	@regs: is the array of MAX_BPF_EXT_REG eBPF pseudo-registers
  *	@insn: is the array of eBPF instructions
- *	@stack: is the eBPF storage stack
  *
  * Decode and execute eBPF instructions.
  */
-static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn, u64 *stack)
+static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn)
 {
 #define BPF_INSN_2_LBL(x, y)    [BPF_##x | BPF_##y] = &&x##_##y
 #define BPF_INSN_3_LBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] = &&x##_##y##_##z
@@ -1701,7 +1700,7 @@ static unsigned int PROG_NAME(stack_size)(const void *ctx, const struct bpf_insn
 \
 	FP = (u64) (unsigned long) &stack[ARRAY_SIZE(stack)]; \
 	ARG1 = (u64) (unsigned long) ctx; \
-	return ___bpf_prog_run(regs, insn, stack); \
+	return ___bpf_prog_run(regs, insn); \
 }
 
 #define PROG_NAME_ARGS(stack_size) __bpf_prog_run_args##stack_size
@@ -1718,7 +1717,7 @@ static u64 PROG_NAME_ARGS(stack_size)(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5, \
 	BPF_R3 = r3; \
 	BPF_R4 = r4; \
 	BPF_R5 = r5; \
-	return ___bpf_prog_run(regs, insn, stack); \
+	return ___bpf_prog_run(regs, insn); \
 }
 
 #define EVAL1(FN, X) FN(X)
-- 
2.25.1


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

* Re: [Patch bpf-next] bpf: remove unused parameter from ___bpf_prog_run
  2021-03-31  7:51 [Patch bpf-next] bpf: remove unused parameter from ___bpf_prog_run He Fengqing
@ 2021-03-31 16:13 ` Song Liu
  2021-04-02 23:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2021-03-31 16:13 UTC (permalink / raw)
  To: He Fengqing
  Cc: open list, bpf, Networking, KP Singh, John Fastabend,
	Yonghong Song, Song Liu, Martin KaFai Lau, Andrii Nakryiko,
	Daniel Borkmann, Alexei Starovoitov

On Wed, Mar 31, 2021 at 12:14 AM He Fengqing <hefengqing@huawei.com> wrote:
>
> 'stack' parameter is not used in ___bpf_prog_run,
> the base address have been set to FP reg. So consequently remove it.
>
> Signed-off-by: He Fengqing <hefengqing@huawei.com>

Acked-by: Song Liu <songliubraving@fb.com>

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

* Re: [Patch bpf-next] bpf: remove unused parameter from ___bpf_prog_run
  2021-03-31  7:51 [Patch bpf-next] bpf: remove unused parameter from ___bpf_prog_run He Fengqing
  2021-03-31 16:13 ` Song Liu
@ 2021-04-02 23:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-02 23:50 UTC (permalink / raw)
  To: He Fengqing
  Cc: linux-kernel, bpf, netdev, kpsingh, john.fastabend, yhs,
	songliubraving, kafai, andrii, daniel, ast

Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

On Wed, 31 Mar 2021 07:51:35 +0000 you wrote:
> 'stack' parameter is not used in ___bpf_prog_run,
> the base address have been set to FP reg. So consequently remove it.
> 
> Signed-off-by: He Fengqing <hefengqing@huawei.com>
> ---
>  kernel/bpf/core.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Here is the summary with links:
  - [bpf-next] bpf: remove unused parameter from ___bpf_prog_run
    https://git.kernel.org/bpf/bpf-next/c/2ec9898e9c70

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:[~2021-04-02 23:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31  7:51 [Patch bpf-next] bpf: remove unused parameter from ___bpf_prog_run He Fengqing
2021-03-31 16:13 ` Song Liu
2021-04-02 23:50 ` patchwork-bot+netdevbpf

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).