@@ -3861,6 +3861,14 @@ 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_counter_sets) + sizeof(resp.reserved))
+ goto end;
+
+ resp.max_counter_sets = attr.max_counter_sets;
+ resp.response_length += sizeof(resp.max_counter_sets) +
+ sizeof(resp.reserved);
end:
err = ib_copy_to_udata(ucore, &resp, resp.response_length);
return err;
@@ -270,6 +270,8 @@ struct ib_uverbs_ex_query_device_resp {
__u32 raw_packet_caps;
struct ib_uverbs_tm_caps tm_caps;
struct ib_uverbs_cq_caps cq_moderation_caps;
+ __u16 max_counter_sets;
+ __u8 reserved[6];
};
struct ib_uverbs_query_port {