Commit 90ecb37a authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Jason Gunthorpe

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.orgReviewed-by: default avatarMaor Gottlieb <maorg@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent c95e6d53
...@@ -446,7 +446,6 @@ struct mlx5_ib_qp { ...@@ -446,7 +446,6 @@ struct mlx5_ib_qp {
u32 flags; u32 flags;
u8 port; u8 port;
u8 state; u8 state;
int scat_cqe;
int max_inline_data; int max_inline_data;
struct mlx5_bf bf; struct mlx5_bf bf;
u8 has_rq:1; u8 has_rq:1;
......
...@@ -2019,9 +2019,10 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, ...@@ -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) if (ucmd->flags & MLX5_QP_FLAG_SIGNATURE)
qp->flags_en |= MLX5_QP_FLAG_SIGNATURE; qp->flags_en |= MLX5_QP_FLAG_SIGNATURE;
if (MLX5_CAP_GEN(dev->mdev, sctr_data_cqe)) if (ucmd->flags & MLX5_QP_FLAG_SCATTER_CQE &&
qp->scat_cqe = MLX5_CAP_GEN(dev->mdev, sctr_data_cqe))
!!(ucmd->flags & MLX5_QP_FLAG_SCATTER_CQE); qp->flags_en |= MLX5_QP_FLAG_SCATTER_CQE;
if (ucmd->flags & MLX5_QP_FLAG_TUNNEL_OFFLOADS) { if (ucmd->flags & MLX5_QP_FLAG_TUNNEL_OFFLOADS) {
if (init_attr->qp_type != IB_QPT_RAW_PACKET || if (init_attr->qp_type != IB_QPT_RAW_PACKET ||
!tunnel_offload_supported(mdev)) { !tunnel_offload_supported(mdev)) {
...@@ -2137,8 +2138,9 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, ...@@ -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); MLX5_SET(qpc, qpc, cd_slave_receive, 1);
if (qp->flags_en & MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE) if (qp->flags_en & MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE)
MLX5_SET(qpc, qpc, req_e2e_credit_mode, 1); MLX5_SET(qpc, qpc, req_e2e_credit_mode, 1);
if (qp->scat_cqe && (init_attr->qp_type == IB_QPT_RC || if ((qp->flags_en & MLX5_QP_FLAG_SCATTER_CQE) &&
init_attr->qp_type == IB_QPT_UC)) { (init_attr->qp_type == IB_QPT_RC ||
init_attr->qp_type == IB_QPT_UC)) {
int rcqe_sz = rcqe_sz = int rcqe_sz = rcqe_sz =
mlx5_ib_get_cqe_size(init_attr->recv_cq); 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, ...@@ -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 : rcqe_sz == 128 ? MLX5_RES_SCAT_DATA64_CQE :
MLX5_RES_SCAT_DATA32_CQE); MLX5_RES_SCAT_DATA32_CQE);
} }
if (qp->scat_cqe && (qp->qp_sub_type == MLX5_IB_QPT_DCI || if ((qp->flags_en & MLX5_QP_FLAG_SCATTER_CQE) &&
init_attr->qp_type == IB_QPT_RC)) (qp->qp_sub_type == MLX5_IB_QPT_DCI ||
init_attr->qp_type == IB_QPT_RC))
configure_requester_scat_cqe(dev, init_attr, ucmd, qpc); configure_requester_scat_cqe(dev, init_attr, ucmd, qpc);
if (qp->rq.wqe_cnt) { if (qp->rq.wqe_cnt) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment