Loading...
Note: File does not exist in v3.5.6.
1/* SPDX-License-Identifier: GPL-2.0 */
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
15#if IS_ENABLED(CONFIG_HAVE_PNETID)
16#include <asm/pnet.h>
17#endif
18
19struct smc_ib_device;
20struct smcd_dev;
21struct smc_init_info;
22struct smc_link_group;
23
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
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
44int smc_pnet_init(void) __init;
45int smc_pnet_net_init(struct net *net);
46void smc_pnet_exit(void);
47void smc_pnet_net_exit(struct net *net);
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);
50int smc_pnetid_by_table_ib(struct smc_ib_device *smcibdev, u8 ib_port);
51int smc_pnetid_by_table_smcd(struct smcd_dev *smcd);
52void smc_pnet_find_alt_roce(struct smc_link_group *lgr,
53 struct smc_init_info *ini,
54 struct smc_ib_device *known_dev);
55#endif