Skip to content

Commit

Permalink
riscv, bpf: Increase the maximum number of iterations
Browse files Browse the repository at this point in the history
Now that BPF programs can be up to 1M instructions, it is not uncommon
that a program requires more than the current 16 iterations to
converge.

Bump it to 32, which is enough for selftests/bpf, and test_bpf.ko.

Signed-off-by: Björn Töpel <bjorn@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211028161057.520552-2-bjorn@kernel.org
  • Loading branch information
Björn Töpel authored and Daniel Borkmann committed Nov 1, 2021
1 parent d696721 commit 4b54214
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/riscv/net/bpf_jit_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "bpf_jit.h"

/* Number of iterations to try until offsets converge. */
#define NR_JIT_ITERATIONS 16
#define NR_JIT_ITERATIONS 32

static int build_body(struct rv_jit_context *ctx, bool extra_pass, int *offset)
{
Expand Down

0 comments on commit 4b54214

Please sign in to comment.