Skip to content

Commit 81530ab

Browse files
Leon Romanovskyjgunthorpe
authored andcommitted
RDMA/mlx5: Allow providing extra scatter CQE QP flag
Scatter CQE feature relies on two flags MLX5_QP_FLAG_SCATTER_CQE and MLX5_QP_FLAG_ALLOW_SCATTER_CQE, both of them can be provided without relation to device capability. Relax global validity check to allow MLX5_QP_FLAG_ALLOW_SCATTER_CQE QP flag. Existing user applications are failing on this new validity check. Fixes: 90ecb37 ("RDMA/mlx5: Change scatter CQE flag to be set like other vendor flags") Fixes: 37518fa ("RDMA/mlx5: Process all vendor flags in one place") Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Artemy Kovalyov <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 5351a56 commit 81530ab

File tree

1 file changed

+15
-9
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+15
-9
lines changed

drivers/infiniband/hw/mlx5/qp.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,15 +1766,14 @@ static int create_rss_raw_qp_tir(struct mlx5_ib_dev *dev, struct ib_pd *pd,
17661766
}
17671767

17681768
static void configure_requester_scat_cqe(struct mlx5_ib_dev *dev,
1769+
struct mlx5_ib_qp *qp,
17691770
struct ib_qp_init_attr *init_attr,
1770-
struct mlx5_ib_create_qp *ucmd,
17711771
void *qpc)
17721772
{
17731773
int scqe_sz;
17741774
bool allow_scat_cqe = false;
17751775

1776-
if (ucmd)
1777-
allow_scat_cqe = ucmd->flags & MLX5_QP_FLAG_ALLOW_SCATTER_CQE;
1776+
allow_scat_cqe = qp->flags_en & MLX5_QP_FLAG_ALLOW_SCATTER_CQE;
17781777

17791778
if (!allow_scat_cqe && init_attr->sq_sig_type != IB_SIGNAL_ALL_WR)
17801779
return;
@@ -2012,7 +2011,7 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
20122011
}
20132012
if ((qp->flags_en & MLX5_QP_FLAG_SCATTER_CQE) &&
20142013
(qp->type == MLX5_IB_QPT_DCI || qp->type == IB_QPT_RC))
2015-
configure_requester_scat_cqe(dev, init_attr, ucmd, qpc);
2014+
configure_requester_scat_cqe(dev, qp, init_attr, qpc);
20162015

20172016
if (qp->rq.wqe_cnt) {
20182017
MLX5_SET(qpc, qpc, log_rq_stride, qp->rq.wqe_shift - 4);
@@ -2543,13 +2542,18 @@ static void process_vendor_flag(struct mlx5_ib_dev *dev, int *flags, int flag,
25432542
return;
25442543
}
25452544

2546-
if (flag == MLX5_QP_FLAG_SCATTER_CQE) {
2545+
switch (flag) {
2546+
case MLX5_QP_FLAG_SCATTER_CQE:
2547+
case MLX5_QP_FLAG_ALLOW_SCATTER_CQE:
25472548
/*
2548-
* We don't return error if this flag was provided,
2549-
* and mlx5 doesn't have right capability.
2550-
*/
2551-
*flags &= ~MLX5_QP_FLAG_SCATTER_CQE;
2549+
* We don't return error if these flags were provided,
2550+
* and mlx5 doesn't have right capability.
2551+
*/
2552+
*flags &= ~(MLX5_QP_FLAG_SCATTER_CQE |
2553+
MLX5_QP_FLAG_ALLOW_SCATTER_CQE);
25522554
return;
2555+
default:
2556+
break;
25532557
}
25542558
mlx5_ib_dbg(dev, "Vendor create QP flag 0x%X is not supported\n", flag);
25552559
}
@@ -2589,6 +2593,8 @@ static int process_vendor_flags(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
25892593
process_vendor_flag(dev, &flags, MLX5_QP_FLAG_SIGNATURE, true, qp);
25902594
process_vendor_flag(dev, &flags, MLX5_QP_FLAG_SCATTER_CQE,
25912595
MLX5_CAP_GEN(mdev, sctr_data_cqe), qp);
2596+
process_vendor_flag(dev, &flags, MLX5_QP_FLAG_ALLOW_SCATTER_CQE,
2597+
MLX5_CAP_GEN(mdev, sctr_data_cqe), qp);
25922598

25932599
if (qp->type == IB_QPT_RAW_PACKET) {
25942600
cond = MLX5_CAP_ETH(mdev, tunnel_stateless_vxlan) ||

0 commit comments

Comments
 (0)