Skip to content

Commit 1d8eeb9

Browse files
Awik84jgunthorpe
authored andcommitted
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 <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent d41c120 commit 1d8eeb9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

drivers/infiniband/core/uverbs_cmd.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4006,6 +4006,12 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
40064006
resp.cq_moderation_caps.max_cq_moderation_period =
40074007
attr.cq_caps.max_cq_moderation_period;
40084008
resp.response_length += sizeof(resp.cq_moderation_caps);
4009+
4010+
if (ucore->outlen < resp.response_length + sizeof(resp.max_dm_size))
4011+
goto end;
4012+
4013+
resp.max_dm_size = attr.max_dm_size;
4014+
resp.response_length += sizeof(resp.max_dm_size);
40094015
end:
40104016
err = ib_copy_to_udata(ucore, &resp, resp.response_length);
40114017
return err;

include/rdma/ib_verbs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ struct ib_device_attr {
372372
u32 raw_packet_caps; /* Use ib_raw_packet_caps enum */
373373
struct ib_tm_caps tm_caps;
374374
struct ib_cq_caps cq_caps;
375+
u64 max_dm_size;
375376
};
376377

377378
enum ib_mtu {

0 commit comments

Comments
 (0)