IB/mlx5: Support 128B CQE compression feature

In commit 1cbe6fc86c ("IB/mlx5: Add support for CQE compressing") the
concept of CQE compression was introduced and added a support for 64B
CQE size. This change update the code to support 128B CQE size as well.

Signed-off-by: Guy Levi <guyle@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Guy Levi 2017-10-19 08:25:52 +03:00 коммит произвёл Doug Ledford
Родитель 0ff8e79ca7
Коммит de57f2ad06
3 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -804,8 +804,10 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
*index = to_mucontext(context)->bfregi.sys_pages[0]; *index = to_mucontext(context)->bfregi.sys_pages[0];
if (ucmd.cqe_comp_en == 1) { if (ucmd.cqe_comp_en == 1) {
if (unlikely((*cqe_size != 64) || if (!((*cqe_size == 128 &&
!MLX5_CAP_GEN(dev->mdev, cqe_compression))) { MLX5_CAP_GEN(dev->mdev, cqe_compression_128)) ||
(*cqe_size == 64 &&
MLX5_CAP_GEN(dev->mdev, cqe_compression)))) {
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
mlx5_ib_warn(dev, "CQE compression is not supported for size %d!\n", mlx5_ib_warn(dev, "CQE compression is not supported for size %d!\n",
*cqe_size); *cqe_size);

Просмотреть файл

@ -824,8 +824,12 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
sizeof(resp.mlx5_ib_support_multi_pkt_send_wqes); sizeof(resp.mlx5_ib_support_multi_pkt_send_wqes);
} }
if (field_avail(typeof(resp), reserved, uhw->outlen)) if (field_avail(typeof(resp), flags, uhw->outlen)) {
resp.response_length += sizeof(resp.reserved); resp.response_length += sizeof(resp.flags);
if (MLX5_CAP_GEN(mdev, cqe_compression_128))
resp.flags |=
MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP;
}
if (field_avail(typeof(resp), sw_parsing_caps, if (field_avail(typeof(resp), sw_parsing_caps,
uhw->outlen)) { uhw->outlen)) {

Просмотреть файл

@ -203,6 +203,11 @@ struct mlx5_ib_striding_rq_caps {
__u32 supported_qpts; __u32 supported_qpts;
}; };
enum mlx5_ib_query_dev_resp_flags {
/* Support 128B CQE compression */
MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP = 1 << 0,
};
struct mlx5_ib_query_device_resp { struct mlx5_ib_query_device_resp {
__u32 comp_mask; __u32 comp_mask;
__u32 response_length; __u32 response_length;
@ -211,7 +216,7 @@ struct mlx5_ib_query_device_resp {
struct mlx5_ib_cqe_comp_caps cqe_comp_caps; struct mlx5_ib_cqe_comp_caps cqe_comp_caps;
struct mlx5_packet_pacing_caps packet_pacing_caps; struct mlx5_packet_pacing_caps packet_pacing_caps;
__u32 mlx5_ib_support_multi_pkt_send_wqes; __u32 mlx5_ib_support_multi_pkt_send_wqes;
__u32 reserved; __u32 flags; /* Use enum mlx5_ib_query_dev_resp_flags */
struct mlx5_ib_sw_parsing_caps sw_parsing_caps; struct mlx5_ib_sw_parsing_caps sw_parsing_caps;
struct mlx5_ib_striding_rq_caps striding_rq_caps; struct mlx5_ib_striding_rq_caps striding_rq_caps;
}; };