Commit 1d8eeb9f authored by Ariel Levkovich's avatar Ariel Levkovich Committed by Jason Gunthorpe

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: default avatarAriel Levkovich <lariel@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent d41c1208
...@@ -4006,6 +4006,12 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file, ...@@ -4006,6 +4006,12 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
resp.cq_moderation_caps.max_cq_moderation_period = resp.cq_moderation_caps.max_cq_moderation_period =
attr.cq_caps.max_cq_moderation_period; attr.cq_caps.max_cq_moderation_period;
resp.response_length += sizeof(resp.cq_moderation_caps); 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: end:
err = ib_copy_to_udata(ucore, &resp, resp.response_length); err = ib_copy_to_udata(ucore, &resp, resp.response_length);
return err; return err;
......
...@@ -372,6 +372,7 @@ struct ib_device_attr { ...@@ -372,6 +372,7 @@ struct ib_device_attr {
u32 raw_packet_caps; /* Use ib_raw_packet_caps enum */ u32 raw_packet_caps; /* Use ib_raw_packet_caps enum */
struct ib_tm_caps tm_caps; struct ib_tm_caps tm_caps;
struct ib_cq_caps cq_caps; struct ib_cq_caps cq_caps;
u64 max_dm_size;
}; };
enum ib_mtu { enum ib_mtu {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment