summaryrefslogtreecommitdiffstats
path: root/net/smc/smc_pnet.h
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.vnet.ibm.com>2017-01-09 16:55:15 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-09 16:07:38 -0500
commit6812baabf24d5c299c13223366a23c269408f4d0 (patch)
treec491c997ee9f5f10cb538c669d05168132c6644a /net/smc/smc_pnet.h
parenta4cf0443c4143b19e42389a1674b5b65224544ce (diff)
downloadlinux-6812baabf24d5c299c13223366a23c269408f4d0.tar.gz
linux-6812baabf24d5c299c13223366a23c269408f4d0.tar.bz2
linux-6812baabf24d5c299c13223366a23c269408f4d0.zip
smc: establish pnet table management
Connection creation with SMC-R starts through an internal TCP-connection. The Ethernet interface for this TCP-connection is not restricted to the Ethernet interface of a RoCE device. Any existing Ethernet interface belonging to the same physical net can be used, as long as there is a defined relation between the Ethernet interface and some RoCE devices. This relation is defined with the help of an identification string called "Physical Net ID" or short "pnet ID". Information about defined pnet IDs and their related Ethernet interfaces and RoCE devices is stored in the SMC-R pnet table. A pnet table entry consists of the identifying pnet ID and the associated network and IB device. This patch adds pnet table configuration support using the generic netlink message interface referring to network and IB device by their names. Commands exist to add, delete, and display pnet table entries, and to flush or display the entire pnet table. There are cross-checks to verify whether the ethernet interfaces or infiniband devices really exist in the system. If either device is not available, the pnet ID entry is not created. Loss of network devices and IB devices is also monitored; a pnet ID entry is removed when an associated network or IB device is removed. Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com> Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_pnet.h')
-rw-r--r--net/smc/smc_pnet.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/net/smc/smc_pnet.h b/net/smc/smc_pnet.h
new file mode 100644
index 000000000000..32ab3df928ca
--- /dev/null
+++ b/net/smc/smc_pnet.h
@@ -0,0 +1,23 @@
+/*
+ * Shared Memory Communications over RDMA (SMC-R) and RoCE
+ *
+ * PNET table queries
+ *
+ * Copyright IBM Corp. 2016
+ *
+ * Author(s): Thomas Richter <tmricht@linux.vnet.ibm.com>
+ */
+
+#ifndef _SMC_PNET_H
+#define _SMC_PNET_H
+
+struct smc_ib_device;
+
+int smc_pnet_init(void) __init;
+void smc_pnet_exit(void);
+int smc_pnet_remove_by_ibdev(struct smc_ib_device *ibdev);
+struct smc_ib_device *smc_pnet_find_ib(char *ib_name);
+void smc_pnet_find_roce_resource(struct sock *sk,
+ struct smc_ib_device **smcibdev, u8 *ibport);
+
+#endif