[PATCH 1/2] isert: support for unsolicited NOPIN with no response.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The isert module has only supported sending a NOPIN as a response to a
NOPOUT. In order to be able to use an unsolicited NOPIN to inform the
initiator of max_cmd_sn changes, isert needs to be able to send a NOPIN
as needed.

Signed-off-by: David Jeffery <djeffery@xxxxxxxxxx>
Tested-by: Laurence Oberman <loberman@xxxxxxxxxx>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 636d590765f9..b8390ad762eb 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -1469,6 +1469,7 @@ isert_put_cmd(struct isert_cmd *isert_cmd, bool comp_err)
 		break;
 	case ISCSI_OP_REJECT:
 	case ISCSI_OP_NOOP_OUT:
+	case ISCSI_OP_NOOP_IN:
 	case ISCSI_OP_TEXT:
 		hdr = (struct iscsi_text_rsp *)&isert_cmd->tx_desc.iscsi_header;
 		/* If the continue bit is on, keep the command alive */
@@ -1858,7 +1859,14 @@ isert_put_nopin(struct iscsi_cmd *cmd, struct iscsi_conn *conn,
 
 	isert_dbg("conn %p Posting NOPIN Response\n", isert_conn);
 
-	return isert_post_response(isert_conn, isert_cmd);
+	if (nopout_response)
+		return isert_post_response(isert_conn, isert_cmd);
+
+	/* pointer init since didn't go through isert_allocate_cmd */
+	isert_cmd->conn = isert_conn;
+	isert_cmd->iscsi_cmd = cmd;
+
+	return ib_post_send(isert_conn->qp, send_wr, NULL);
 }
 
 static int
@@ -2159,6 +2167,7 @@ isert_immediate_queue(struct iscsi_conn *conn, struct iscsi_cmd *cmd, int state)
 		spin_unlock_bh(&conn->cmd_lock);
 		isert_put_cmd(isert_cmd, true);
 		break;
+	case ISTATE_SEND_NOPIN_NO_RESPONSE:
 	case ISTATE_SEND_NOPIN_WANT_RESPONSE:
 		ret = isert_put_nopin(cmd, conn, false);
 		break;
-- 
2.31.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux