All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] Additional EDiF bug fixes
@ 2022-06-08 11:58 Nilesh Javali
  2022-06-08 11:58 ` [PATCH 01/10] qla2xxx: edif: Fix IO timeout due to over subscription Nilesh Javali
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

Martin,

Please apply the qla2xxx driver additional EDiF bug fixes to the scsi
tree at your earliest convenience.

Thanks,
Nilesh

Nilesh Javali (1):
  qla2xxx: Update version to 10.02.07.600-k

Quinn Tran (9):
  qla2xxx: edif: Fix IO timeout due to over subscription
  qla2xxx: edif: send logo for unexpected IKE message
  qla2xxx: edif: reduce disruption due to multiple app start
  qla2xxx: edif: fix no login after app start
  qla2xxx: edif: tear down session if keys has been removed
  qla2xxx: edif: fix session thrash
  qla2xxx: edif: Fix no logout on delete for n2n
  qla2xxx: edif: Reduce N2N thrashing at app_start time
  qla2xxx: edif: Fix slow session tear down

 drivers/scsi/qla2xxx/qla_def.h     |  5 ++
 drivers/scsi/qla2xxx/qla_edif.c    | 80 +++++++++++++++++++++++-------
 drivers/scsi/qla2xxx/qla_edif.h    |  4 ++
 drivers/scsi/qla2xxx/qla_fw.h      |  2 +-
 drivers/scsi/qla2xxx/qla_init.c    | 10 +++-
 drivers/scsi/qla2xxx/qla_iocb.c    |  3 ++
 drivers/scsi/qla2xxx/qla_isr.c     | 35 +++++++------
 drivers/scsi/qla2xxx/qla_version.h |  4 +-
 8 files changed, 107 insertions(+), 36 deletions(-)


base-commit: 3fd3a52ca672fea71ff6ebaded2e2ddbbfb3a397
-- 
2.19.0.rc0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 01/10] qla2xxx: edif: Fix IO timeout due to over subscription
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
@ 2022-06-08 11:58 ` Nilesh Javali
  2022-06-08 11:58 ` [PATCH 02/10] qla2xxx: edif: send logo for unexpected IKE message Nilesh Javali
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Quinn Tran <qutran@marvell.com>

Current edif code does not keep track of FW IOCB resources.
This led to IOCB queue full on error recovery (IO timeout).
This patch make use of the existing code that track IOCB
resources to prevent over subscription of IOCB resources.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_edif.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
index 18eb8d63e37c..6a16e16e39f5 100644
--- a/drivers/scsi/qla2xxx/qla_edif.c
+++ b/drivers/scsi/qla2xxx/qla_edif.c
@@ -2951,6 +2951,12 @@ qla28xx_start_scsi_edif(srb_t *sp)
 
 	tot_dsds = nseg;
 	req_cnt = qla24xx_calc_iocbs(vha, tot_dsds);
+
+	sp->iores.res_type = RESOURCE_INI;
+	sp->iores.iocb_cnt = req_cnt;
+	if (qla_get_iocbs(sp->qpair, &sp->iores))
+		goto queuing_error;
+
 	if (req->cnt < (req_cnt + 2)) {
 		cnt = IS_SHADOW_REG_CAPABLE(ha) ? *req->out_ptr :
 		    rd_reg_dword(req->req_q_out);
@@ -3142,6 +3148,7 @@ qla28xx_start_scsi_edif(srb_t *sp)
 		mempool_free(sp->u.scmd.ct6_ctx, ha->ctx_mempool);
 		sp->u.scmd.ct6_ctx = NULL;
 	}
+	qla_put_iocbs(sp->qpair, &sp->iores);
 	spin_unlock_irqrestore(lock, flags);
 
 	return QLA_FUNCTION_FAILED;
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 02/10] qla2xxx: edif: send logo for unexpected IKE message
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
  2022-06-08 11:58 ` [PATCH 01/10] qla2xxx: edif: Fix IO timeout due to over subscription Nilesh Javali
@ 2022-06-08 11:58 ` Nilesh Javali
  2022-06-08 11:58 ` [PATCH 03/10] qla2xxx: edif: reduce disruption due to multiple app start Nilesh Javali
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Quinn Tran <qutran@marvell.com>

If session is down and local port continue to receive
AUTH ELS messages for the down session, driver need to
send back LOGO so that remote device knows to tear down
its session. This patch terminate/cleanup the AUTH ELS exchange followed
with a pass through LOGO.

Fixes: 225479296c4f ("scsi: qla2xxx: edif: Reject AUTH ELS on session down")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_edif.c | 19 +++++++++++++++++--
 drivers/scsi/qla2xxx/qla_fw.h   |  2 +-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
index 6a16e16e39f5..d25eb212398e 100644
--- a/drivers/scsi/qla2xxx/qla_edif.c
+++ b/drivers/scsi/qla2xxx/qla_edif.c
@@ -2565,8 +2565,7 @@ void qla24xx_auth_els(scsi_qla_host_t *vha, void **pkt, struct rsp_que **rsp)
 
 	fcport = qla2x00_find_fcport_by_pid(host, &purex->pur_info.pur_sid);
 
-	if (DBELL_INACTIVE(vha) ||
-	    (fcport && EDIF_SESSION_DOWN(fcport))) {
+	if (DBELL_INACTIVE(vha)) {
 		ql_dbg(ql_dbg_edif, host, 0x0910c, "%s e_dbell.db_flags =%x %06x\n",
 		    __func__, host->e_dbell.db_flags,
 		    fcport ? fcport->d_id.b24 : 0);
@@ -2576,6 +2575,22 @@ void qla24xx_auth_els(scsi_qla_host_t *vha, void **pkt, struct rsp_que **rsp)
 		return;
 	}
 
+	if (fcport && EDIF_SESSION_DOWN(fcport)) {
+		ql_dbg(ql_dbg_edif, host, 0x13b6,
+		    "%s terminate exchange. Send logo to 0x%x\n",
+		    __func__, a.did.b24);
+
+		a.tx_byte_count = a.tx_len = 0;
+		a.tx_addr = 0;
+		a.control_flags = EPD_RX_XCHG;  /* EPD_RX_XCHG = terminate cmd */
+		qla_els_reject_iocb(host, (*rsp)->qpair, &a);
+		qla_enode_free(host, ptr);
+		/* send logo to let remote port knows to tear down session */
+		fcport->send_els_logo = 1;
+		qlt_schedule_sess_for_deletion(fcport);
+		return;
+	}
+
 	/* add the local enode to the list */
 	qla_enode_add(host, ptr);
 
diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h
index 0bb1d562f0bf..361015b5763e 100644
--- a/drivers/scsi/qla2xxx/qla_fw.h
+++ b/drivers/scsi/qla2xxx/qla_fw.h
@@ -807,7 +807,7 @@ struct els_entry_24xx {
 #define EPD_ELS_COMMAND		(0 << 13)
 #define EPD_ELS_ACC		(1 << 13)
 #define EPD_ELS_RJT		(2 << 13)
-#define EPD_RX_XCHG		(3 << 13)
+#define EPD_RX_XCHG		(3 << 13)  /* terminate exchange */
 #define ECF_CLR_PASSTHRU_PEND	BIT_12
 #define ECF_INCL_FRAME_HDR	BIT_11
 #define ECF_SEC_LOGIN		BIT_3
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 03/10] qla2xxx: edif: reduce disruption due to multiple app start
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
  2022-06-08 11:58 ` [PATCH 01/10] qla2xxx: edif: Fix IO timeout due to over subscription Nilesh Javali
  2022-06-08 11:58 ` [PATCH 02/10] qla2xxx: edif: send logo for unexpected IKE message Nilesh Javali
@ 2022-06-08 11:58 ` Nilesh Javali
  2022-06-08 11:58 ` [PATCH 04/10] qla2xxx: edif: fix no login after " Nilesh Javali
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Quinn Tran <qutran@marvell.com>

Multiple app start can trigger session bounce.
Driver will skip over session tear down if app start is
seen more than once.

Fixes: 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_edif.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
index d25eb212398e..a4e444ea0363 100644
--- a/drivers/scsi/qla2xxx/qla_edif.c
+++ b/drivers/scsi/qla2xxx/qla_edif.c
@@ -510,8 +510,7 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
 		/* mark doorbell as active since an app is now present */
 		vha->e_dbell.db_flags |= EDB_ACTIVE;
 	} else {
-		ql_dbg(ql_dbg_edif, vha, 0x911e, "%s doorbell already active\n",
-		     __func__);
+		goto out;
 	}
 
 	if (N2N_TOPO(vha->hw)) {
@@ -578,6 +577,7 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
 		     __func__);
 	}
 
+out:
 	appreply.host_support_edif = vha->hw->flags.edif_enabled;
 	appreply.edif_enode_active = vha->pur_cinfo.enode_flags;
 	appreply.edif_edb_active = vha->e_dbell.db_flags;
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 04/10] qla2xxx: edif: fix no login after app start
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
                   ` (2 preceding siblings ...)
  2022-06-08 11:58 ` [PATCH 03/10] qla2xxx: edif: reduce disruption due to multiple app start Nilesh Javali
@ 2022-06-08 11:58 ` Nilesh Javali
  2022-06-08 11:58 ` [PATCH 05/10] qla2xxx: edif: tear down session if keys has been removed Nilesh Javali
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Quinn Tran <qutran@marvell.com>

The scenario is user loaded driver but has not start authentication
app. All sessions to secure device will exhaust all login attempt,
fail and in stay in delete state.
Some time later, app started. Driver will:
replenish the login retry count,
trigger delete to prepare for secure login,
after deletion, relogin is triggered.

For the session that is already deleted, the delete trigger
is a no-op. If none of the session trigger the relogin needed, then
there's no movement.

This patch add a re-login trigger to relogin.

Fixes: 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_edif.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
index a4e444ea0363..dd3593333d7b 100644
--- a/drivers/scsi/qla2xxx/qla_edif.c
+++ b/drivers/scsi/qla2xxx/qla_edif.c
@@ -567,6 +567,7 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
 			qlt_schedule_sess_for_deletion(fcport);
 			qla_edif_sa_ctl_init(vha, fcport);
 		}
+		set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
 	}
 
 	if (vha->pur_cinfo.enode_flags != ENODE_ACTIVE) {
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 05/10] qla2xxx: edif: tear down session if keys has been removed
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
                   ` (3 preceding siblings ...)
  2022-06-08 11:58 ` [PATCH 04/10] qla2xxx: edif: fix no login after " Nilesh Javali
@ 2022-06-08 11:58 ` Nilesh Javali
  2022-06-08 11:58 ` [PATCH 06/10] qla2xxx: edif: fix session thrash Nilesh Javali
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Quinn Tran <qutran@marvell.com>

If all keys for a session has been deleted then
trigger a session tear down.

Fixes: dd30706e73b7 ("scsi: qla2xxx: edif: Add key update")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_def.h | 5 +++++
 drivers/scsi/qla2xxx/qla_isr.c | 1 +
 2 files changed, 6 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 3e78bafa4011..f064dcdbb975 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2158,6 +2158,11 @@ typedef struct {
 #define CS_IOCB_ERROR		0x31	/* Generic error for IOCB request
 					   failure */
 #define CS_REJECT_RECEIVED	0x4E	/* Reject received */
+#define CS_EDIF_AUTH_ERROR	0x63	/* decrypt error */
+#define CS_EDIF_PAD_LEN_ERROR	0x65	/* pad > frame size, not 4byte align */
+#define CS_EDIF_INV_REQ		0x66	/* invalid request */
+#define CS_EDIF_SPI_ERROR	0x67	/* rx frame unable to locate sa */
+#define CS_EDIF_HDR_ERROR	0x69	/* data frame != expected len */
 #define CS_BAD_PAYLOAD		0x80	/* Driver defined */
 #define CS_UNKNOWN		0x81	/* Driver defined */
 #define CS_RETRY		0x82	/* Driver defined */
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 21b31d6359c8..8e6831953e7c 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -3426,6 +3426,7 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
 	case CS_PORT_UNAVAILABLE:
 	case CS_TIMEOUT:
 	case CS_RESET:
+	case CS_EDIF_INV_REQ:
 
 		/*
 		 * We are going to have the fc class block the rport
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 06/10] qla2xxx: edif: fix session thrash
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
                   ` (4 preceding siblings ...)
  2022-06-08 11:58 ` [PATCH 05/10] qla2xxx: edif: tear down session if keys has been removed Nilesh Javali
@ 2022-06-08 11:58 ` Nilesh Javali
  2022-06-08 11:58 ` [PATCH 07/10] qla2xxx: edif: Fix no logout on delete for n2n Nilesh Javali
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Quinn Tran <qutran@marvell.com>

Current code prematurely sends out prli before authentication application
has given the ok to do it. This cause prli failure and session tear down.
This patch prevents prli from going out before authentication
app gives the ok.

Fixes: 91f6f5fbe87b ("scsi: qla2xxx: edif: Reduce connection thrash")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_edif.c |  2 +-
 drivers/scsi/qla2xxx/qla_edif.h |  4 ++++
 drivers/scsi/qla2xxx/qla_init.c | 10 +++++++++-
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
index dd3593333d7b..5ada36acf129 100644
--- a/drivers/scsi/qla2xxx/qla_edif.c
+++ b/drivers/scsi/qla2xxx/qla_edif.c
@@ -3517,7 +3517,7 @@ int qla_edif_process_els(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
 	if (qla_bsg_check(vha, bsg_job, fcport))
 		return 0;
 
-	if (fcport->loop_id == FC_NO_LOOP_ID) {
+	if (EDIF_SESS_DELETE(fcport)) {
 		ql_dbg(ql_dbg_edif, vha, 0x910d,
 		    "%s ELS code %x, no loop id.\n", __func__,
 		    bsg_request->rqst_data.r_els.els_code);
diff --git a/drivers/scsi/qla2xxx/qla_edif.h b/drivers/scsi/qla2xxx/qla_edif.h
index 3561e22b8f0f..7cdb89ccdc6e 100644
--- a/drivers/scsi/qla2xxx/qla_edif.h
+++ b/drivers/scsi/qla2xxx/qla_edif.h
@@ -141,4 +141,8 @@ struct enode {
 	(DBELL_ACTIVE(_fcport->vha) && \
 	 (_fcport->disc_state == DSC_LOGIN_AUTH_PEND))
 
+#define EDIF_SESS_DELETE(_s) \
+	(qla_ini_mode_enabled(_s->vha) && (_s->disc_state == DSC_DELETE_PEND || \
+	 _s->disc_state == DSC_DELETED))
+
 #endif	/* __QLA_EDIF_H */
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index d915c1f85fa2..6070834104f6 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1762,8 +1762,16 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
 		break;
 
 	case DSC_LOGIN_PEND:
-		if (fcport->fw_login_state == DSC_LS_PLOGI_COMP)
+		if (vha->hw->flags.edif_enabled)
+			break;
+
+		if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) {
+			ql_dbg(ql_dbg_disc, vha, 0x2118,
+			       "%s %d %8phC post %s PRLI\n",
+			       __func__, __LINE__, fcport->port_name,
+			       NVME_TARGET(vha->hw, fcport) ? "NVME" : "FC");
 			qla24xx_post_prli_work(vha, fcport);
+		}
 		break;
 
 	case DSC_UPD_FCPORT:
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 07/10] qla2xxx: edif: Fix no logout on delete for n2n
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
                   ` (5 preceding siblings ...)
  2022-06-08 11:58 ` [PATCH 06/10] qla2xxx: edif: fix session thrash Nilesh Javali
@ 2022-06-08 11:58 ` Nilesh Javali
  2022-06-08 11:58 ` [PATCH 08/10] qla2xxx: edif: Reduce N2N thrashing at app_start time Nilesh Javali
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Quinn Tran <qutran@marvell.com>

Driver failed to send implicit logout on
session delete. For edif, this failed to flush any
lingering SA index in FW. This patch set a flag
to turn on implicit logout early in the session recovery
to make sure it would go out in case of error.

Fixes: 4de067e5df12 ("scsi: qla2xxx: edif: Add N2N support for EDIF")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_iocb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 46c879923da1..42ce4e1fe744 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -2882,6 +2882,9 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res)
 	    sp->name, res, sp->handle, fcport->d_id.b24, fcport->port_name);
 
 	fcport->flags &= ~(FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE);
+	/* For edif, set logout on delete to ensure any residual key from FW is flushed.*/
+	fcport->logout_on_delete = 1;
+	fcport->chip_reset = vha->hw->base_qpair->chip_reset;
 
 	if (sp->flags & SRB_WAKEUP_ON_COMP)
 		complete(&lio->u.els_plogi.comp);
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 08/10] qla2xxx: edif: Reduce N2N thrashing at app_start time
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
                   ` (6 preceding siblings ...)
  2022-06-08 11:58 ` [PATCH 07/10] qla2xxx: edif: Fix no logout on delete for n2n Nilesh Javali
@ 2022-06-08 11:58 ` Nilesh Javali
  2022-06-08 11:58 ` [PATCH 09/10] qla2xxx: edif: Fix slow session tear down Nilesh Javali
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Quinn Tran <qutran@marvell.com>

For n2n + remote wwpn is bigger than local adapter,
remote adapter will login to local adapter while authentication
application is not running. When authentication application do
starts, the current session in FW needs to to be invalidate.
This patch make sure the old session is torn down before
triggering a relogin.

Fixes: 4de067e5df12 ("scsi: qla2xxx: edif: Add N2N support for EDIF")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_edif.c | 47 ++++++++++++++++++++++++---------
 1 file changed, 34 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
index 5ada36acf129..9d093b053c32 100644
--- a/drivers/scsi/qla2xxx/qla_edif.c
+++ b/drivers/scsi/qla2xxx/qla_edif.c
@@ -517,11 +517,28 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
 		list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list)
 			fcport->n2n_link_reset_cnt = 0;
 
-		if (vha->hw->flags.n2n_fw_acc_sec)
-			set_bit(N2N_LINK_RESET, &vha->dpc_flags);
-		else
+		if (vha->hw->flags.n2n_fw_acc_sec) {
+			list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list)
+				qla_edif_sa_ctl_init(vha, fcport);
+
+			/*
+			 * While authentication app was not running, remote device
+			 * could still try to login with this local port.  Let's
+			 * clear the state and try again.
+			 */
+			qla2x00_wait_for_sess_deletion(vha);
+
+			/* bounce the link to get the other guy to relogin */
+			if (!vha->hw->flags.n2n_bigger) {
+				set_bit(N2N_LINK_RESET, &vha->dpc_flags);
+				qla2xxx_wake_dpc(vha);
+			}
+		} else {
+			qla2x00_wait_for_hba_online(vha);
 			set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
-		qla2xxx_wake_dpc(vha);
+			qla2xxx_wake_dpc(vha);
+			qla2x00_wait_for_hba_online(vha);
+		}
 	} else {
 		list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
 			ql_dbg(ql_dbg_edif, vha, 0x2058,
@@ -920,17 +937,21 @@ qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
 			if (tdid.b24 != 0 && tdid.b24 != fcport->d_id.b24)
 				continue;
 
-			if (fcport->scan_state != QLA_FCPORT_FOUND)
-				continue;
+			if (!N2N_TOPO(vha->hw)) {
+				if (fcport->scan_state != QLA_FCPORT_FOUND)
+					continue;
 
-			if (fcport->port_type == FCT_UNKNOWN && !fcport->fc4_features)
-				rval = qla24xx_async_gffid(vha, fcport, true);
+				if (fcport->port_type == FCT_UNKNOWN &&
+				    !fcport->fc4_features)
+					rval = qla24xx_async_gffid(vha, fcport,
+								   true);
 
-			if (!rval &&
-			    !(fcport->fc4_features & FC4_FF_TARGET ||
-			      fcport->port_type &
-			      (FCT_TARGET | FCT_NVME_TARGET)))
-				continue;
+				if (!rval &&
+				    !(fcport->fc4_features & FC4_FF_TARGET ||
+				      fcport->port_type &
+				      (FCT_TARGET | FCT_NVME_TARGET)))
+					continue;
+			}
 
 			rval = 0;
 
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 09/10] qla2xxx: edif: Fix slow session tear down
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
                   ` (7 preceding siblings ...)
  2022-06-08 11:58 ` [PATCH 08/10] qla2xxx: edif: Reduce N2N thrashing at app_start time Nilesh Javali
@ 2022-06-08 11:58 ` Nilesh Javali
  2022-06-08 11:58 ` [PATCH 10/10] qla2xxx: Update version to 10.02.07.600-k Nilesh Javali
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

From: Quinn Tran <qutran@marvell.com>

User experience slow recovery when target device went through
a stop/start of the authentication application (app_stop/app_start).

Between the period of app_stop and app_start on the target device,
target device choose to send ELS Reject for any receive AUTH ELS command.
At this time, authentication application does not do els reject
if it encounters error.

Therefore, AUTH ELS reject signify authentication application
is not running. If driver pass up the AUTH ELS Reject to the
authentication application, then it would result in authentication
application retrying/resending the same AUTH ELS command again + delay.

As a work around, driver would trigger a session tear down where
it tell the local authentication application to also tear down.
At the next relogin, both side would be synchronize.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_isr.c | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 8e6831953e7c..d87c53bc014b 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2245,9 +2245,9 @@ qla24xx_els_ct_entry(scsi_qla_host_t *v, struct req_que *req,
 				res = DID_ERROR << 16;
 			}
 
-			if (logit) {
-				if (sp->remap.remapped &&
-				    ((u8 *)sp->remap.rsp.buf)[0] == ELS_LS_RJT) {
+			if (sp->remap.remapped &&
+			    ((u8 *)sp->remap.rsp.buf)[0] == ELS_LS_RJT) {
+				if (logit) {
 					ql_dbg(ql_dbg_user, vha, 0x503f,
 					    "%s IOCB Done LS_RJT hdl=%x comp_status=0x%x\n",
 					    type, sp->handle, comp_status);
@@ -2259,18 +2259,24 @@ qla24xx_els_ct_entry(scsi_qla_host_t *v, struct req_que *req,
 						pkt)->total_byte_count),
 					    e->s_id[0], e->s_id[2], e->s_id[1],
 					    e->d_id[2], e->d_id[1], e->d_id[0]);
-				} else {
-					ql_log(ql_log_info, vha, 0x503f,
-					    "%s IOCB Done hdl=%x comp_status=0x%x\n",
-					    type, sp->handle, comp_status);
-					ql_log(ql_log_info, vha, 0x503f,
-					    "subcode 1=0x%x subcode 2=0x%x bytes=0x%x %02x%02x%02x -> %02x%02x%02x\n",
-					    fw_status[1], fw_status[2],
-					    le32_to_cpu(((struct els_sts_entry_24xx *)
-						pkt)->total_byte_count),
-					    e->s_id[0], e->s_id[2], e->s_id[1],
-					    e->d_id[2], e->d_id[1], e->d_id[0]);
 				}
+				if (sp->fcport && sp->fcport->flags & FCF_FCSP_DEVICE &&
+				    sp->type == SRB_ELS_CMD_HST_NOLOGIN) {
+					ql_dbg(ql_dbg_edif, vha, 0x911e,
+					    "%s rcv reject. Sched delete\n", __func__);
+					qlt_schedule_sess_for_deletion(sp->fcport);
+				}
+			} else if (logit) {
+				ql_log(ql_log_info, vha, 0x503f,
+				    "%s IOCB Done hdl=%x comp_status=0x%x\n",
+				    type, sp->handle, comp_status);
+				ql_log(ql_log_info, vha, 0x503f,
+				    "subcode 1=0x%x subcode 2=0x%x bytes=0x%x %02x%02x%02x -> %02x%02x%02x\n",
+				    fw_status[1], fw_status[2],
+				    le32_to_cpu(((struct els_sts_entry_24xx *)
+				    pkt)->total_byte_count),
+				    e->s_id[0], e->s_id[2], e->s_id[1],
+				    e->d_id[2], e->d_id[1], e->d_id[0]);
 			}
 		}
 		goto els_ct_done;
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 10/10] qla2xxx: Update version to 10.02.07.600-k
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
                   ` (8 preceding siblings ...)
  2022-06-08 11:58 ` [PATCH 09/10] qla2xxx: edif: Fix slow session tear down Nilesh Javali
@ 2022-06-08 11:58 ` Nilesh Javali
  2022-06-09 17:42 ` [PATCH 00/10] Additional EDiF bug fixes Himanshu Madhani
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Nilesh Javali @ 2022-06-08 11:58 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, GR-QLogic-Storage-Upstream

Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_version.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index e5ce7599cae2..0f0fbb391561 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -6,9 +6,9 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "10.02.07.500-k"
+#define QLA2XXX_VERSION      "10.02.07.600-k"
 
 #define QLA_DRIVER_MAJOR_VER	10
 #define QLA_DRIVER_MINOR_VER	2
 #define QLA_DRIVER_PATCH_VER	7
-#define QLA_DRIVER_BETA_VER	500
+#define QLA_DRIVER_BETA_VER	600
-- 
2.19.0.rc0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 00/10] Additional EDiF bug fixes
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
                   ` (9 preceding siblings ...)
  2022-06-08 11:58 ` [PATCH 10/10] qla2xxx: Update version to 10.02.07.600-k Nilesh Javali
@ 2022-06-09 17:42 ` Himanshu Madhani
  2022-06-10 17:04 ` Martin K. Petersen
  2022-06-14  2:23 ` Martin K. Petersen
  12 siblings, 0 replies; 14+ messages in thread
From: Himanshu Madhani @ 2022-06-09 17:42 UTC (permalink / raw)
  To: Nilesh Javali; +Cc: Martin Petersen, linux-scsi, GR-QLogic-Storage-Upstream



> On Jun 8, 2022, at 4:58 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> Martin,
> 
> Please apply the qla2xxx driver additional EDiF bug fixes to the scsi
> tree at your earliest convenience.
> 
> Thanks,
> Nilesh
> 
> Nilesh Javali (1):
>  qla2xxx: Update version to 10.02.07.600-k
> 
> Quinn Tran (9):
>  qla2xxx: edif: Fix IO timeout due to over subscription
>  qla2xxx: edif: send logo for unexpected IKE message
>  qla2xxx: edif: reduce disruption due to multiple app start
>  qla2xxx: edif: fix no login after app start
>  qla2xxx: edif: tear down session if keys has been removed
>  qla2xxx: edif: fix session thrash
>  qla2xxx: edif: Fix no logout on delete for n2n
>  qla2xxx: edif: Reduce N2N thrashing at app_start time
>  qla2xxx: edif: Fix slow session tear down
> 
> drivers/scsi/qla2xxx/qla_def.h     |  5 ++
> drivers/scsi/qla2xxx/qla_edif.c    | 80 +++++++++++++++++++++++-------
> drivers/scsi/qla2xxx/qla_edif.h    |  4 ++
> drivers/scsi/qla2xxx/qla_fw.h      |  2 +-
> drivers/scsi/qla2xxx/qla_init.c    | 10 +++-
> drivers/scsi/qla2xxx/qla_iocb.c    |  3 ++
> drivers/scsi/qla2xxx/qla_isr.c     | 35 +++++++------
> drivers/scsi/qla2xxx/qla_version.h |  4 +-
> 8 files changed, 107 insertions(+), 36 deletions(-)
> 
> 
> base-commit: 3fd3a52ca672fea71ff6ebaded2e2ddbbfb3a397
> -- 
> 2.19.0.rc0
> 

The Series looks Good.

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	Oracle Linux Engineering


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 00/10] Additional EDiF bug fixes
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
                   ` (10 preceding siblings ...)
  2022-06-09 17:42 ` [PATCH 00/10] Additional EDiF bug fixes Himanshu Madhani
@ 2022-06-10 17:04 ` Martin K. Petersen
  2022-06-14  2:23 ` Martin K. Petersen
  12 siblings, 0 replies; 14+ messages in thread
From: Martin K. Petersen @ 2022-06-10 17:04 UTC (permalink / raw)
  To: Nilesh Javali; +Cc: martin.petersen, linux-scsi, GR-QLogic-Storage-Upstream


Nilesh,

> Please apply the qla2xxx driver additional EDiF bug fixes to the scsi
> tree at your earliest convenience.

Applied to 5.20/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 00/10] Additional EDiF bug fixes
  2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
                   ` (11 preceding siblings ...)
  2022-06-10 17:04 ` Martin K. Petersen
@ 2022-06-14  2:23 ` Martin K. Petersen
  12 siblings, 0 replies; 14+ messages in thread
From: Martin K. Petersen @ 2022-06-14  2:23 UTC (permalink / raw)
  To: Nilesh Javali; +Cc: Martin K . Petersen, linux-scsi, GR-QLogic-Storage-Upstream

On Wed, 8 Jun 2022 04:58:39 -0700, Nilesh Javali wrote:

> Martin,
> 
> Please apply the qla2xxx driver additional EDiF bug fixes to the scsi
> tree at your earliest convenience.
> 
> Thanks,
> Nilesh
> 
> [...]

Applied to 5.20/scsi-queue, thanks!

[01/10] qla2xxx: edif: Fix IO timeout due to over subscription
        https://git.kernel.org/mkp/scsi/c/63ab6cb582fa
[02/10] qla2xxx: edif: send logo for unexpected IKE message
        https://git.kernel.org/mkp/scsi/c/2b659ed67a12
[03/10] qla2xxx: edif: reduce disruption due to multiple app start
        https://git.kernel.org/mkp/scsi/c/0dbfce5255fe
[04/10] qla2xxx: edif: fix no login after app start
        https://git.kernel.org/mkp/scsi/c/24c796098f53
[05/10] qla2xxx: edif: tear down session if keys has been removed
        https://git.kernel.org/mkp/scsi/c/d7e2e4a68fc0
[06/10] qla2xxx: edif: fix session thrash
        https://git.kernel.org/mkp/scsi/c/a8fdfb0b39c2
[07/10] qla2xxx: edif: Fix no logout on delete for n2n
        https://git.kernel.org/mkp/scsi/c/ec538eb838f3
[08/10] qla2xxx: edif: Reduce N2N thrashing at app_start time
        https://git.kernel.org/mkp/scsi/c/37be3f9d6993
[09/10] qla2xxx: edif: Fix slow session tear down
        https://git.kernel.org/mkp/scsi/c/bcf536072f74
[10/10] qla2xxx: Update version to 10.02.07.600-k
        https://git.kernel.org/mkp/scsi/c/0f4d7d556125

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-06-14  4:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 11:58 [PATCH 00/10] Additional EDiF bug fixes Nilesh Javali
2022-06-08 11:58 ` [PATCH 01/10] qla2xxx: edif: Fix IO timeout due to over subscription Nilesh Javali
2022-06-08 11:58 ` [PATCH 02/10] qla2xxx: edif: send logo for unexpected IKE message Nilesh Javali
2022-06-08 11:58 ` [PATCH 03/10] qla2xxx: edif: reduce disruption due to multiple app start Nilesh Javali
2022-06-08 11:58 ` [PATCH 04/10] qla2xxx: edif: fix no login after " Nilesh Javali
2022-06-08 11:58 ` [PATCH 05/10] qla2xxx: edif: tear down session if keys has been removed Nilesh Javali
2022-06-08 11:58 ` [PATCH 06/10] qla2xxx: edif: fix session thrash Nilesh Javali
2022-06-08 11:58 ` [PATCH 07/10] qla2xxx: edif: Fix no logout on delete for n2n Nilesh Javali
2022-06-08 11:58 ` [PATCH 08/10] qla2xxx: edif: Reduce N2N thrashing at app_start time Nilesh Javali
2022-06-08 11:58 ` [PATCH 09/10] qla2xxx: edif: Fix slow session tear down Nilesh Javali
2022-06-08 11:58 ` [PATCH 10/10] qla2xxx: Update version to 10.02.07.600-k Nilesh Javali
2022-06-09 17:42 ` [PATCH 00/10] Additional EDiF bug fixes Himanshu Madhani
2022-06-10 17:04 ` Martin K. Petersen
2022-06-14  2:23 ` Martin K. Petersen

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.