xref: /linux/net/smc/smc_hs_bpf.h (revision 24f171c7e145f43b9f187578e89b0982ce87e54c)
1*15f295f5SD. Wythe /* SPDX-License-Identifier: GPL-2.0 */
2*15f295f5SD. Wythe /*
3*15f295f5SD. Wythe  *  Shared Memory Communications over RDMA (SMC-R) and RoCE
4*15f295f5SD. Wythe  *
5*15f295f5SD. Wythe  *  Generic hook for SMC handshake flow.
6*15f295f5SD. Wythe  *
7*15f295f5SD. Wythe  *  Copyright IBM Corp. 2016
8*15f295f5SD. Wythe  *  Copyright (c) 2025, Alibaba Inc.
9*15f295f5SD. Wythe  *
10*15f295f5SD. Wythe  *  Author: D. Wythe <alibuda@linux.alibaba.com>
11*15f295f5SD. Wythe  */
12*15f295f5SD. Wythe 
13*15f295f5SD. Wythe #ifndef __SMC_HS_CTRL
14*15f295f5SD. Wythe #define __SMC_HS_CTRL
15*15f295f5SD. Wythe 
16*15f295f5SD. Wythe #include <net/smc.h>
17*15f295f5SD. Wythe 
18*15f295f5SD. Wythe /* Find hs_ctrl by the target name, which required to be a c-string.
19*15f295f5SD. Wythe  * Return NULL if no such ctrl was found,otherwise, return a valid ctrl.
20*15f295f5SD. Wythe  *
21*15f295f5SD. Wythe  * Note: Caller MUST ensure it's was invoked under rcu_read_lock.
22*15f295f5SD. Wythe  */
23*15f295f5SD. Wythe struct smc_hs_ctrl *smc_hs_ctrl_find_by_name(const char *name);
24*15f295f5SD. Wythe 
25*15f295f5SD. Wythe #if IS_ENABLED(CONFIG_SMC_HS_CTRL_BPF)
26*15f295f5SD. Wythe int bpf_smc_hs_ctrl_init(void);
27*15f295f5SD. Wythe #else
28*15f295f5SD. Wythe static inline int bpf_smc_hs_ctrl_init(void) { return 0; }
29*15f295f5SD. Wythe #endif /* CONFIG_SMC_HS_CTRL_BPF */
30*15f295f5SD. Wythe 
31*15f295f5SD. Wythe #endif /* __SMC_HS_CTRL */
32