Skip to content

Commit 76e4d56

Browse files
geertuKernel Patches Daemon
authored andcommitted
net: smc: SMC_HS_CTRL_BPF should depend on BPF_JIT
If CONFIG_BPF_SYSCALL=y, but CONFIG_BPF_JIT=n: net/smc/smc_hs_bpf.c: In function ‘bpf_smc_hs_ctrl_init’: include/linux/bpf.h:2068:50: error: statement with no effect [-Werror=unused-value] 2068 | #define register_bpf_struct_ops(st_ops, type) ({ (void *)(st_ops); 0; }) | ^~~~~~~~~~~~~~~~ net/smc/smc_hs_bpf.c:139:16: note: in expansion of macro ‘register_bpf_struct_ops’ 139 | return register_bpf_struct_ops(&bpf_smc_hs_ctrl_ops, smc_hs_ctrl); | ^~~~~~~~~~~~~~~~~~~~~~~ While this compile error is caused by a bug in <linux/bpf.h>, none of the code in net/smc/smc_hs_bpf.c becomes effective if CONFIG_BPF_JIT is not enabled. Hence add a dependency on BPF_JIT. While at it, add the missing newline at the end of the file. Fixes: 15f295f ("net/smc: bpf: Introduce generic hook for handshake flow") Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 7cedeee commit 76e4d56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/smc/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ config SMC_DIAG
2222

2323
config SMC_HS_CTRL_BPF
2424
bool "Generic eBPF hook for SMC handshake flow"
25-
depends on SMC && BPF_SYSCALL
25+
depends on SMC && BPF_JIT && BPF_SYSCALL
2626
default y
2727
help
2828
SMC_HS_CTRL_BPF enables support to register generic eBPF hook for SMC
2929
handshake flow, which offer much greater flexibility in modifying the behavior
3030
of the SMC protocol stack compared to a complete kernel-based approach. Select
31-
this option if you want filtring the handshake process via eBPF programs.
31+
this option if you want filtring the handshake process via eBPF programs.

0 commit comments

Comments
 (0)