Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2018-11-08 15:24:18 +0100
committerThomas Bogendoerfer <tbogendoerfer@suse.de>2018-11-09 12:10:45 +0100
commitc1be22ac9507f972be714b1c1ebc41459e4efb65 (patch)
tree220ba57e14a41998baf31354549493b94c1232f4
parent4e65fd88c87233e849e369f0913f88faf44c27a8 (diff)
IB/uverbs: Add device memory capabilities reporting (bsc#1103992
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c6
-rw-r--r--include/rdma/ib_verbs.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 43da6f9eb1cc..b17592276394 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -4060,6 +4060,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;
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 79a5deda112f..02e2dc219284 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -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 {