Commit 12026fbb authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Leon Romanovsky

RDMA/netlink: Advertise IB subnet prefix

Add IB subnet prefix to the port properties exported
by RDMA netlink.
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent 1aaff896
...@@ -44,6 +44,7 @@ static const struct nla_policy nldev_policy[RDMA_NLDEV_ATTR_MAX] = { ...@@ -44,6 +44,7 @@ static const struct nla_policy nldev_policy[RDMA_NLDEV_ATTR_MAX] = {
.len = IB_FW_VERSION_NAME_MAX - 1}, .len = IB_FW_VERSION_NAME_MAX - 1},
[RDMA_NLDEV_ATTR_NODE_GUID] = { .type = NLA_U64 }, [RDMA_NLDEV_ATTR_NODE_GUID] = { .type = NLA_U64 },
[RDMA_NLDEV_ATTR_SYS_IMAGE_GUID] = { .type = NLA_U64 }, [RDMA_NLDEV_ATTR_SYS_IMAGE_GUID] = { .type = NLA_U64 },
[RDMA_NLDEV_ATTR_SUBNET_PREFIX] = { .type = NLA_U64 },
}; };
static int fill_dev_info(struct sk_buff *msg, struct ib_device *device) static int fill_dev_info(struct sk_buff *msg, struct ib_device *device)
...@@ -97,6 +98,10 @@ static int fill_port_info(struct sk_buff *msg, ...@@ -97,6 +98,10 @@ static int fill_port_info(struct sk_buff *msg,
if (nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_CAP_FLAGS, if (nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_CAP_FLAGS,
(u64)attr.port_cap_flags, 0)) (u64)attr.port_cap_flags, 0))
return -EMSGSIZE; return -EMSGSIZE;
if (rdma_protocol_ib(device, port) &&
nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_SUBNET_PREFIX,
attr.subnet_prefix, 0))
return -EMSGSIZE;
return 0; return 0;
} }
......
...@@ -279,6 +279,11 @@ enum rdma_nldev_attr { ...@@ -279,6 +279,11 @@ enum rdma_nldev_attr {
*/ */
RDMA_NLDEV_ATTR_SYS_IMAGE_GUID, /* u64 */ RDMA_NLDEV_ATTR_SYS_IMAGE_GUID, /* u64 */
/*
* Subnet prefix (in host byte order)
*/
RDMA_NLDEV_ATTR_SUBNET_PREFIX, /* u64 */
RDMA_NLDEV_ATTR_MAX RDMA_NLDEV_ATTR_MAX
}; };
#endif /* _UAPI_RDMA_NETLINK_H */ #endif /* _UAPI_RDMA_NETLINK_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment