[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <33750d4d-a451-40e7-8642-5c3a3b5e001c@linux.dev>
Date: Thu, 4 Dec 2025 11:15:35 -0800
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Kui-Feng Lee <thinker.li@...il.com>, "D . Wythe"
<alibuda@...ux.alibaba.com>, Dust Li <dust.li@...ux.alibaba.com>,
Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
John Fastabend <john.fastabend@...il.com>,
Sidraya Jayagond <sidraya@...ux.ibm.com>, Wenjia Zhang
<wenjia@...ux.ibm.com>, Mahanta Jambigi <mjambigi@...ux.ibm.com>,
Tony Lu <tonylu@...ux.alibaba.com>, Wen Gu <guwen@...ux.alibaba.com>,
"David S . Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
bpf@...r.kernel.org, linux-rdma@...r.kernel.org, linux-s390@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] net: smc: SMC_HS_CTRL_BPF should depend on BPF_JIT
On 12/4/25 2:29 AM, Geert Uytterhoeven wrote:
> 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: 15f295f55656658e ("net/smc: bpf: Introduce generic hook for handshake flow")
> Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> ---
> net/smc/Kconfig | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/smc/Kconfig b/net/smc/Kconfig
> index 325addf83cc69f6c..277ef504bc26ef89 100644
> --- a/net/smc/Kconfig
> +++ b/net/smc/Kconfig
> @@ -22,10 +22,10 @@ config SMC_DIAG
>
> config SMC_HS_CTRL_BPF
> bool "Generic eBPF hook for SMC handshake flow"
> - depends on SMC && BPF_SYSCALL
> + depends on SMC && BPF_JIT && BPF_SYSCALL
> default y
> help
> SMC_HS_CTRL_BPF enables support to register generic eBPF hook for SMC
> handshake flow, which offer much greater flexibility in modifying the behavior
> of the SMC protocol stack compared to a complete kernel-based approach. Select
> - this option if you want filtring the handshake process via eBPF programs.
> \ No newline at end of file
> + this option if you want filtring the handshake process via eBPF programs.
I have applied patch 2 to the bpf tree. Thanks.
Powered by blists - more mailing lists