Skip to content

Commit

Permalink
RDMA: Move rdma_node_type to uapi/
Browse files Browse the repository at this point in the history
This enum is exposed over the sysfs file 'node_type' and over netlink via
RDMA_NLDEV_ATTR_DEV_NODE_TYPE, so declare it in the uapi headers.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Jason Gunthorpe authored and Doug Ledford committed Jun 17, 2019
1 parent 2d3c72e commit 5d60c11
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ __attribute_const__ int ib_rate_to_mbps(enum ib_rate rate)
EXPORT_SYMBOL(ib_rate_to_mbps);

__attribute_const__ enum rdma_transport_type
rdma_node_get_transport(enum rdma_node_type node_type)
rdma_node_get_transport(unsigned int node_type)
{

if (node_type == RDMA_NODE_USNIC)
Expand Down
13 changes: 1 addition & 12 deletions include/rdma/ib_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,6 @@ struct ib_gid_attr {
u8 port_num;
};

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_UNSPECIFIED,
};

enum {
/* set the local administered indication */
IB_SA_WELL_KNOWN_GUID = BIT_ULL(57) | 2,
Expand All @@ -164,7 +153,7 @@ enum rdma_protocol_type {
};

__attribute_const__ enum rdma_transport_type
rdma_node_get_transport(enum rdma_node_type node_type);
rdma_node_get_transport(unsigned int node_type);

enum rdma_network_type {
RDMA_NETWORK_IB,
Expand Down
12 changes: 12 additions & 0 deletions include/uapi/rdma/rdma_netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ enum {
IWPM_NLA_HELLO_MAX
};

/* For RDMA_NLDEV_ATTR_DEV_NODE_TYPE */
enum {
/* 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_UNSPECIFIED,
};

/*
* Local service operations:
* RESOLVE - The client requests the local service to resolve a path.
Expand Down

0 comments on commit 5d60c11

Please sign in to comment.