RDMA/netlink: Export LID mask control (LMC)
authorLeon Romanovsky <leonro@mellanox.com>
Wed, 28 Jun 2017 12:49:30 +0000 (15:49 +0300)
committerLeon Romanovsky <leon@kernel.org>
Thu, 10 Aug 2017 10:28:13 +0000 (13:28 +0300)
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/core/nldev.c
include/uapi/rdma/rdma_netlink.h

index 16f1d28bea690c15ff562dcef6d48c115f3966ce..11546f87c5dc58947f7e73d7365e06bd880a0a53 100644 (file)
@@ -47,6 +47,7 @@ static const struct nla_policy nldev_policy[RDMA_NLDEV_ATTR_MAX] = {
        [RDMA_NLDEV_ATTR_SUBNET_PREFIX] = { .type = NLA_U64 },
        [RDMA_NLDEV_ATTR_LID]           = { .type = NLA_U32 },
        [RDMA_NLDEV_ATTR_SM_LID]        = { .type = NLA_U32 },
+       [RDMA_NLDEV_ATTR_LMC]           = { .type = NLA_U8 },
 };
 
 static int fill_dev_info(struct sk_buff *msg, struct ib_device *device)
@@ -109,6 +110,8 @@ static int fill_port_info(struct sk_buff *msg,
                        return -EMSGSIZE;
                if (nla_put_u32(msg, RDMA_NLDEV_ATTR_SM_LID, attr.sm_lid))
                        return -EMSGSIZE;
+               if (nla_put_u8(msg, RDMA_NLDEV_ATTR_LMC, attr.lmc))
+                       return -EMSGSIZE;
        }
        return 0;
 }
index 7d5caaf541262f3abee0f8a04b65bc583a1f52c4..035706e6b016e820756ff8c5a7922bbd1d9b8af8 100644 (file)
@@ -292,6 +292,11 @@ enum rdma_nldev_attr {
        RDMA_NLDEV_ATTR_LID,                    /* u32 */
        RDMA_NLDEV_ATTR_SM_LID,                 /* u32 */
 
+       /*
+        * LID mask control (LMC)
+        */
+       RDMA_NLDEV_ATTR_LMC,                    /* u8 */
+
        RDMA_NLDEV_ATTR_MAX
 };
 #endif /* _UAPI_RDMA_NETLINK_H */