]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
IB/uverbs: Add device memory capabilities reporting
authorAriel Levkovich <lariel@mellanox.com>
Thu, 5 Apr 2018 15:53:23 +0000 (18:53 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 5 Apr 2018 17:16:39 +0000 (11:16 -0600)
This change allows vendors to report device memory capability
max_dm_size - to user via uverbs command.

Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/uverbs_cmd.c
include/rdma/ib_verbs.h

index f38600490fd166b30435d47c269775af9c6d3f76..13cb5e4deb8664568cf535183be3c85f56238953 100644 (file)
@@ -4006,6 +4006,12 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
        resp.cq_moderation_caps.max_cq_moderation_period =
                attr.cq_caps.max_cq_moderation_period;
        resp.response_length += sizeof(resp.cq_moderation_caps);
+
+       if (ucore->outlen < resp.response_length + sizeof(resp.max_dm_size))
+               goto end;
+
+       resp.max_dm_size = attr.max_dm_size;
+       resp.response_length += sizeof(resp.max_dm_size);
 end:
        err = ib_copy_to_udata(ucore, &resp, resp.response_length);
        return err;
index a6dba77c1b28cf903a453aee2d2b873e3efd51da..ed425627efd8812c76cd965907d5d24561b1d994 100644 (file)
@@ -372,6 +372,7 @@ struct ib_device_attr {
        u32                     raw_packet_caps; /* Use ib_raw_packet_caps enum */
        struct ib_tm_caps       tm_caps;
        struct ib_cq_caps       cq_caps;
+       u64                     max_dm_size;
 };
 
 enum ib_mtu {