]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - net/smc/smc_pnet.h
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[mirror_ubuntu-jammy-kernel.git] / net / smc / smc_pnet.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
6812baab
TR
2/*
3 * Shared Memory Communications over RDMA (SMC-R) and RoCE
4 *
5 * PNET table queries
6 *
7 * Copyright IBM Corp. 2016
8 *
9 * Author(s): Thomas Richter <tmricht@linux.vnet.ibm.com>
10 */
11
12#ifndef _SMC_PNET_H
13#define _SMC_PNET_H
14
0afff91c
UB
15#if IS_ENABLED(CONFIG_HAVE_PNETID)
16#include <asm/pnet.h>
17#endif
18
6812baab 19struct smc_ib_device;
1619f770 20struct smcd_dev;
bc36d2fc 21struct smc_init_info;
6c868a3e 22struct smc_link_group;
6812baab 23
64e28b52
HW
24/**
25 * struct smc_pnettable - SMC PNET table anchor
26 * @lock: Lock for list action
27 * @pnetlist: List of PNETIDs
28 */
29struct smc_pnettable {
30 rwlock_t lock;
31 struct list_head pnetlist;
32};
33
0afff91c
UB
34static inline int smc_pnetid_by_dev_port(struct device *dev,
35 unsigned short port, u8 *pnetid)
36{
37#if IS_ENABLED(CONFIG_HAVE_PNETID)
38 return pnet_id_by_dev_port(dev, port, pnetid);
39#else
40 return -ENOENT;
41#endif
42}
43
6812baab 44int smc_pnet_init(void) __init;
64e28b52 45int smc_pnet_net_init(struct net *net);
6812baab 46void smc_pnet_exit(void);
64e28b52 47void smc_pnet_net_exit(struct net *net);
bc36d2fc
KG
48void smc_pnet_find_roce_resource(struct sock *sk, struct smc_init_info *ini);
49void smc_pnet_find_ism_resource(struct sock *sk, struct smc_init_info *ini);
fdff704d
KG
50int smc_pnetid_by_table_ib(struct smc_ib_device *smcibdev, u8 ib_port);
51int smc_pnetid_by_table_smcd(struct smcd_dev *smcd);
6c868a3e
KG
52void smc_pnet_find_alt_roce(struct smc_link_group *lgr,
53 struct smc_init_info *ini,
54 struct smc_ib_device *known_dev);
6812baab 55#endif