History

IB/mlx5: Support 128B CQE compression feature

In commit 1cbe6fc86ccf ("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.

Guy Levi committed 9 years ago

Commit de57f2a1 parent 0ff8e793 files · +16 −5Browse files

Unified · Split

3 files
  1. drivers/infiniband/hw/mlx5/cq.c +4 −2
  2. drivers/infiniband/hw/mlx5/main.c +6 −2
  3. include/uapi/rdma/mlx5-abi.h +6 −1
drivers/infiniband/hw/mlx5/cq.c+4−2
@@ -804,8 +804,10 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata, · 803 unmodified lines
804 *index = to_mucontext(context)->bfregi.sys_pages[0];804 *index = to_mucontext(context)->bfregi.sys_pages[0];
805 805
806 if (ucmd.cqe_comp_en == 1) {806 if (ucmd.cqe_comp_en == 1) {
807 if (unlikely((*cqe_size != 64) ||807 if (!((*cqe_size == 128 &&
808 !MLX5_CAP_GEN(dev->mdev, cqe_compression))) {808 MLX5_CAP_GEN(dev->mdev, cqe_compression_128)) ||
809 (*cqe_size == 64 &&
810 MLX5_CAP_GEN(dev->mdev, cqe_compression)))) {
809 err = -EOPNOTSUPP;811 err = -EOPNOTSUPP;
810 mlx5_ib_warn(dev, "CQE compression is not supported for size %d!\n",812 mlx5_ib_warn(dev, "CQE compression is not supported for size %d!\n",
811 *cqe_size);813 *cqe_size);
drivers/infiniband/hw/mlx5/main.c+6−2
@@ -824,8 +824,12 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, · 823 unmodified lines
824 sizeof(resp.mlx5_ib_support_multi_pkt_send_wqes);824 sizeof(resp.mlx5_ib_support_multi_pkt_send_wqes);
825 }825 }
826 826
827 if (field_avail(typeof(resp), reserved, uhw->outlen))827 if (field_avail(typeof(resp), flags, uhw->outlen)) {
828 resp.response_length += sizeof(resp.reserved);828 resp.response_length += sizeof(resp.flags);
829 if (MLX5_CAP_GEN(mdev, cqe_compression_128))
830 resp.flags |=
831 MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP;
832 }
829 833
830 if (field_avail(typeof(resp), sw_parsing_caps,834 if (field_avail(typeof(resp), sw_parsing_caps,
831 uhw->outlen)) {835 uhw->outlen)) {
include/uapi/rdma/mlx5-abi.h+6−1
@@ -203,6 +203,11 @@ struct mlx5_ib_striding_rq_caps { · 202 unmodified lines
203 __u32 supported_qpts;203 __u32 supported_qpts;
204};204};
205 205
206enum mlx5_ib_query_dev_resp_flags {
207 /* Support 128B CQE compression */
208 MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP = 1 << 0,
209};
210
206struct mlx5_ib_query_device_resp {211struct mlx5_ib_query_device_resp {
207 __u32 comp_mask;212 __u32 comp_mask;
208 __u32 response_length;213 __u32 response_length;
@@ -211,7 +216,7 @@ struct mlx5_ib_query_device_resp { · 2 unmodified lines
211 struct mlx5_ib_cqe_comp_caps cqe_comp_caps;216 struct mlx5_ib_cqe_comp_caps cqe_comp_caps;
212 struct mlx5_packet_pacing_caps packet_pacing_caps;217 struct mlx5_packet_pacing_caps packet_pacing_caps;
213 __u32 mlx5_ib_support_multi_pkt_send_wqes;218 __u32 mlx5_ib_support_multi_pkt_send_wqes;
214 __u32 reserved;219 __u32 flags; /* Use enum mlx5_ib_query_dev_resp_flags */
215 struct mlx5_ib_sw_parsing_caps sw_parsing_caps;220 struct mlx5_ib_sw_parsing_caps sw_parsing_caps;
216 struct mlx5_ib_striding_rq_caps striding_rq_caps;221 struct mlx5_ib_striding_rq_caps striding_rq_caps;
217};222};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t