mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
RDMA/netink: Export lids and sm_lids
According to the IB specification, the LID and SM_LID are 16-bit wide, but to support OmniPath users, export it as 32-bit value from the beginning. Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
This commit is contained in:
parent
12026fbba6
commit
80a06dd36f
2 changed files with 16 additions and 1 deletions
|
@ -45,6 +45,8 @@ static const struct nla_policy nldev_policy[RDMA_NLDEV_ATTR_MAX] = {
|
||||||
[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 },
|
[RDMA_NLDEV_ATTR_SUBNET_PREFIX] = { .type = NLA_U64 },
|
||||||
|
[RDMA_NLDEV_ATTR_LID] = { .type = NLA_U32 },
|
||||||
|
[RDMA_NLDEV_ATTR_SM_LID] = { .type = NLA_U32 },
|
||||||
};
|
};
|
||||||
|
|
||||||
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)
|
||||||
|
@ -102,7 +104,12 @@ static int fill_port_info(struct sk_buff *msg,
|
||||||
nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_SUBNET_PREFIX,
|
nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_SUBNET_PREFIX,
|
||||||
attr.subnet_prefix, 0))
|
attr.subnet_prefix, 0))
|
||||||
return -EMSGSIZE;
|
return -EMSGSIZE;
|
||||||
|
if (rdma_protocol_ib(device, port)) {
|
||||||
|
if (nla_put_u32(msg, RDMA_NLDEV_ATTR_LID, attr.lid))
|
||||||
|
return -EMSGSIZE;
|
||||||
|
if (nla_put_u32(msg, RDMA_NLDEV_ATTR_SM_LID, attr.sm_lid))
|
||||||
|
return -EMSGSIZE;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -284,6 +284,14 @@ enum rdma_nldev_attr {
|
||||||
*/
|
*/
|
||||||
RDMA_NLDEV_ATTR_SUBNET_PREFIX, /* u64 */
|
RDMA_NLDEV_ATTR_SUBNET_PREFIX, /* u64 */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local Identifier (LID),
|
||||||
|
* According to IB specification, It is 16-bit address assigned
|
||||||
|
* by the Subnet Manager. Extended to be 32-bit for OmniPath users.
|
||||||
|
*/
|
||||||
|
RDMA_NLDEV_ATTR_LID, /* u32 */
|
||||||
|
RDMA_NLDEV_ATTR_SM_LID, /* u32 */
|
||||||
|
|
||||||
RDMA_NLDEV_ATTR_MAX
|
RDMA_NLDEV_ATTR_MAX
|
||||||
};
|
};
|
||||||
#endif /* _UAPI_RDMA_NETLINK_H */
|
#endif /* _UAPI_RDMA_NETLINK_H */
|
||||||
|
|
Loading…
Reference in a new issue