Commit 5654e49d authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Leon Romanovsky

RDMA/netlink: Provide port state and physical link state

Add port state and physical link state to the users of RDMA netlink.
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent 34840fea
...@@ -48,6 +48,8 @@ static const struct nla_policy nldev_policy[RDMA_NLDEV_ATTR_MAX] = { ...@@ -48,6 +48,8 @@ static const struct nla_policy nldev_policy[RDMA_NLDEV_ATTR_MAX] = {
[RDMA_NLDEV_ATTR_LID] = { .type = NLA_U32 }, [RDMA_NLDEV_ATTR_LID] = { .type = NLA_U32 },
[RDMA_NLDEV_ATTR_SM_LID] = { .type = NLA_U32 }, [RDMA_NLDEV_ATTR_SM_LID] = { .type = NLA_U32 },
[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_PHYS_STATE] = { .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)
...@@ -113,6 +115,10 @@ static int fill_port_info(struct sk_buff *msg, ...@@ -113,6 +115,10 @@ static int fill_port_info(struct sk_buff *msg,
if (nla_put_u8(msg, RDMA_NLDEV_ATTR_LMC, attr.lmc)) if (nla_put_u8(msg, RDMA_NLDEV_ATTR_LMC, attr.lmc))
return -EMSGSIZE; return -EMSGSIZE;
} }
if (nla_put_u8(msg, RDMA_NLDEV_ATTR_PORT_STATE, attr.state))
return -EMSGSIZE;
if (nla_put_u8(msg, RDMA_NLDEV_ATTR_PORT_PHYS_STATE, attr.phys_state))
return -EMSGSIZE;
return 0; return 0;
} }
......
...@@ -297,6 +297,9 @@ enum rdma_nldev_attr { ...@@ -297,6 +297,9 @@ enum rdma_nldev_attr {
*/ */
RDMA_NLDEV_ATTR_LMC, /* u8 */ RDMA_NLDEV_ATTR_LMC, /* u8 */
RDMA_NLDEV_ATTR_PORT_STATE, /* u8 */
RDMA_NLDEV_ATTR_PORT_PHYS_STATE, /* u8 */
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