On 26-Feb-19 21:20, Leon Romanovsky wrote: > On Thu, Feb 21, 2019 at 05:33:03PM +0200, Gal Pressman wrote: >> Add EFA node, transport and protocol types to core code. >> In addition, EFA driver ID is added to the IOCTL interface uapi. >> >> Signed-off-by: Gal Pressman <galpress@xxxxxxxxxx> >> --- >> drivers/infiniband/core/sysfs.c | 1 + >> drivers/infiniband/core/verbs.c | 2 ++ >> include/rdma/ib_verbs.h | 8 ++++++-- >> include/uapi/rdma/rdma_user_ioctl_cmds.h | 1 + >> 4 files changed, 10 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c >> index 9b6a065bdfa5..f7fac4c81559 100644 >> --- a/drivers/infiniband/core/sysfs.c >> +++ b/drivers/infiniband/core/sysfs.c >> @@ -1194,6 +1194,7 @@ static ssize_t node_type_show(struct device *device, >> 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_EFA: return sprintf(buf, "%d: EFA\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 5a5e83f5f0fc..fc6f748a1933 100644 >> --- a/drivers/infiniband/core/verbs.c >> +++ b/drivers/infiniband/core/verbs.c >> @@ -218,6 +218,8 @@ rdma_node_get_transport(enum rdma_node_type node_type) >> return RDMA_TRANSPORT_USNIC_UDP; >> if (node_type == RDMA_NODE_RNIC) >> return RDMA_TRANSPORT_IWARP; >> + if (node_type == RDMA_NODE_EFA) >> + return RDMA_TRANSPORT_EFA; >> >> return RDMA_TRANSPORT_IB; >> } >> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h >> index 225cb76d469f..55534aba22bf 100644 >> --- a/include/rdma/ib_verbs.h >> +++ b/include/rdma/ib_verbs.h >> @@ -108,6 +108,7 @@ enum rdma_node_type { >> RDMA_NODE_RNIC, >> RDMA_NODE_USNIC, >> RDMA_NODE_USNIC_UDP, >> + RDMA_NODE_EFA, >> }; >> >> enum { >> @@ -119,14 +120,16 @@ enum rdma_transport_type { >> RDMA_TRANSPORT_IB, >> RDMA_TRANSPORT_IWARP, >> RDMA_TRANSPORT_USNIC, >> - RDMA_TRANSPORT_USNIC_UDP >> + RDMA_TRANSPORT_USNIC_UDP, >> + RDMA_TRANSPORT_EFA, >> }; >> >> enum rdma_protocol_type { >> RDMA_PROTOCOL_IB, >> RDMA_PROTOCOL_IBOE, >> RDMA_PROTOCOL_IWARP, >> - RDMA_PROTOCOL_USNIC_UDP >> + RDMA_PROTOCOL_USNIC_UDP, >> + RDMA_PROTOCOL_EFA, >> }; > > Everything above is backed by specification. I disagree that we need > to declare new transport, protocol and node every time some large company > decides to reinvent the wheel. Especially if this company refuses > provide specification grade documentation. EFA is not an IB_CA node/IB transport/IB protocol. We have two options: 1. Add EFA definitions 2. Add 'unspecified' definitions Both will not be backed up by the spec, at least with option #1 we'll have more information than an ambiguous unspecified.