Skip to content

Commit

Permalink
RDMA/mlx5: Change scatter CQE flag to be set like other vendor flags
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Leon Romanovsky authored and jgunthorpe committed Apr 28, 2020
1 parent c95e6d5 commit 90ecb37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion drivers/infiniband/hw/mlx5/mlx5_ib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 10 additions & 7 deletions drivers/infiniband/hw/mlx5/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -2137,17 +2138,19 @@ 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);

MLX5_SET(qpc, qpc, cs_res,
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) {
Expand Down

0 comments on commit 90ecb37

Please sign in to comment.