From: Anastasia Kovaleva <a.kovaleva@yadro.com>
To: <target-devel@vger.kernel.org>
Cc: <njavali@marvell.com>, <GR-QLogic-Storage-Upstream@marvell.com>,
<James.Bottomley@HansenPartnership.com>,
<martin.petersen@oracle.com>, <bvanassche@acm.org>,
<quinn.tran@cavium.com>, <himanshu.madhani@cavium.com>,
<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux@yadro.com>, <hare@suse.de>, <stable@vger.kernel.org>
Subject: [PATCH v2 2/3] scsi: qla2xxx: Make target send correct LOGO
Date: Wed, 9 Oct 2024 14:16:53 +0300 [thread overview]
Message-ID: <20241009111654.4697-3-a.kovaleva@yadro.com> (raw)
In-Reply-To: <20241009111654.4697-1-a.kovaleva@yadro.com>
Upon removing the ACL from the target, it sends a LOGO command to the
initiator to break the connection. But HBA fills port_name and port_id
of the LOGO command with all zeroes, which is not valid. The initiator
sends a reject for this command, but it is not being processed on the
target, since it assumes LOGO can never fail. This leaves a system in a
state where the initiator thinks it is still logged in to the target and
can send commands to it, but the target ignores all incoming commands
from this initiator.
If, in such a situation, the initiator sends some command (e.g. during a
scan), after not receiving a response for a timeout duration, it sends
ABORT for the command. After a timeout on receiving an ABORT response,
the initiator sends LOGO to the target. Only after that, the initiator
can successfully relogin to the target and restore the connection. In
the end, this whole situation hangs the system for approximately a
minute.
By default, the driver sends a LOGO command to HBA filling only port_id,
expecting HBA to match port_id with the correct port_name from it's
internal table. HBA doesn't do that, instead filling these fields with
all zeroes.
This patch makes the driver send a LOGO command to HBA with port_name
and port_id in the I/O PARMETER fields. HBA then copies these values to
corresponding fields in the LOGO command frame.
Signed-off-by: Anastasia Kovaleva <a.kovaleva@yadro.com>
Reviewed-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
drivers/scsi/qla2xxx/qla_iocb.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 0b41e8a06602..90026fca14dc 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -2486,6 +2486,17 @@ qla24xx_logout_iocb(srb_t *sp, struct logio_entry_24xx *logio)
logio->port_id[1] = sp->fcport->d_id.b.area;
logio->port_id[2] = sp->fcport->d_id.b.domain;
logio->vp_index = sp->vha->vp_idx;
+ logio->io_parameter[0] = cpu_to_le32(sp->vha->d_id.b.al_pa |
+ sp->vha->d_id.b.area << 8 |
+ sp->vha->d_id.b.domain << 16);
+ logio->io_parameter[1] = cpu_to_le32(sp->vha->port_name[3] |
+ sp->vha->port_name[2] << 8 |
+ sp->vha->port_name[1] << 16 |
+ sp->vha->port_name[0] << 24);
+ logio->io_parameter[2] = cpu_to_le32(sp->vha->port_name[7] |
+ sp->vha->port_name[6] << 8 |
+ sp->vha->port_name[5] << 16 |
+ sp->vha->port_name[4] << 24);
}
static void
--
2.40.1
next prev parent reply other threads:[~2024-10-09 11:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 11:16 [PATCH v2 0/3] Fix bugs in qla2xxx driver Anastasia Kovaleva
2024-10-09 11:16 ` [PATCH v2 1/3] scsi: qla2xxx: Drop starvation counter on success Anastasia Kovaleva
2024-10-10 14:57 ` kernel test robot
2024-10-10 16:39 ` kernel test robot
2024-10-09 11:16 ` Anastasia Kovaleva [this message]
2024-10-09 11:16 ` [PATCH v2 3/3] scsi: qla2xxx: Remove incorrect trap Anastasia Kovaleva
2024-10-09 19:28 ` [PATCH v2 0/3] Fix bugs in qla2xxx driver Himanshu Madhani
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=20241009111654.4697-3-a.kovaleva@yadro.com \
--to=a.kovaleva@yadro.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=bvanassche@acm.org \
--cc=hare@suse.de \
--cc=himanshu.madhani@cavium.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@yadro.com \
--cc=martin.petersen@oracle.com \
--cc=njavali@marvell.com \
--cc=quinn.tran@cavium.com \
--cc=stable@vger.kernel.org \
--cc=target-devel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox