From: Nilesh Javali <njavali@marvell.com>
To: <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, <GR-QLogic-Storage-Upstream@marvell.com>
Subject: [PATCH 06/12] qla2xxx: edif: do secure plogi when auth app is present
Date: Mon, 16 Aug 2021 22:13:09 -0700 [thread overview]
Message-ID: <20210817051315.2477-7-njavali@marvell.com> (raw)
In-Reply-To: <20210817051315.2477-1-njavali@marvell.com>
From: Quinn Tran <qutran@marvell.com>
For initiator mode, always do secure login when authentication app started.
Also remove redundant flags to indicate secure connection.
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
drivers/scsi/qla2xxx/qla_def.h | 2 --
drivers/scsi/qla2xxx/qla_edif.c | 6 +++---
drivers/scsi/qla2xxx/qla_init.c | 7 ++-----
drivers/scsi/qla2xxx/qla_iocb.c | 5 ++++-
drivers/scsi/qla2xxx/qla_target.c | 4 +---
5 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 031107b6024f..ddc6932f05fa 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2620,7 +2620,6 @@ typedef struct fc_port {
uint32_t enable:1; /* device is edif enabled/req'd */
uint32_t app_stop:2;
uint32_t app_started:1;
- uint32_t secured_login:1;
uint32_t aes_gmac:1;
uint32_t app_sess_online:1;
uint32_t tx_sa_set:1;
@@ -2631,7 +2630,6 @@ typedef struct fc_port {
uint32_t rx_rekey_cnt;
uint64_t tx_bytes;
uint64_t rx_bytes;
- uint8_t non_secured_login;
uint8_t auth_state;
uint16_t authok:1;
uint16_t rekey_cnt;
diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
index bb5cda85b60f..dc10874a0c99 100644
--- a/drivers/scsi/qla2xxx/qla_edif.c
+++ b/drivers/scsi/qla2xxx/qla_edif.c
@@ -568,7 +568,7 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
if (atomic_read(&vha->loop_state) == LOOP_DOWN)
break;
- if (!fcport->edif.secured_login)
+ if (!(fcport->flags & FCF_FCSP_DEVICE))
continue;
fcport->edif.app_started = 1;
@@ -647,7 +647,7 @@ qla_edif_app_stop(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
qla_edb_stop(vha); /* stop db */
list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
- if (fcport->edif.non_secured_login)
+ if (!(fcport->flags & FCF_FCSP_DEVICE))
continue;
if (fcport->flags & FCF_FCSP_DEVICE) {
@@ -948,7 +948,7 @@ qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
ql_dbg(ql_dbg_edif, vha, 0x2058,
"Found FC_SP fcport - nn %8phN pn %8phN pcnt %d portid=%06x secure %d.\n",
fcport->node_name, fcport->port_name, pcnt,
- fcport->d_id.b24, fcport->edif.secured_login);
+ fcport->d_id.b24, fcport->flags & FCF_FCSP_DEVICE);
switch (fcport->edif.auth_state) {
case VND_CMD_AUTH_STATE_ELS_RCVD:
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 4c5acfde0788..7e6fb4ad4255 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1435,18 +1435,15 @@ static int qla_chk_secure_login(scsi_qla_host_t *vha, fc_port_t *fcport,
ql_dbg(ql_dbg_disc, vha, 0x104d,
"Secure Login established on %8phC\n",
fcport->port_name);
- fcport->edif.secured_login = 1;
- fcport->edif.non_secured_login = 0;
fcport->flags |= FCF_FCSP_DEVICE;
} else {
ql_dbg(ql_dbg_disc, vha, 0x104d,
"non-Secure Login %8phC",
fcport->port_name);
- fcport->edif.secured_login = 0;
- fcport->edif.non_secured_login = 1;
+ fcport->flags &= ~FCF_FCSP_DEVICE;
}
if (vha->hw->flags.edif_enabled) {
- if (fcport->edif.secured_login) {
+ if (fcport->flags & FCF_FCSP_DEVICE) {
qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_AUTH_PEND);
/* Start edif prli timer & ring doorbell for app */
fcport->edif.rx_sa_set = 0;
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index eef1fa2b45c2..9d4ad1d2b00a 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -1552,6 +1552,9 @@ qla24xx_start_scsi(srb_t *sp)
struct scsi_qla_host *vha = sp->vha;
struct qla_hw_data *ha = vha->hw;
+ if (sp->fcport->edif.enable && (sp->fcport->flags & FCF_FCSP_DEVICE))
+ return qla28xx_start_scsi_edif(sp);
+
/* Setup device pointers. */
req = vha->req;
rsp = req->rsp;
@@ -1910,7 +1913,7 @@ qla2xxx_start_scsi_mq(srb_t *sp)
struct qla_hw_data *ha = vha->hw;
struct qla_qpair *qpair = sp->qpair;
- if (sp->fcport->edif.enable)
+ if (sp->fcport->edif.enable && (sp->fcport->flags & FCF_FCSP_DEVICE))
return qla28xx_start_scsi_edif(sp);
/* Acquire qpair specific lock */
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 2f4da88995ea..b3478ed9b12e 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -636,10 +636,8 @@ int qla24xx_async_notify_ack(scsi_qla_host_t *vha, fc_port_t *fcport,
fcport->fw_login_state = DSC_LS_PLOGI_PEND;
c = "PLOGI";
if (vha->hw->flags.edif_enabled &&
- (le16_to_cpu(ntfy->u.isp24.flags) & NOTIFY24XX_FLAGS_FCSP)) {
+ (le16_to_cpu(ntfy->u.isp24.flags) & NOTIFY24XX_FLAGS_FCSP))
fcport->flags |= FCF_FCSP_DEVICE;
- fcport->edif.secured_login = 1;
- }
break;
case SRB_NACK_PRLI:
fcport->fw_login_state = DSC_LS_PRLI_PEND;
--
2.23.1
next prev parent reply other threads:[~2021-08-17 5:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-17 5:13 [PATCH 00/12] qla2xxx driver bug fixes Nilesh Javali
2021-08-17 5:13 ` [PATCH 01/12] qla2xxx: edif: Fix stale session Nilesh Javali
2021-08-17 5:13 ` [PATCH 02/12] qla2xxx: edif: reject AUTH ELS on session down Nilesh Javali
2021-08-17 5:13 ` [PATCH 03/12] qla2xxx: edif: fix edif enable flag Nilesh Javali
2021-08-17 5:13 ` [PATCH 04/12] qla2xxx: Fix hang during NVME session tear down Nilesh Javali
2021-08-17 5:13 ` [PATCH 05/12] qla2xxx: edif: add N2N support for EDIF Nilesh Javali
2021-08-17 5:13 ` Nilesh Javali [this message]
2021-08-17 5:13 ` [PATCH 07/12] qla2xxx: fix NVME | FCP personality change Nilesh Javali
2021-08-17 5:13 ` [PATCH 08/12] qla2xxx: Fix hang on NVME command timeouts Nilesh Javali
2021-08-17 5:13 ` [PATCH 09/12] qla2xxx: fix NVME retry Nilesh Javali
2021-08-17 5:13 ` [PATCH 10/12] qla2xxx: fix NVME session down detection Nilesh Javali
2021-08-17 5:13 ` [PATCH 11/12] qla2xxx: edif: fix returnvar.cocci warnings Nilesh Javali
2021-08-17 5:13 ` [PATCH 12/12] qla2xxx: Update version to 10.02.06.200-k Nilesh Javali
2021-08-24 3:05 ` [PATCH 00/12] qla2xxx driver bug fixes Martin K. Petersen
2021-08-28 2:32 ` Martin K. Petersen
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=20210817051315.2477-7-njavali@marvell.com \
--to=njavali@marvell.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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.