From: Hannes Reinecke <hare@suse.com>
To: Anastasia Kovaleva <a.kovaleva@yadro.com>, 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, nab@linux-iscsi.org,
himanshu.madhani@cavium.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, linux@yadro.com
Subject: Re: [PATCH 2/3] scsi: qla2xxx: make target send correct LOGO
Date: Wed, 9 Oct 2024 08:32:06 +0200 [thread overview]
Message-ID: <3b57fcc4-919f-4e50-80a4-04da24f61857@suse.com> (raw)
In-Reply-To: <20241008132402.26164-3-a.kovaleva@yadro.com>
On 10/8/24 15:24, Anastasia Kovaleva wrote:
> 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>
> ---
> 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
Now that looks like serious debugging. Well done.
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.com +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2024-10-09 6:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-08 13:23 [PATCH 0/3] Fix bugs in qla2xxx driver Anastasia Kovaleva
2024-10-08 13:24 ` [PATCH 1/3] scsi: qla2xxx: Drop starvation counter on success Anastasia Kovaleva
2024-10-09 6:30 ` Hannes Reinecke
2024-10-08 13:24 ` [PATCH 2/3] scsi: qla2xxx: make target send correct LOGO Anastasia Kovaleva
2024-10-09 6:32 ` Hannes Reinecke [this message]
2024-10-08 13:24 ` [PATCH 3/3] scsi: qla2xxx: Remove incorrect trap Anastasia Kovaleva
2024-10-09 6:33 ` Hannes Reinecke
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=3b57fcc4-919f-4e50-80a4-04da24f61857@suse.com \
--to=hare@suse.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=a.kovaleva@yadro.com \
--cc=bvanassche@acm.org \
--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=nab@linux-iscsi.org \
--cc=njavali@marvell.com \
--cc=quinn.tran@cavium.com \
--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