diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/net/bpf_jit_comp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 99f76103c6b7..ddeff4844a10 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c | |||
@@ -966,7 +966,12 @@ void bpf_int_jit_compile(struct bpf_prog *prog) | |||
966 | } | 966 | } |
967 | ctx.cleanup_addr = proglen; | 967 | ctx.cleanup_addr = proglen; |
968 | 968 | ||
969 | for (pass = 0; pass < 10; pass++) { | 969 | /* JITed image shrinks with every pass and the loop iterates |
970 | * until the image stops shrinking. Very large bpf programs | ||
971 | * may converge on the last pass. In such case do one more | ||
972 | * pass to emit the final image | ||
973 | */ | ||
974 | for (pass = 0; pass < 10 || image; pass++) { | ||
970 | proglen = do_jit(prog, addrs, image, oldproglen, &ctx); | 975 | proglen = do_jit(prog, addrs, image, oldproglen, &ctx); |
971 | if (proglen <= 0) { | 976 | if (proglen <= 0) { |
972 | image = NULL; | 977 | image = NULL; |