summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorAriel Levkovich2018-04-05 17:53:23 +0200
committerJason Gunthorpe2018-04-05 19:16:39 +0200
commit1d8eeb9f6a6e0d8ac43a54fd95126044bf8d6695 (patch)
tree4b26e7293fb75f6c1b1e19a7fd54198e4d687816 /drivers/infiniband/core
parentIB/uverbs: Expose device memory capabilities to user (diff)
downloadkernel-qcow2-linux-1d8eeb9f6a6e0d8ac43a54fd95126044bf8d6695.tar.gz
kernel-qcow2-linux-1d8eeb9f6a6e0d8ac43a54fd95126044bf8d6695.tar.xz
kernel-qcow2-linux-1d8eeb9f6a6e0d8ac43a54fd95126044bf8d6695.zip
IB/uverbs: Add device memory capabilities reporting
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>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index f38600490fd1..13cb5e4deb86 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -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;