All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: jgg@nvidia.com, zyjzyj2000@gmail.com, lizhijian@fujitsu.com,
	linux-rdma@vger.kernel.org
Cc: Bob Pearson <rpearsonhpe@gmail.com>
Subject: [PATCH for-next 10/13] RDMA/rxe: Extend rxe_comp.c to support xrc qps
Date: Fri, 16 Sep 2022 22:11:01 -0500	[thread overview]
Message-ID: <20220917031104.21222-11-rpearsonhpe@gmail.com> (raw)
In-Reply-To: <20220917031104.21222-1-rpearsonhpe@gmail.com>

Extend code in rxe_comp.c to support xrc qp types.

Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_comp.c | 45 ++++++++++++++--------------
 1 file changed, 22 insertions(+), 23 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c
index 1f10ae4a35d5..cb6621b4055d 100644
--- a/drivers/infiniband/sw/rxe/rxe_comp.c
+++ b/drivers/infiniband/sw/rxe/rxe_comp.c
@@ -213,12 +213,13 @@ static inline enum comp_state check_ack(struct rxe_qp *qp,
 					struct rxe_pkt_info *pkt,
 					struct rxe_send_wqe *wqe)
 {
+	struct rxe_dev *rxe = to_rdev(qp->ibqp.device);
 	unsigned int mask = pkt->mask;
+	int opcode;
 	u8 syn;
-	struct rxe_dev *rxe = to_rdev(qp->ibqp.device);
 
-	/* Check the sequence only */
-	switch (qp->comp.opcode) {
+	/* Mask off type bits and check the sequence only */
+	switch (qp->comp.opcode & IB_OPCODE_CMD) {
 	case -1:
 		/* Will catch all *_ONLY cases. */
 		if (!(mask & RXE_FIRST_MASK))
@@ -226,42 +227,39 @@ static inline enum comp_state check_ack(struct rxe_qp *qp,
 
 		break;
 
-	case IB_OPCODE_RC_RDMA_READ_RESPONSE_FIRST:
-	case IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE:
-		if (pkt->opcode != IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE &&
-		    pkt->opcode != IB_OPCODE_RC_RDMA_READ_RESPONSE_LAST) {
+	case IB_OPCODE_RDMA_READ_RESPONSE_FIRST:
+	case IB_OPCODE_RDMA_READ_RESPONSE_MIDDLE:
+		opcode = pkt->opcode & IB_OPCODE_CMD;
+		if (opcode != IB_OPCODE_RDMA_READ_RESPONSE_MIDDLE &&
+		    opcode != IB_OPCODE_RDMA_READ_RESPONSE_LAST) {
 			/* read retries of partial data may restart from
 			 * read response first or response only.
 			 */
 			if ((pkt->psn == wqe->first_psn &&
-			     pkt->opcode ==
-			     IB_OPCODE_RC_RDMA_READ_RESPONSE_FIRST) ||
+			     opcode == IB_OPCODE_RDMA_READ_RESPONSE_FIRST) ||
 			    (wqe->first_psn == wqe->last_psn &&
-			     pkt->opcode ==
-			     IB_OPCODE_RC_RDMA_READ_RESPONSE_ONLY))
+			     opcode == IB_OPCODE_RDMA_READ_RESPONSE_ONLY))
 				break;
 
 			return COMPST_ERROR;
 		}
 		break;
 	default:
-		WARN_ON_ONCE(1);
+		//WARN_ON_ONCE(1);
 	}
 
-	/* Check operation validity. */
-	switch (pkt->opcode) {
-	case IB_OPCODE_RC_RDMA_READ_RESPONSE_FIRST:
-	case IB_OPCODE_RC_RDMA_READ_RESPONSE_LAST:
-	case IB_OPCODE_RC_RDMA_READ_RESPONSE_ONLY:
+	/* Mask off the type bits and check operation validity. */
+	switch (pkt->opcode & IB_OPCODE_CMD) {
+	case IB_OPCODE_RDMA_READ_RESPONSE_FIRST:
+	case IB_OPCODE_RDMA_READ_RESPONSE_LAST:
+	case IB_OPCODE_RDMA_READ_RESPONSE_ONLY:
 		syn = aeth_syn(pkt);
 
 		if ((syn & AETH_TYPE_MASK) != AETH_ACK)
 			return COMPST_ERROR;
 
 		fallthrough;
-		/* (IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE doesn't have an AETH)
-		 */
-	case IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE:
+	case IB_OPCODE_RDMA_READ_RESPONSE_MIDDLE:
 		if (wqe->wr.opcode != IB_WR_RDMA_READ &&
 		    wqe->wr.opcode != IB_WR_RDMA_READ_WITH_INV) {
 			wqe->status = IB_WC_FATAL_ERR;
@@ -270,7 +268,7 @@ static inline enum comp_state check_ack(struct rxe_qp *qp,
 		reset_retry_counters(qp);
 		return COMPST_READ;
 
-	case IB_OPCODE_RC_ATOMIC_ACKNOWLEDGE:
+	case IB_OPCODE_ATOMIC_ACKNOWLEDGE:
 		syn = aeth_syn(pkt);
 
 		if ((syn & AETH_TYPE_MASK) != AETH_ACK)
@@ -282,7 +280,7 @@ static inline enum comp_state check_ack(struct rxe_qp *qp,
 		reset_retry_counters(qp);
 		return COMPST_ATOMIC;
 
-	case IB_OPCODE_RC_ACKNOWLEDGE:
+	case IB_OPCODE_ACKNOWLEDGE:
 		syn = aeth_syn(pkt);
 		switch (syn & AETH_TYPE_MASK) {
 		case AETH_ACK:
@@ -669,7 +667,8 @@ int rxe_completer(void *arg)
 			 *     timeouts but try to keep them as few as possible)
 			 * (4) the timeout parameter is set
 			 */
-			if ((qp_type(qp) == IB_QPT_RC) &&
+			if ((qp_type(qp) == IB_QPT_RC ||
+			     qp_type(qp) == IB_QPT_XRC_INI) &&
 			    (qp->req.state == QP_STATE_READY) &&
 			    (psn_compare(qp->req.psn, qp->comp.psn) > 0) &&
 			    qp->qp_timeout_jiffies)
-- 
2.34.1


  parent reply	other threads:[~2022-09-17  3:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17  3:10 [PATCH for-next 00/13] Implement the xrc transport Bob Pearson
2022-09-17  3:10 ` [PATCH for-next 01/13] RDMA/rxe: Replace START->FIRST, END->LAST Bob Pearson
2022-09-17  3:10 ` [PATCH for-next 02/13] RDMA/rxe: Move next_opcode() to rxe_opcode.c Bob Pearson
2022-09-17  3:10 ` [PATCH for-next 03/13] RDMA: Add xrc opcodes to ib_pack.h Bob Pearson
2022-09-17  3:10 ` [PATCH for-next 04/13] RDMA/rxe: Extend opcodes and headers to support xrc Bob Pearson
2022-09-17  3:10 ` [PATCH for-next 05/13] RDMA/rxe: Add xrc opcodes to next_opcode() Bob Pearson
2022-09-17  3:10 ` [PATCH for-next 06/13] RDMA/rxe: Implement open_xrcd and close_xrcd Bob Pearson
2022-09-17  3:10 ` [PATCH for-next 07/13] RDMA/rxe: Extend srq verbs to support xrcd Bob Pearson
2022-09-26 23:11   ` Jason Gunthorpe
2022-09-17  3:10 ` [PATCH for-next 08/13] RDMA/rxe: Extend rxe_qp.c to support xrc qps Bob Pearson
2022-09-17  3:11 ` [PATCH for-next 09/13] RDMA/rxe: Extend rxe_recv.c to support xrc Bob Pearson
2022-09-17  3:11 ` Bob Pearson [this message]
2022-09-21 20:45   ` [PATCH for-next 10/13] RDMA/rxe: Extend rxe_comp.c to support xrc qps kernel test robot
2022-09-17  3:11 ` [PATCH for-next 11/13] RDMA/rxe: Extend rxe_req.c " Bob Pearson
2022-09-17  3:11 ` [PATCH for-next 12/13] RDMA/rxe: Extend rxe_net.c " Bob Pearson
2022-09-17  3:11 ` [PATCH for-next 13/13] RDMA/rxe: Extend rxe_resp.c " Bob Pearson
2022-09-26 23:13 ` [PATCH for-next 00/13] Implement the xrc transport Jason Gunthorpe
2022-09-27  1:38   ` matsuda-daisuke
2022-09-29 15:58     ` Bob Pearson
2022-09-29 23:52       ` matsuda-daisuke
2022-10-12  7:41         ` matsuda-daisuke
2022-10-13 17:17           ` Bob Pearson
2022-10-17  6:59             ` matsuda-daisuke
2022-09-29 15:59   ` Bob Pearson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220917031104.21222-11-rpearsonhpe@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lizhijian@fujitsu.com \
    --cc=zyjzyj2000@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.