Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 572f46bf authored by Yonatan Cohen's avatar Yonatan Cohen Committed by Jason Gunthorpe
Browse files

IB/mlx5: Refactor CQE compression response



Refactor CQE compression response to be fully set only
when it`s really supported. There is no change from user
perspective because anyway resp.cqe_comp_caps.max_num was
set to zero.

Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
Signed-off-by: default avatarYonatan Cohen <yonatanc@mellanox.com&gt;W>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent ab741b2e
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -983,13 +983,17 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
	}

	if (field_avail(typeof(resp), cqe_comp_caps, uhw->outlen)) {
		resp.response_length += sizeof(resp.cqe_comp_caps);

		if (MLX5_CAP_GEN(dev->mdev, cqe_compression)) {
			resp.cqe_comp_caps.max_num =
			MLX5_CAP_GEN(dev->mdev, cqe_compression) ?
			MLX5_CAP_GEN(dev->mdev, cqe_compression_max_num) : 0;
				MLX5_CAP_GEN(dev->mdev,
					     cqe_compression_max_num);

			resp.cqe_comp_caps.supported_format =
				MLX5_IB_CQE_RES_FORMAT_HASH |
				MLX5_IB_CQE_RES_FORMAT_CSUM;
		resp.response_length += sizeof(resp.cqe_comp_caps);
		}
	}

	if (field_avail(typeof(resp), packet_pacing_caps, uhw->outlen) &&