Skip to content

Commit f55efc2

Browse files
rpearsonhpe-designjgunthorpe
authored andcommitted
RDMA/rxe: Remove qp->comp.state
The rxe driver has four different QP state variables, qp->attr.qp_state, qp->req.state, qp->comp.state, and qp->resp.state. All of these basically carry the same information. This patch replaces uses of qp->comp.state by qp->attr.qp_state. This is the second of three patches which will remove all but the qp->attr.qp_state variable. This will bring the driver closer to the IBA description. Link: https://lore.kernel.org/r/20230405042611.6467-2-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent a588429 commit f55efc2

3 files changed

Lines changed: 4 additions & 10 deletions

File tree

drivers/infiniband/sw/rxe/rxe_comp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,10 @@ int rxe_completer(struct rxe_qp *qp)
619619
enum comp_state state;
620620
int ret;
621621

622-
if (!qp->valid || qp->comp.state == QP_STATE_ERROR ||
623-
qp->comp.state == QP_STATE_RESET) {
624-
bool notify = qp->valid &&
625-
(qp->comp.state == QP_STATE_ERROR);
622+
if (!qp->valid || qp_state(qp) == IB_QPS_ERR ||
623+
qp_state(qp) == IB_QPS_RESET) {
624+
bool notify = qp->valid && (qp_state(qp) == IB_QPS_ERR);
625+
626626
drain_resp_pkts(qp);
627627
flush_send_queue(qp, notify);
628628
goto exit;

drivers/infiniband/sw/rxe/rxe_qp.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
232232
QUEUE_TYPE_FROM_CLIENT);
233233

234234
qp->req.state = QP_STATE_RESET;
235-
qp->comp.state = QP_STATE_RESET;
236235
qp->req.opcode = -1;
237236
qp->comp.opcode = -1;
238237

@@ -477,7 +476,6 @@ static void rxe_qp_reset(struct rxe_qp *qp)
477476

478477
/* move qp to the reset state */
479478
qp->req.state = QP_STATE_RESET;
480-
qp->comp.state = QP_STATE_RESET;
481479

482480
/* drain work and packet queuesc */
483481
rxe_requester(qp);
@@ -530,7 +528,6 @@ static void rxe_qp_drain(struct rxe_qp *qp)
530528
void rxe_qp_error(struct rxe_qp *qp)
531529
{
532530
qp->req.state = QP_STATE_ERROR;
533-
qp->comp.state = QP_STATE_ERROR;
534531
qp->attr.qp_state = IB_QPS_ERR;
535532

536533
/* drain work and packet queues */
@@ -660,7 +657,6 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask,
660657
case IB_QPS_INIT:
661658
rxe_dbg_qp(qp, "state -> INIT\n");
662659
qp->req.state = QP_STATE_INIT;
663-
qp->comp.state = QP_STATE_INIT;
664660
break;
665661

666662
case IB_QPS_RTR:
@@ -670,7 +666,6 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask,
670666
case IB_QPS_RTS:
671667
rxe_dbg_qp(qp, "state -> RTS\n");
672668
qp->req.state = QP_STATE_READY;
673-
qp->comp.state = QP_STATE_READY;
674669
break;
675670

676671
case IB_QPS_SQD:

drivers/infiniband/sw/rxe/rxe_verbs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ struct rxe_req_info {
127127
};
128128

129129
struct rxe_comp_info {
130-
enum rxe_qp_state state;
131130
u32 psn;
132131
int opcode;
133132
int timeout;

0 commit comments

Comments
 (0)