RDMA/mlx5: Take qp type from mlx5_ib_qp
Subsystems (2)
PATCH 1/1 RDMA/mlx5: Take qp type from mlx5_ib_qp
From: Maor Gottlieb <[email protected]>
Change all the places in the mlx5_ib driver to take the qp type from the mlx5_ib_qp struct, except the QP initialization flow. It will ensure that we check the right QP type also for vendor specific QPs.
---
Followup to
https://lore.kernel.org/lkml/6eee15d63f09bb70787488e0cf96216e2957f5aa.1621413654.git.leonro@nvidia.com
--- drivers/infiniband/hw/mlx5/cq.c | 2 +- drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 - drivers/infiniband/hw/mlx5/odp.c | 2 +- drivers/infiniband/hw/mlx5/qp.c | 53 +++++++++++++--------------- drivers/infiniband/hw/mlx5/wr.c | 9 +++-- 5 files changed, 31 insertions(+), 36 deletions(-)
drivers/infiniband/hw/mlx5/cq.c +1 -1
@@ -227,7 +227,7 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, wc->dlid_path_bits = cqe->ml_path; g = (be32_to_cpu (cqe->flags_rqpn) >>28 ) &3 ; wc->wc_flags |= g ?IB_WC_GRH :0 ; -if (unlikely (is_qp1 (qp->ibqp.qp_type))) { +if (is_qp1 (qp->type)) {u16 pkey =be32_to_cpu (cqe->pkey) &0xffff ; ib_find_cached_pkey(&dev->ib_dev, qp->port, pkey,
drivers/infiniband/hw/mlx5/mlx5_ib.h +0 -1
@@ -512,7 +512,6 @@ struct mlx5_ib_qp {/* * IB/core doesn't store low-level QP types, so * store both MLX and IBTA types in the field below. -* IB_QPT_DRIVER will be break to DCI/DCT subtypes. */ enum ib_qp_type type;/* A flag to indicate if there's a new counter is configured
drivers/infiniband/hw/mlx5/odp.c +1 -1
@@ -1096,7 +1096,7 @@ static int mlx5_ib_mr_initiator_pfault_handler( opcode =be32_to_cpu (ctrl->opmod_idx_opcode) &MLX5_WQE_CTRL_OPCODE_MASK ; -if (qp->ibqp.qp_type ==IB_QPT_XRC_INI ) +if (qp->type ==IB_QPT_XRC_INI ) *wqe +=sizeof (struct mlx5_wqe_xrc_seg );if (qp->type ==IB_QPT_UD || qp->type ==MLX5_IB_QPT_DCI ) {
drivers/infiniband/hw/mlx5/qp.c +25 -28
164 lines not on this page · raw message
drivers/infiniband/hw/mlx5/wr.c +4 -5
@@ -1312,7 +1312,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr,struct mlx5_wqe_ctrl_seg *ctrl =NULL ;/* compiler warning */ struct mlx5_ib_dev *dev =to_mdev (ibqp->device);struct mlx5_core_dev *mdev = dev->mdev; -struct mlx5_ib_qp *qp; +struct mlx5_ib_qp *qp =to_mqp (ibqp);struct mlx5_wqe_xrc_seg *xrc;struct mlx5_bf *bf;void *cur_edge;
@@ -1333,10 +1333,9 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr,return -EIO ; } -if (unlikely (ibqp->qp_type ==IB_QPT_GSI )) +if (qp->type ==IB_QPT_GSI )return mlx5_ib_gsi_post_send (ibqp, wr, bad_wr); - qp =to_mqp (ibqp); bf = &qp->bf;spin_lock_irqsave (&qp->sq.lock, flags);
@@ -1381,7 +1380,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr, } } -switch (ibqp->qp_type) { +switch (qp->type) {case IB_QPT_XRC_INI : xrc = seg; seg +=sizeof (*xrc);
@@ -1510,7 +1509,7 @@ int mlx5_ib_post_recv(struct ib_qp *ibqp, const struct ib_recv_wr *wr,return -EIO ; } -if (unlikely (ibqp->qp_type ==IB_QPT_GSI )) +if (qp->type ==IB_QPT_GSI )return mlx5_ib_gsi_post_recv (ibqp, wr, bad_wr);spin_lock_irqsave (&qp->rq.lock, flags);
Signature · 1 line
2.31.1
Quoted 12 lines · Leon Romanovsky
From: Maor Gottlieb <[email protected]>
Change all the places in the
mlx5_ibdriver to take the qp type from themlx5_ib_qpstruct, except the QP initialization flow. It will ensure that we check the right QP type also for vendor specific QPs.Signed-off-by Maor Gottlieb <[email protected]>Signed-off-by Leon Romanovsky <[email protected]>---
Followup to
https://lore.kernel.org/lkml/6eee15d63f09bb70787488e0cf96216e2957f5aa.1621413654.git.leonro@nvidia.com
Quoted 7 lines
--- drivers/infiniband/hw/mlx5/cq.c | 2 +- drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 - drivers/infiniband/hw/mlx5/odp.c | 2 +- drivers/infiniband/hw/mlx5/qp.c | 53 +++++++++++++--------------- drivers/infiniband/hw/mlx5/wr.c | 9 +++-- 5 files changed, 31 insertions(+), 36 deletions(-)
Applied to for-next
Jason