diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2020-04-27 18:46:16 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2020-04-29 02:42:23 +0300 |
commit | 90ecb37a751b6923bee846c4e19f73b943c6ffa1 (patch) | |
tree | 3627f9b2eb656b86793a4de960456839187247a4 | |
parent | c95e6d53970254fa04a09c0fd79ae2cfa54cd1f5 (diff) | |
download | linux-90ecb37a751b6923bee846c4e19f73b943c6ffa1.tar.xz |
RDMA/mlx5: Change scatter CQE flag to be set like other vendor flags
In similar way to wqe_sig, the scat_cqe was treated differently from
other create QP vendor flags. Change it to be similar to other flags
and use flags_en mechanism.
Link: https://lore.kernel.org/r/20200427154636.381474-17-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r-- | drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx5/qp.c | 17 |
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h index 61a96c1dd125..b6467cadc384 100644 --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h @@ -446,7 +446,6 @@ struct mlx5_ib_qp { u32 flags; u8 port; u8 state; - int scat_cqe; int max_inline_data; struct mlx5_bf bf; u8 has_rq:1; diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 9d29b84242f9..6a4b20c71b40 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -2019,9 +2019,10 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, if (ucmd->flags & MLX5_QP_FLAG_SIGNATURE) qp->flags_en |= MLX5_QP_FLAG_SIGNATURE; - if (MLX5_CAP_GEN(dev->mdev, sctr_data_cqe)) - qp->scat_cqe = - !!(ucmd->flags & MLX5_QP_FLAG_SCATTER_CQE); + if (ucmd->flags & MLX5_QP_FLAG_SCATTER_CQE && + MLX5_CAP_GEN(dev->mdev, sctr_data_cqe)) + qp->flags_en |= MLX5_QP_FLAG_SCATTER_CQE; + if (ucmd->flags & MLX5_QP_FLAG_TUNNEL_OFFLOADS) { if (init_attr->qp_type != IB_QPT_RAW_PACKET || !tunnel_offload_supported(mdev)) { @@ -2137,8 +2138,9 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, MLX5_SET(qpc, qpc, cd_slave_receive, 1); if (qp->flags_en & MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE) MLX5_SET(qpc, qpc, req_e2e_credit_mode, 1); - if (qp->scat_cqe && (init_attr->qp_type == IB_QPT_RC || - init_attr->qp_type == IB_QPT_UC)) { + if ((qp->flags_en & MLX5_QP_FLAG_SCATTER_CQE) && + (init_attr->qp_type == IB_QPT_RC || + init_attr->qp_type == IB_QPT_UC)) { int rcqe_sz = rcqe_sz = mlx5_ib_get_cqe_size(init_attr->recv_cq); @@ -2146,8 +2148,9 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, rcqe_sz == 128 ? MLX5_RES_SCAT_DATA64_CQE : MLX5_RES_SCAT_DATA32_CQE); } - if (qp->scat_cqe && (qp->qp_sub_type == MLX5_IB_QPT_DCI || - init_attr->qp_type == IB_QPT_RC)) + if ((qp->flags_en & MLX5_QP_FLAG_SCATTER_CQE) && + (qp->qp_sub_type == MLX5_IB_QPT_DCI || + init_attr->qp_type == IB_QPT_RC)) configure_requester_scat_cqe(dev, init_attr, ucmd, qpc); if (qp->rq.wqe_cnt) { |