Re: [PATCH bpf-next v4 2/5] bpf: Add ksock kfuncs

Mahe Tardy <[email protected]>
Newsgroups org.kernel.vger.bpf,org.kernel.vger.netdev
Message-ID <[email protected]>
On Fri, Aug 07, 2026 at 11:08:43AM +0800, Jiayuan Chen wrote:
> 
> On 8/7/26 2:22 AM, Mahe Tardy wrote:
> 
> 
> [...]
> 
> > +	return ret;
> > +}
> > +
> > +__bpf_kfunc_end_defs();
> > +
> > +BTF_KFUNCS_START(ksock_init_kfunc_btf_ids)
> > +BTF_ID_FLAGS(func, bpf_ksock_create, KF_ACQUIRE | KF_RET_NULL | KF_SLEEPABLE)
> > +BTF_ID_FLAGS(func, bpf_ksock_connect, KF_SLEEPABLE)
> > +BTF_KFUNCS_END(ksock_init_kfunc_btf_ids)
> > +
> > +static const struct btf_kfunc_id_set ksock_init_kfunc_set = {
> > +	.owner = THIS_MODULE,
> > +	.set = &ksock_init_kfunc_btf_ids,
> > +};
> > +
> > +BTF_KFUNCS_START(ksock_kfunc_btf_ids)
> > +BTF_ID_FLAGS(func, bpf_ksock_release, KF_RELEASE)
> > +BTF_ID_FLAGS(func, bpf_ksock_acquire, KF_ACQUIRE | KF_RCU | KF_RET_NULL)
> > +BTF_ID_FLAGS(func, bpf_ksock_send, KF_SLEEPABLE)
> > +BTF_KFUNCS_END(ksock_kfunc_btf_ids)
> > +
> > +BTF_ID_LIST_SINGLE(bpf_lsm_socket_sendmsg_id, func, bpf_lsm_socket_sendmsg)
> > +
> 
> 
> I guess bpf_lsm_socket_sendmsg will not be compiled when CONFIG_BPF_LSM is
> disabled
> 

Yes indeed we can guard this with CONFIG_BPF_LSM as it might produce a
warning on building with CONFIG_BPF_LSM disabled. Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.