BPF List
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Kui-Feng Lee <thinker.li@gmail.com>,
	"D . Wythe" <alibuda@linux.alibaba.com>,
	Dust Li <dust.li@linux.alibaba.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	John Fastabend <john.fastabend@gmail.com>,
	Sidraya Jayagond <sidraya@linux.ibm.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Mahanta Jambigi <mjambigi@linux.ibm.com>,
	Tony Lu <tonylu@linux.alibaba.com>,
	Wen Gu <guwen@linux.alibaba.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	bpf@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-s390@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] net: smc: SMC_HS_CTRL_BPF should depend on BPF_JIT
Date: Thu, 4 Dec 2025 11:15:35 -0800	[thread overview]
Message-ID: <33750d4d-a451-40e7-8642-5c3a3b5e001c@linux.dev> (raw)
In-Reply-To: <988c61e5fea280872d81b3640f1f34d0619cfbbf.1764843951.git.geert@linux-m68k.org>

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@linux-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.


      reply	other threads:[~2025-12-04 19:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1764843951.git.geert@linux-m68k.org>
2025-12-04 10:29 ` [PATCH 1/2] bpf: Fix register_bpf_struct_ops() dummy Geert Uytterhoeven
2025-12-04 18:18   ` Martin KaFai Lau
2025-12-04 10:29 ` [PATCH 2/2] net: smc: SMC_HS_CTRL_BPF should depend on BPF_JIT Geert Uytterhoeven
2025-12-04 19:15   ` Martin KaFai Lau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33750d4d-a451-40e7-8642-5c3a3b5e001c@linux.dev \
    --to=martin.lau@linux.dev \
    --cc=alibuda@linux.alibaba.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=edumazet@google.com \
    --cc=geert@linux-m68k.org \
    --cc=guwen@linux.alibaba.com \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjambigi@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sidraya@linux.ibm.com \
    --cc=thinker.li@gmail.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=wenjia@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox