[rdma-next 07/22] RDMA/core: Remove unimplemented node_types and node transport

Leon Romanovsky
2017-08-11T10:49:48Z

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

There is no need to carry code, which is not implemented in any
underlying hardware. This patch removes unimplemented node_types and
their respective node transport layers.

Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/core/sysfs.c | 3 ---
drivers/infiniband/core/verbs.c | 5 -----
include/rdma/ib_verbs.h | 16 ++++++----------
3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index abc5ab581f82..c43280f8d5b3 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -1146,10 +1146,7 @@ static ssize_t show_node_type(struct device *device,
switch (dev->node_type) {
case RDMA_NODE_IB_CA: return sprintf(buf, "%d: CA\n", dev->node_type);
case RDMA_NODE_RNIC: return sprintf(buf, "%d: RNIC\n", dev->node_type);
- case RDMA_NODE_USNIC: return sprintf(buf, "%d: usNIC\n", dev->node_type);
case RDMA_NODE_USNIC_UDP: return sprintf(buf, "%d: usNIC UDP\n", dev->node_type);
- case RDMA_NODE_IB_SWITCH: return sprintf(buf, "%d: switch\n", dev->node_type);
- case RDMA_NODE_IB_ROUTER: return sprintf(buf, "%d: router\n", dev->node_type);
default: return sprintf(buf, "%d: <unknown>\n", dev->node_type);
}
}
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 3d1de62de839..21fef6b6d4f3 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -182,13 +182,9 @@ rdma_node_get_transport(enum rdma_node_type node_type)
{
switch (node_type) {
case RDMA_NODE_IB_CA:
- case RDMA_NODE_IB_SWITCH:
- case RDMA_NODE_IB_ROUTER:
return RDMA_TRANSPORT_IB;
case RDMA_NODE_RNIC:
return RDMA_TRANSPORT_IWARP;
- case RDMA_NODE_USNIC:
- return RDMA_TRANSPORT_USNIC;
case RDMA_NODE_USNIC_UDP:
return RDMA_TRANSPORT_USNIC_UDP;
default:
@@ -207,7 +203,6 @@ enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_
case RDMA_TRANSPORT_IB:
return IB_LINK_LAYER_INFINIBAND;
case RDMA_TRANSPORT_IWARP:
- case RDMA_TRANSPORT_USNIC:
case RDMA_TRANSPORT_USNIC_UDP:
return IB_LINK_LAYER_ETHERNET;
default:
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 6cd2b91b8fc8..7aabec3a8a19 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -95,12 +95,9 @@ struct ib_gid_attr {

enum rdma_node_type {
/* IB values map to NodeInfo:NodeType. */
- RDMA_NODE_IB_CA = 1,
- RDMA_NODE_IB_SWITCH,
- RDMA_NODE_IB_ROUTER,
- RDMA_NODE_RNIC,
- RDMA_NODE_USNIC,
- RDMA_NODE_USNIC_UDP,
+ RDMA_NODE_IB_CA = 1,
+ RDMA_NODE_RNIC = 4,
+ RDMA_NODE_USNIC_UDP = 6,
};

enum {
@@ -109,10 +106,9 @@ enum {
};

enum rdma_transport_type {
- RDMA_TRANSPORT_IB,
- RDMA_TRANSPORT_IWARP,
- RDMA_TRANSPORT_USNIC,
- RDMA_TRANSPORT_USNIC_UDP
+ RDMA_TRANSPORT_IB = 0,
+ RDMA_TRANSPORT_IWARP = 1,
+ RDMA_TRANSPORT_USNIC_UDP = 3,
};

enum rdma_protocol_type {