@@ -255,6 +255,16 @@ int ibv_cmd_query_device_ex(struct ibv_context *context,
}
}
+ if (attr_size >= offsetof(struct ibv_device_attr_ex, cq_mod_caps) +
+ sizeof(attr->cq_mod_caps)) {
+ if (resp->response_length >=
+ offsetof(struct ibv_query_device_resp_ex, cq_mod_caps) +
+ sizeof(resp->cq_mod_caps)) {
+ attr->cq_mod_caps.max_cq_count = resp->cq_mod_caps.cq_count;
+ attr->cq_mod_caps.max_cq_period = resp->cq_mod_caps.cq_period;
+ }
+ }
+
return 0;
}
@@ -397,6 +397,16 @@ static void print_rss_caps(const struct ibv_rss_caps *caps)
}
}
+static void print_cq_moderation_caps(const struct ibv_cq_moderation_caps *cq_caps)
+{
+ if (!cq_caps->max_cq_count || !cq_caps->max_cq_period)
+ return;
+
+ printf("\n\tcq moderation caps:\n");
+ printf("\t\tmax_cq_count:\t%u\n", cq_caps->max_cq_count);
+ printf("\t\tmax_cq_period:\t%u us\n\n", cq_caps->max_cq_period);
+}
+
static void print_packet_pacing_caps(const struct ibv_packet_pacing_caps *caps)
{
uint32_t unknown_general_caps = ~(1 << IBV_QPT_RAW_PACKET |
@@ -538,6 +548,7 @@ static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port)
printf("\tmax_wq_type_rq:\t\t\t%u\n", device_attr.max_wq_type_rq);
print_packet_pacing_caps(&device_attr.packet_pacing_caps);
print_tm_caps(&device_attr.tm_caps);
+ print_cq_moderation_caps(&device_attr.cq_mod_caps);
}
for (port = 1; port <= device_attr.orig_attr.phys_port_cnt; ++port) {
@@ -289,6 +289,12 @@ struct ibv_tm_caps_resp {
__u32 reserved;
};
+struct ibv_cq_moderation_caps_resp {
+ __u16 cq_count;
+ __u16 cq_period;
+ __u32 reserved;
+};
+
struct ibv_query_device_resp_ex {
struct ibv_query_device_resp base;
__u32 comp_mask;
@@ -301,6 +307,7 @@ struct ibv_query_device_resp_ex {
__u32 max_wq_type_rq;
__u32 raw_packet_caps;
struct ibv_tm_caps_resp tm_caps;
+ struct ibv_cq_moderation_caps_resp cq_mod_caps;
};
struct ibv_query_port {
@@ -34,6 +34,7 @@ uint32_t max_wq_type_rq; /* Max Work Queue from type R
struct ibv_packet_pacing_caps packet_pacing_caps; /* Packet pacing capabilities */
uint32_t raw_packet_caps; /* Raw packet capabilities, use enum ibv_raw_packet_caps */
struct ibv_tm_caps tm_caps; /* Tag matching capabilities */
+struct ibv_cq_moderation_caps cq_mod_caps; /* CQ moderation max capabilities */
.in -8
};
@@ -101,6 +102,11 @@ uint32_t max_sge; /* Max number of SGEs in a tagged buffer */
.in -8
};
+struct ibv_cq_moderation_caps {
+ uint16_t max_cq_count;
+ uint16_t max_cq_period;
+};
+
.fi
.SH "RETURN VALUE"
.B ibv_query_device_ex()
@@ -286,6 +286,11 @@ struct ibv_tm_caps {
uint32_t max_sge;
};
+struct ibv_cq_moderation_caps {
+ uint16_t max_cq_count;
+ uint16_t max_cq_period; /* in micro seconds */
+};
+
struct ibv_device_attr_ex {
struct ibv_device_attr orig_attr;
uint32_t comp_mask;
@@ -299,6 +304,7 @@ struct ibv_device_attr_ex {
struct ibv_packet_pacing_caps packet_pacing_caps;
uint32_t raw_packet_caps; /* Use ibv_raw_packet_caps */
struct ibv_tm_caps tm_caps;
+ struct ibv_cq_moderation_caps cq_mod_caps;
};
enum ibv_mtu {