qla2x00t-32gbit: edif: Do secure PLOGI when auth app is present

For initiator mode, always do secure login when authentication app started.
Also remove redundant flags to indicate secure connection.

Link: https://lore.kernel.org/r/20210817051315.2477-7-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 1dc64a360bda55d632202e3fef266cef7d4f6f00 upstream ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9559 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2021-09-05 15:45:07 +00:00
parent 6e3fa20e65
commit d2312b6268
5 changed files with 10 additions and 14 deletions
-2
View File
@@ -2650,7 +2650,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;
@@ -2661,7 +2660,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;
+3 -3
View File
@@ -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:
+2 -5
View File
@@ -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;
+4 -1
View File
@@ -1558,6 +1558,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;
@@ -1916,7 +1919,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 */
+1 -3
View File
@@ -651,10 +651,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;