@@ -48,6 +48,7 @@ enum mlx5dv_context_flags {
MLX5DV_CONTEXT_FLAGS_OBSOLETE = (1 << 1), /* Obsoleted, don't use */
MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED = (1 << 2), /* Multi packet WQE is allowed */
MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW = (1 << 3), /* Enhanced multi packet WQE is supported or not */
+ MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP = (1 << 4), /* Support CQE 128B compression */
.in -8
};
@@ -279,6 +279,10 @@ enum mlx5_mpw_caps {
MLX5_SUPPORT_EMPW = 1 << 2,
};
+enum mlx5_query_dev_resp_flags {
+ MLX5_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP = 1 << 0,
+};
+
struct mlx5_query_device_ex_resp {
struct ibv_query_device_resp_ex ibv_resp;
__u32 comp_mask;
@@ -288,7 +292,7 @@ struct mlx5_query_device_ex_resp {
struct mlx5dv_cqe_comp_caps cqe_comp_caps;
struct mlx5_packet_pacing_caps packet_pacing_caps;
__u32 support_multi_pkt_send_wqe;
- __u32 reserved;
+ __u32 flags; /* Use enum mlx5_query_dev_resp_flags */
struct mlx5dv_sw_parsing_caps sw_parsing_caps;
};
@@ -622,6 +622,9 @@ int mlx5dv_query_device(struct ibv_context *ctx_in,
if (mctx->vendor_cap_flags & MLX5_VENDOR_CAP_FLAGS_MPW_ALLOWED)
attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED;
+ if (mctx->vendor_cap_flags & MLX5_VENDOR_CAP_FLAGS_CQE_128B_COMP)
+ attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP;
+
if (attrs_out->comp_mask & MLX5DV_CONTEXT_MASK_CQE_COMPRESION) {
attrs_out->cqe_comp_caps = mctx->cqe_comp_caps;
comp_mask_out |= MLX5DV_CONTEXT_MASK_CQE_COMPRESION;
@@ -193,6 +193,7 @@ enum mlx5_vendor_cap_flags {
MLX5_VENDOR_CAP_FLAGS_MPW = 1 << 0, /* Obsoleted */
MLX5_VENDOR_CAP_FLAGS_MPW_ALLOWED = 1 << 1,
MLX5_VENDOR_CAP_FLAGS_ENHANCED_MPW = 1 << 2,
+ MLX5_VENDOR_CAP_FLAGS_CQE_128B_COMP = 1 << 3,
};
enum {
@@ -92,6 +92,7 @@ enum mlx5dv_context_flags {
MLX5DV_CONTEXT_FLAGS_OBSOLETE = (1 << 1), /* Obsoleted, don't use */
MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED = (1 << 2),
MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW = (1 << 3),
+ MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP = (1 << 4), /* Support CQE 128B compression */
};
enum mlx5dv_cq_init_attr_mask {
@@ -2134,6 +2134,9 @@ int mlx5_query_device_ex(struct ibv_context *context,
mctx->cqe_comp_caps = resp.cqe_comp_caps;
mctx->sw_parsing_caps = resp.sw_parsing_caps;
+ if (resp.flags & MLX5_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP)
+ mctx->vendor_cap_flags |= MLX5_VENDOR_CAP_FLAGS_CQE_128B_COMP;
+
major = (raw_fw_ver >> 32) & 0xffff;
minor = (raw_fw_ver >> 16) & 0xffff;
sub_minor = raw_fw_ver & 0xffff;