summaryrefslogtreecommitdiff
path: root/net/smc/smc_hs_bpf.h
blob: f5f1807c079e843efde7792c6dc42f2415201ac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* SPDX-License-Identifier: GPL-2.0 */
/*
 *  Shared Memory Communications over RDMA (SMC-R) and RoCE
 *
 *  Generic hook for SMC handshake flow.
 *
 *  Copyright IBM Corp. 2016
 *  Copyright (c) 2025, Alibaba Inc.
 *
 *  Author: D. Wythe <alibuda@linux.alibaba.com>
 */

#ifndef __SMC_HS_CTRL
#define __SMC_HS_CTRL

#include <net/smc.h>

/* Find hs_ctrl by the target name, which required to be a c-string.
 * Return NULL if no such ctrl was found,otherwise, return a valid ctrl.
 *
 * Note: Caller MUST ensure it's was invoked under rcu_read_lock.
 */
struct smc_hs_ctrl *smc_hs_ctrl_find_by_name(const char *name);

#if IS_ENABLED(CONFIG_SMC_HS_CTRL_BPF)
int bpf_smc_hs_ctrl_init(void);
#else
static inline int bpf_smc_hs_ctrl_init(void) { return 0; }
#endif /* CONFIG_SMC_HS_CTRL_BPF */

#endif /* __SMC_HS_CTRL */