You need to sign in or sign up before continuing.
提交 f55efc2e 编写于 作者: B Bob Pearson 提交者: Jason Gunthorpe

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.comSigned-off-by: NBob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
上级 a588429a
...@@ -619,10 +619,10 @@ int rxe_completer(struct rxe_qp *qp) ...@@ -619,10 +619,10 @@ int rxe_completer(struct rxe_qp *qp)
enum comp_state state; enum comp_state state;
int ret; int ret;
if (!qp->valid || qp->comp.state == QP_STATE_ERROR || if (!qp->valid || qp_state(qp) == IB_QPS_ERR ||
qp->comp.state == QP_STATE_RESET) { qp_state(qp) == IB_QPS_RESET) {
bool notify = qp->valid && bool notify = qp->valid && (qp_state(qp) == IB_QPS_ERR);
(qp->comp.state == QP_STATE_ERROR);
drain_resp_pkts(qp); drain_resp_pkts(qp);
flush_send_queue(qp, notify); flush_send_queue(qp, notify);
goto exit; goto exit;
......
...@@ -232,7 +232,6 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp, ...@@ -232,7 +232,6 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
QUEUE_TYPE_FROM_CLIENT); QUEUE_TYPE_FROM_CLIENT);
qp->req.state = QP_STATE_RESET; qp->req.state = QP_STATE_RESET;
qp->comp.state = QP_STATE_RESET;
qp->req.opcode = -1; qp->req.opcode = -1;
qp->comp.opcode = -1; qp->comp.opcode = -1;
...@@ -477,7 +476,6 @@ static void rxe_qp_reset(struct rxe_qp *qp) ...@@ -477,7 +476,6 @@ static void rxe_qp_reset(struct rxe_qp *qp)
/* move qp to the reset state */ /* move qp to the reset state */
qp->req.state = QP_STATE_RESET; qp->req.state = QP_STATE_RESET;
qp->comp.state = QP_STATE_RESET;
/* drain work and packet queuesc */ /* drain work and packet queuesc */
rxe_requester(qp); rxe_requester(qp);
...@@ -530,7 +528,6 @@ static void rxe_qp_drain(struct rxe_qp *qp) ...@@ -530,7 +528,6 @@ static void rxe_qp_drain(struct rxe_qp *qp)
void rxe_qp_error(struct rxe_qp *qp) void rxe_qp_error(struct rxe_qp *qp)
{ {
qp->req.state = QP_STATE_ERROR; qp->req.state = QP_STATE_ERROR;
qp->comp.state = QP_STATE_ERROR;
qp->attr.qp_state = IB_QPS_ERR; qp->attr.qp_state = IB_QPS_ERR;
/* drain work and packet queues */ /* 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, ...@@ -660,7 +657,6 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask,
case IB_QPS_INIT: case IB_QPS_INIT:
rxe_dbg_qp(qp, "state -> INIT\n"); rxe_dbg_qp(qp, "state -> INIT\n");
qp->req.state = QP_STATE_INIT; qp->req.state = QP_STATE_INIT;
qp->comp.state = QP_STATE_INIT;
break; break;
case IB_QPS_RTR: case IB_QPS_RTR:
...@@ -670,7 +666,6 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask, ...@@ -670,7 +666,6 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask,
case IB_QPS_RTS: case IB_QPS_RTS:
rxe_dbg_qp(qp, "state -> RTS\n"); rxe_dbg_qp(qp, "state -> RTS\n");
qp->req.state = QP_STATE_READY; qp->req.state = QP_STATE_READY;
qp->comp.state = QP_STATE_READY;
break; break;
case IB_QPS_SQD: case IB_QPS_SQD:
......
...@@ -127,7 +127,6 @@ struct rxe_req_info { ...@@ -127,7 +127,6 @@ struct rxe_req_info {
}; };
struct rxe_comp_info { struct rxe_comp_info {
enum rxe_qp_state state;
u32 psn; u32 psn;
int opcode; int opcode;
int timeout; int timeout;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册