From nobody Wed Nov 27 14:27:26 2024 Received: from mta-03.yadro.com (mta-03.yadro.com [89.207.88.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C31CF194C8B; Thu, 10 Oct 2024 16:34:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.207.88.253 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728578056; cv=none; b=htiACvJN5lsChqtAVv0S/N8fFQLdqf18vlKCCmv2eYKc5Z3OndK+3x+g1+MGxFVYwzEJXqx8g9MNiO+QtaeeLToXGNXMEQi2a8yZMsmI//rkH0d5stouReWdPCLdJz4e+3trMHU9NkUsRqM4QEnCInJQOZBKt4v9bbkc8p46Omg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728578056; c=relaxed/simple; bh=tr8pkrnOXKz7zS3wPd0Hnto0kzymsME6yt2kXtU/XWI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pV2cD/ZXTeXEpPORpLwN7i2myI3By3sly7J7ojj87HbxiwBRr9F7QNk6iLPRTy1tp2yXFTere9QkB4oSfNws02rtiZ/axeRVwvWJZUKazC1QehmMmJiIQ2eUgB53TaCp+xibpSGNPxORXlXZiYVs6wSwIX8Fhnsbu6BOamh5Rck= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yadro.com; spf=pass smtp.mailfrom=yadro.com; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b=Lkr3JkP6; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b=TywZBUkJ; arc=none smtp.client-ip=89.207.88.253 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yadro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yadro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b="Lkr3JkP6"; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b="TywZBUkJ" DKIM-Filter: OpenDKIM Filter v2.11.0 mta-03.yadro.com E54B9E0002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yadro.com; s=mta-04; t=1728578050; bh=Sh3HKrB3v+QaFjAI8p9VP95XJqBlxSmNtlnT9W1h0mE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=Lkr3JkP6sdodiK5awbExfLhvsfj/nZKU1t2fxT/IlVxA3PFDfZIlGfTDsJyx+jsm3 r55BZA/9gayaRHmTtvbLzbcI6BWo/pgoOTesWoZCkzZEk1JaxHE2BujPs9K7sUJLtQ U2NjBN7T7okZHm9D2JdVnzns2lubfKzcw/KCOG9R6ZB0T0f2UJr5N3aAopBykucG+3 vkgmRZIlMP0I/mBhSwilUussG06U3Y6sF125+jTHn1WlNPyb2h0F++QOAtmCvH1G3a QxceOY8m7qDgrPdsfC1Ohba0hX/Iv0A9iu6ErM5yyFTeVs2d25BDGnKul3q9+KVaxc s7djBIy9J7npw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yadro.com; s=mta-03; t=1728578050; bh=Sh3HKrB3v+QaFjAI8p9VP95XJqBlxSmNtlnT9W1h0mE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=TywZBUkJZs2EeclEEQediS/df367he4eaYziBNWgXkzVDs7y9Ycy4nd6tlTPI1/Tn vl5aiMya1BKYAU/gjFtZ5o82NHJ2hRszAHOvIfXJZn5s7hAsh0Or9ylkRPEhY0PmJ5 EXNojojOfjt/f3t86kSmxaSTF9I+rUaFGa9SsUpmjF6lhHNeTCns0jyZAEZ+5c2h4O CK6hXVkhm++kfI9YVt0NQIuBQ7obiT2N99T/Lk3Cwh2AdEqvrYJQ+LOLyITLONd//W RhD1SpHYrOr244A+Eww9t+5pJjbqhGp8xYDiPwarRYcy9bSOO960YQNxIc2T6l8eqc uKn+y+fw8dodw== From: Anastasia Kovaleva To: CC: , , , , , , , , , , , Subject: [PATCH v3 1/3] scsi: qla2xxx: Drop starvation counter on success Date: Thu, 10 Oct 2024 19:32:35 +0300 Message-ID: <20241010163236.27969-2-a.kovaleva@yadro.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241010163236.27969-1-a.kovaleva@yadro.com> References: <20241010163236.27969-1-a.kovaleva@yadro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: T-EXCH-08.corp.yadro.com (172.17.11.58) To T-EXCH-09.corp.yadro.com (172.17.11.59) Content-Type: text/plain; charset="utf-8" Long-lived sessions under high load can accumulate a starvation counter, and the current implementation does not allow this counter to be reset during an active session. If HBA sends correct ATIO IOCB, then it has enough resources to process commands and we should not call ISP recovery. Cc: stable@vger.kernel.org Fixes: ead038556f64 ("qla2xxx: Add Dual mode support in the driver") Signed-off-by: Anastasia Kovaleva Reviewed-by: Dmitry Bogdanov Reviewed-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_isr.c | 4 ++++ drivers/scsi/qla2xxx/qla_target.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index fe98c76e9be3..5234ce0985e0 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1959,6 +1959,10 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp= _que *rsp, uint16_t *mb) ql_dbg(ql_dbg_async, vha, 0x5091, "Transceiver Removal\n"); break; =20 + case MBA_REJECTED_FCP_CMD: + ql_dbg(ql_dbg_async, vha, 0x5092, "LS_RJT was sent. No resources to proc= ess the ELS request.\n"); + break; + default: ql_dbg(ql_dbg_async, vha, 0x5057, "Unknown AEN:%04x %04x %04x %04x\n", diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_t= arget.c index d7551b1443e4..0a82360141f8 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -6826,6 +6826,12 @@ qlt_24xx_process_atio_queue(struct scsi_qla_host *vh= a, uint8_t ha_locked) qlt_send_term_exchange(ha->base_qpair, NULL, pkt, ha_locked, 0); } else { + /* + * If we get correct ATIO, then HBA had enough memory + * to proceed without reset. + */ + WRITE_ONCE(vha->hw->exch_starvation, 0); + qlt_24xx_atio_pkt_all_vps(vha, (struct atio_from_isp *)pkt, ha_locked); } --=20 2.40.1 From nobody Wed Nov 27 14:27:27 2024 Received: from mta-03.yadro.com (mta-03.yadro.com [89.207.88.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3F68199953; Thu, 10 Oct 2024 16:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.207.88.253 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728578060; cv=none; b=eL7Lw8WmHELaQB7S1MVk8k/V35ekqiMypyP6QKpqjGVjYnNEfkVh2JzZx7KuuN7h5m0vgiG7t/Y7U34lR9lR7MY2+Of3lvZ4Vp392butV0ew1hSFlkrRzKrQJSxn+qPzGzRJvtrVpRI8Nq9ckVQm8Z8oZPgd1PNnOEaNvmeV2dA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728578060; c=relaxed/simple; bh=jX1uoF/xVPYo21MqB7dsU8yhpGsO+KbGGO9Ppcm5jfw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iOzyuW3pPBHb2XteIIiEJ1UR9lav6ymXWkaJ4XPwsFEP1FUm2vp6oGmc902TwdY9DDzq06YPgJkYwiUyu66NkCRv0OI6+tFAmuqyLsm3HLXjlxFMQ7+VAdXz2/7qJHDyIpVrQlyvSoMzSSH43seK+Su8NdQy2oKBdNVOFFpce8s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yadro.com; spf=pass smtp.mailfrom=yadro.com; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b=uGohvMJK; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b=xbAygLX9; arc=none smtp.client-ip=89.207.88.253 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yadro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yadro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b="uGohvMJK"; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b="xbAygLX9" DKIM-Filter: OpenDKIM Filter v2.11.0 mta-03.yadro.com BBD4AE0017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yadro.com; s=mta-04; t=1728578055; bh=+YjavEWhSNeqF2WBLHzVdKYfyqUtmnkfa9L0UPfNSw4=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=uGohvMJKhqAraKBMBms61jVH/S6Lcc7AQeNca6zAUERMsfu5t5cKdiNWgXnB76meS 8zrLNKAaHojpOQHbiq/3IvFubJzXFC+KNyzyX7oCaVaRplN8JRsZvYZv/rGngECbr+ jl9a9pueLQYNeT3fOAyCia7emsLD3KSbKFDTrlHyUkqwI/rT+3oQuqBguf+C4WUq3K avoy39uHZbn8ulGQ2Jh58utnK6HIrPfcjZXaN3mC2lh2EPS6sEEiQ5sGmbUo7LzegA Vb39WtIdIUCVfhH0O1uPYy9YE2l6GOyLbZ6ouCQSsPDvs5H7t2UgBEARMHDBzizbU8 ofm+opMrDL+uA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yadro.com; s=mta-03; t=1728578055; bh=+YjavEWhSNeqF2WBLHzVdKYfyqUtmnkfa9L0UPfNSw4=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=xbAygLX9AwcWMh0g1BZf5vqGiuvRGIVw9hR420PIZOH7xvIF5MPPzmuU6Y1u0Z1Ze 2JsF4goTz3+k6+dzaM6f3L4/M362Pfr9nv/ZnjLDVDUJDt/aS76CTDMrO9tJq2fc66 pf8lvvA3vXQANrq2GWhaGBh9Bhnou+CQ7UuUKnlkx74OFiKSnh+WDwLK3gNZUsETns kOZKjVgE7PCwLgqRqtkx8W/nF5tW0Zx43dgAwmem3A/7yqfV2N+cWoKqiC4MWIb/Qd UX3lU95wKwGtCWvvH5YGKVllrnXWWkOwJu/wDxz+mCuG7byXyVPj8tsU3mexqlwysV wRVf8AsRMs0xA== From: Anastasia Kovaleva To: CC: , , , , , , , , , , , Subject: [PATCH v3 2/3] scsi: qla2xxx: Make target send correct LOGO Date: Thu, 10 Oct 2024 19:32:36 +0300 Message-ID: <20241010163236.27969-3-a.kovaleva@yadro.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241010163236.27969-1-a.kovaleva@yadro.com> References: <20241010163236.27969-1-a.kovaleva@yadro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: T-EXCH-06.corp.yadro.com (172.17.10.110) To T-EXCH-09.corp.yadro.com (172.17.11.59) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Dmitry Bogdanov Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani --- 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_ioc= b.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_24= xx *logio) logio->port_id[1] =3D sp->fcport->d_id.b.area; logio->port_id[2] =3D sp->fcport->d_id.b.domain; logio->vp_index =3D sp->vha->vp_idx; + logio->io_parameter[0] =3D 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] =3D 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] =3D 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); } =20 static void --=20 2.40.1 From nobody Wed Nov 27 14:27:27 2024 Received: from mta-03.yadro.com (mta-03.yadro.com [89.207.88.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87DAF199FA2; Thu, 10 Oct 2024 16:34:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.207.88.253 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728578062; cv=none; b=lb3LdpvMy31ZMzhOBY/or8iunlEh8eMIz5Cpb6cwY37l942QspGx9tnHV6Uur6sRrgkSXOCig05QIG3C1eJLOyatIeJyb5jVIBxSW79ATr1LR1ZvzNcepi3djU796TLFtv2Lr9X45TjfMJp3298FsHxPQAiDMGni446LrpdNbIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728578062; c=relaxed/simple; bh=wvb8X9iXh1YzBeg65BelV1fZ5HxBj+DXRWco+WsOfG4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gPKGLJzKDLF4l22Cciez/omTpR3zzpoCUHc5kXM9tTplJggHgwM7usojH3+RWrGwoeZw9vrjlTFDgeWYgn0UGwclZ3VJ6DspV+L2DlkKqAQ2DxcykrZRczCugZFx3oe5pys0EFZ49reMmo5nowgo0QpRpiw0bDwK1AGZjWKEkYI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yadro.com; spf=pass smtp.mailfrom=yadro.com; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b=PJxHyJLX; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b=uv7OwiuR; arc=none smtp.client-ip=89.207.88.253 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yadro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yadro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b="PJxHyJLX"; dkim=pass (2048-bit key) header.d=yadro.com header.i=@yadro.com header.b="uv7OwiuR" DKIM-Filter: OpenDKIM Filter v2.11.0 mta-03.yadro.com 00F84E0002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yadro.com; s=mta-04; t=1728578057; bh=Fz+WYqdvn39bUA1V6fkpoN6K3evri9MLq+McbaOga8E=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=PJxHyJLXnJ1o3wvROix7TsJVEJePVuiimJX5ccKwTvA31qHFLoxVNlQcXoiuQrYoR T1K7wEnsRF7s0e7q6/fZh4rAI8chcWQmLdvMFmh1ATNyQ3cH8GvNp0RHa3xXc8MWo8 oBy9C7VCW5/o+6GHGB7wf6Vf3cDViyVv2dt+SNMcSCoKKXQp8yt1a4ucbS2qs7LiI4 p8O/JuLTjM2HcRnwf8Wb4Rt+PrGba7QLbEwu1LLtDutCWUK/7v9Ew2D1s58VjI8qqw n7wo2LQRNxeixerTkJZV0YnKtJz3imT+wDJKVuURhOar9RjgXBoN01V+d/nYr7M0Sd BEIBgl/wg1JwA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yadro.com; s=mta-03; t=1728578057; bh=Fz+WYqdvn39bUA1V6fkpoN6K3evri9MLq+McbaOga8E=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=uv7OwiuR8PiMOZVYDPqnCPKimdDTyX/0PtTc1gOKf4EDaftpvyUt8928vVamzXRL4 vzUMeK9Eg2BAyjl6KL18RkXEA7jXPjWRHTf/s5VBQt3WwiMaY1rT39IKJ6Lyew3NsF h5ej3RwbItTJznFLNaD/D/km3BdacRdCQv325dWzW9wx+OsXNmD96iMiS/Qph//rvs VoVy0fWkFbETWcUBmKkPkO36k9g/jMX2cpWwipfW2N1KAmE87LdETqrKaygQ39Yd2n LTj8NCN/X6sH6EmKpNXR3AhCpqK28c9+v1tk4Ai1cas7ZzdrAz6TkuWQXaZlRvKjMV fPCSXdpkUjgHw== From: Anastasia Kovaleva To: CC: , , , , , , , , , , , Subject: [PATCH v3 3/3] scsi: qla2xxx: Remove incorrect trap Date: Thu, 10 Oct 2024 19:32:37 +0300 Message-ID: <20241010163236.27969-4-a.kovaleva@yadro.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241010163236.27969-1-a.kovaleva@yadro.com> References: <20241010163236.27969-1-a.kovaleva@yadro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: T-EXCH-07.corp.yadro.com (172.17.11.57) To T-EXCH-09.corp.yadro.com (172.17.11.59) Content-Type: text/plain; charset="utf-8" This BUG_ON() is triggered when there is no fc_port with a certain loop ID in the scsi host vp_fcports list, but there is one in lport_loopid_map. As these two data structures do not change simultaneously and atomically, such a trap is invalid. Cc: stable@vger.kernel.org Fixes: 726b85487067 ("qla2xxx: Add framework for async fabric discovery") Signed-off-by: Anastasia Kovaleva Reviewed-by: Dmitry Bogdanov Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_t= arget.c index 0a82360141f8..6f359677f554 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -5190,15 +5190,7 @@ static int qlt_24xx_handle_els(struct scsi_qla_host = *vha, ql_dbg(ql_dbg_disc, vha, 0x20fc, "%s: logo %llx res %d sess %p ", __func__, wwn, res, sess); - if (res =3D=3D 0) { - /* - * cmd went upper layer, look for qlt_xmit_tm_rsp() - * for LOGO_ACK & sess delete - */ - BUG_ON(!sess); - res =3D 0; - } else { - /* cmd did not go to upper layer. */ + if (res) { if (sess) { qlt_schedule_sess_for_deletion(sess); res =3D 0; --=20 2.40.1