mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
RDMA/netlink: Export node_type
Add ability to get node_type for RDAM netlink users. Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
This commit is contained in:
parent
5654e49db0
commit
1bb77b8c1d
2 changed files with 5 additions and 0 deletions
|
@ -50,6 +50,7 @@ static const struct nla_policy nldev_policy[RDMA_NLDEV_ATTR_MAX] = {
|
||||||
[RDMA_NLDEV_ATTR_LMC] = { .type = NLA_U8 },
|
[RDMA_NLDEV_ATTR_LMC] = { .type = NLA_U8 },
|
||||||
[RDMA_NLDEV_ATTR_PORT_STATE] = { .type = NLA_U8 },
|
[RDMA_NLDEV_ATTR_PORT_STATE] = { .type = NLA_U8 },
|
||||||
[RDMA_NLDEV_ATTR_PORT_PHYS_STATE] = { .type = NLA_U8 },
|
[RDMA_NLDEV_ATTR_PORT_PHYS_STATE] = { .type = NLA_U8 },
|
||||||
|
[RDMA_NLDEV_ATTR_DEV_NODE_TYPE] = { .type = NLA_U8 },
|
||||||
};
|
};
|
||||||
|
|
||||||
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)
|
||||||
|
@ -79,6 +80,8 @@ static int fill_dev_info(struct sk_buff *msg, struct ib_device *device)
|
||||||
if (nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_SYS_IMAGE_GUID,
|
if (nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_SYS_IMAGE_GUID,
|
||||||
be64_to_cpu(device->attrs.sys_image_guid), 0))
|
be64_to_cpu(device->attrs.sys_image_guid), 0))
|
||||||
return -EMSGSIZE;
|
return -EMSGSIZE;
|
||||||
|
if (nla_put_u8(msg, RDMA_NLDEV_ATTR_DEV_NODE_TYPE, device->node_type))
|
||||||
|
return -EMSGSIZE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -300,6 +300,8 @@ enum rdma_nldev_attr {
|
||||||
RDMA_NLDEV_ATTR_PORT_STATE, /* u8 */
|
RDMA_NLDEV_ATTR_PORT_STATE, /* u8 */
|
||||||
RDMA_NLDEV_ATTR_PORT_PHYS_STATE, /* u8 */
|
RDMA_NLDEV_ATTR_PORT_PHYS_STATE, /* u8 */
|
||||||
|
|
||||||
|
RDMA_NLDEV_ATTR_DEV_NODE_TYPE, /* u8 */
|
||||||
|
|
||||||
RDMA_NLDEV_ATTR_MAX
|
RDMA_NLDEV_ATTR_MAX
|
||||||
};
|
};
|
||||||
#endif /* _UAPI_RDMA_NETLINK_H */
|
#endif /* _UAPI_RDMA_NETLINK_H */
|
||||||
|
|
Loading…
Reference in a new issue