From patchwork Tue Jan 16 04:46:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10165967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2D07D6055D for ; Tue, 16 Jan 2018 04:47:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1752427FAE for ; Tue, 16 Jan 2018 04:47:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BF2627FB3; Tue, 16 Jan 2018 04:47:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E3EE27FB0 for ; Tue, 16 Jan 2018 04:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751372AbeAPErP (ORCPT ); Mon, 15 Jan 2018 23:47:15 -0500 Received: from mail-sn1nam01on0042.outbound.protection.outlook.com ([104.47.32.42]:19172 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751356AbeAPErL (ORCPT ); Mon, 15 Jan 2018 23:47:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=eCVtvUvIdMEsqEvhocwSuV/U8ESbuFvFz/oqKLSTHv4=; b=YG+xSAStvTTMZ56eymfS/D6/G/hYKcS3x638O6xDwalYfmNOYU0HG+zYWmtlrYbL+ckXLA+iEx9gGnD1fMdgJqEZ3P/cNCPMYgSjUUCqixVsRyKLU4/tioVykgLNTLkGjhqN3t/im2MDC4+BJWPEHgyTyPhIBruZeI/rfssPa1k= Received: from SN4PR0701CA0002.namprd07.prod.outlook.com (10.161.192.140) by SN1PR0701MB1950.namprd07.prod.outlook.com (10.163.131.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 04:47:09 +0000 Received: from BN1BFFO11FD034.protection.gbl (2a01:111:f400:7c10::1:125) by SN4PR0701CA0002.outlook.office365.com (2603:10b6:803:28::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Tue, 16 Jan 2018 04:47:09 +0000 Authentication-Results: spf=fail (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; Received-SPF: Fail (protection.outlook.com: domain of cavium.com does not designate 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1BFFO11FD034.mail.protection.outlook.com (10.58.144.97) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.345.12 via Frontend Transport; Tue, 16 Jan 2018 04:47:09 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Mon, 15 Jan 2018 20:46:54 -0800 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id w0G4kt08020755; Mon, 15 Jan 2018 20:46:55 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w0G4ktvh020754; Mon, 15 Jan 2018 20:46:55 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 6/8] qla2xxx: Fix queue ID for async abort with Multiqueue Date: Mon, 15 Jan 2018 20:46:51 -0800 Message-ID: <20180116044653.20696-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180116044653.20696-1-himanshu.madhani@cavium.com> References: <20180116044653.20696-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(346002)(396003)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(69596002)(110136005)(54906003)(2906002)(6666003)(316002)(76176011)(2950100002)(50466002)(80596001)(47776003)(85426001)(36756003)(59450400001)(48376002)(5660300001)(356003)(305945005)(51416003)(86362001)(81156014)(8676002)(50226002)(478600001)(106466001)(8936002)(105606002)(81166006)(1076002)(72206003)(16586007)(42186006)(4326008)(87636003)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0701MB1950; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD034; 1:LxIiYUVFVZsJrgP9wB0g+4YGdWPtjJlnsh8fSG7jT32dj460nAx8BOt7xHJDdsU/BDAVosIthN1KLH42PiAngivcQgN6OW/8i2mFlZS5MUHWhUgfS7KL3p3Gsxkf3FdA X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f786239-56fd-4c72-9a77-08d55c9c33c7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:SN1PR0701MB1950; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1950; 3:ukRkvF29FgjHFA77riddpnd7awDbSFd4VTUwpQWd0cTWmz8g2pGp2GtcW5moLe6Rh3IGhhSimGVFzE2Kiw3TpUk80sjt56Icz7+Fue9h9Gnvze3YVtWFe4NvijOPLRSkHWbzIzSrlUzmI8ehob2SRgtuA3g2Z64Zymy9HKRJIz9Ty5tGn8q7aWcnSnTLqCJtZ8ps+8uUJOHyrk2fZFSrtQ80KAbvA5jaHcQi9UeXC/fskS+opWYHidaqBDkNcHqhjxYwFGyz8DYUfz1dl1hVCEHIO3WZcKiQY50VxsB5jfFR0HJfapbWxheeo3lLhyUmSOhhDiUXnKWJfhHIHI52nw==; 25:Cwi7cMio8LxoIiFR31dyVrjqwrlwk68QG4fNU/hx0vOr0yiOQ9HBLHWphSocBfouWGbNU5vttBDK/59qWV01ocjYlIpo8R21XFVC9v1k1rTCZ8kibkGrH3ZHKAcqwAFD1b7bZAj943mSng2PfGYY/rUCGoeRYNrD/wLOKIK9PSc525wJdfh9AERYocQ9QzNsrZeaMJkNYEnJFT0wKyenc+AYSO2DuIfluGi+7WxGsGoR9r4IuMRQnvdlDIsDAOLnPKc9I+EouZxXrGHGwo0IXmv2hhPxNAAoobmScw4JpH1brOKEtneZy7fFiEliwajGZeCkoeahR4YeehcWmxKb0A==; 31:CO9ifyTVX2zhCldHQzp/7i5otptKRI3kgugUdXDtlh9erIGy9I6Vno5LJME8vouvug9HMTJit1u7ARNWBmqUxlTb2XY6E8cNQVZrzyqgqkSHkHyjlIqOd0hN6UAQN6vlTR5r27cU/s4FEaFUQM6h0ZaPG9D9EzcdMpg6uZfSy0uSxbnv9R5K1MBZtO4cjXCmn7lEK/TVsa8RGKroeDAllpRwmyvq/ihdvQZ39u+QcVI= X-MS-TrafficTypeDiagnostic: SN1PR0701MB1950: X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1950; 20:CHt24k/5IdGguAh0fvhlL5f+21OznE3B1aeqAJYOG4xMqKifBWlCVxicaQcr78Jc73SKEIjHBV5aP/2grTFybOc+sbWygF0cccflZtboQv0O7UYX70WNMWx502tH1g29KHrknTZGJHn3YOOmUXNaL1Pjs8mS8UFePICCtmbLVtLe6zRP2xH3rLt6hV+VRYjWDl2920OtNI9ojlIPRgBCTEaiWRYdtzxSxOWzWJr80x38AUv7dNlytB+WvLf+kb51mB6RmU0HA93Tq5dbhoHs9GgeoBkbCRU8VvDYgnoxigkiieSPSQvFoplVoou8Y7xTAqY5lgUOIUzNGMnQTr+pqedQs+nS1W+zGyaOozwQcRbrHrXQuIc5Qf4fXS9Eb1u/4YajEkMHB8BW008lHVG+p+2QlhuNV+Q2EPJ51ZLaMxvZTnAgr8u/O1BsrMbQfMgRtfYa2pFMo7ockbhMSEMTge62Va2nOgOb+FEw+BJag/gU2jXxcooGtMoXC42LmsIT; 4:T/ynceYCpcLme8RfJlnDts8aj46vopj0CJkYri9REyBLYt7C4B7WoU8fbc2z2PapA5+/O4C3wNhfgexGiY+7zBdT52Ly/cYBHEsLYkHVM8g9+bgG0/vntiVLz9HCiVuP5Q+vMcPnqna3p4174CLSXYTIdYuMUlwG+mECjbKXzI05zIfPhdYnKw+lKbb7Q5vBWvJfvVPlOctXZC59BTBpApjtN9/hGhm8Kc2oIXmQk6DiW5QK+2y8g99d6W7KW4lmgS/NpgllM/lAoJs+BlYd9g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231023)(944501161)(10201501046)(6041268)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:SN1PR0701MB1950; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN1PR0701MB1950; X-Forefront-PRVS: 0554B1F54F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0701MB1950; 23:X72Hxf3KRNUbnZgkNNAMYuVcAh4e2lCHZw6daT9?= =?us-ascii?Q?tYWx3u/YmlPUXcB7R9Uj8/h0eZbtXj1SapFy+cOx8N3lOaX5EnQjDkmHRB27?= =?us-ascii?Q?xAHcnFOQfv4masIZP6xIqcnkiDE0vjXRt2ySmJrEF/ldnkJXEG6hY8j/pL/3?= =?us-ascii?Q?GLU7O58LtV5jHe2KrfkD1nZS44SDomXInVLyHnVbYt25eFnh73hG8GgpZoLo?= =?us-ascii?Q?+nzMIv3f6Kdusdf6g0Lt9FTAsqFzq+BI/pMmX4+cCaU4kpSRtab1nZlLB64y?= =?us-ascii?Q?RI3FvWHma1wCAom6mczMU7vlHrhYWjZKI8ZU7Nar1tJyg/UnOwu4SVtExco4?= =?us-ascii?Q?xF1+e/RtwuTc5sF19RIOhqzlMyzwnYaVntYKff/Y1la0l0mSmg6NZTj+6dib?= =?us-ascii?Q?bDCyT8G6Fc2BF/pTVuYCZNLqGVmyoQxU7Qg9FKizNjGa2dqWTOOi0Ea31CYY?= =?us-ascii?Q?OSNQpdYy1gaFqVE+HmiBsDrUGV+3aqTD16fDRzdyTGxFQEUs3qK55Wotp+bp?= =?us-ascii?Q?WpATml4dpk/CehlXPM5D2Uy3FtrAMHzt8JsgJfOcM20GjbK2pQnlyQp3yROS?= =?us-ascii?Q?bqX/SZy06FhxD/mLLyRNoBImmivLrj+Ln6eSCZBXq13muWlpZ/5TDrozuBB8?= =?us-ascii?Q?WLrUI2hA6Vg3GvHKYE/7bLMJK7/DrFH4zEApV7yhb2UJWL7QUX+TIW0wXYd0?= =?us-ascii?Q?vF1MCCCIflvl0zyRVInBhFCoafD43AtFRigU+4Vvz7Si7A1X4LCl108WVCG3?= =?us-ascii?Q?zJ3ZDHarlK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zkXyUWFZ3+ieLb7m+8CeGWGUHgkzfenFyO31Jq8=; 7:kxP2cqrxUnV4KENj0q6gjSvBu8/CPvPURZdMLF0cFItnol/jHhDZWPwrnx49WDkK4cLKNh7wuOp2iMAIuonIWocqY1OBTJ/rWdZg8KbS6ygWZ2uWCy83wWgidqcFHg7VT++ihlv9t+tpl7aBO4fR24FWf41u5rAOPSu68953mIo/8ggy2RsknIGaw/0mCo8JzkerusdAnyn0Pn6UK/E0OLuX+mt3nk4xSURPYlVObpoD03PFywKb/4c6jDFMZpqE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 04:47:09.2577 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f786239-56fd-4c72-9a77-08d55c9c33c7 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0701MB1950 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darren Trapp Signed-off-by: Darren Trapp Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 9 +++++++++ drivers/scsi/qla2xxx/qla_iocb.c | 6 ++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index f7396a2e28ba..be7d6824581a 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -442,6 +442,7 @@ struct srb_iocb { struct { uint32_t cmd_hndl; __le16 comp_status; + __le16 req_que_no; struct completion comp; } abt; struct ct_arg ctarg; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index e030ee38fa6f..bf1ad9161d11 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1565,6 +1565,12 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp) sp->name = "abort"; qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)); abt_iocb->u.abt.cmd_hndl = cmd_sp->handle; + + if (vha->flags.qpairs_available && cmd_sp->qpair) + abt_iocb->u.abt.req_que_no = cmd_sp->qpair->req->id; + else + abt_iocb->u.abt.req_que_no = vha->req->id; + sp->done = qla24xx_abort_sp_done; abt_iocb->timeout = qla24xx_abort_iocb_timeout; init_completion(&abt_iocb->u.abt.comp); @@ -1599,6 +1605,9 @@ qla24xx_async_abort_command(srb_t *sp) struct qla_hw_data *ha = vha->hw; struct req_que *req = vha->req; + if (vha->flags.qpairs_available && sp->qpair) + req = sp->qpair->req; + spin_lock_irqsave(&ha->hardware_lock, flags); for (handle = 1; handle < req->num_outstanding_cmds; handle++) { if (req->outstanding_cmds[handle] == sp) diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 2c6a236dff96..1b62e943ec49 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -3275,7 +3275,9 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb) memset(abt_iocb, 0, sizeof(struct abort_entry_24xx)); abt_iocb->entry_type = ABORT_IOCB_TYPE; abt_iocb->entry_count = 1; - abt_iocb->handle = cpu_to_le32(MAKE_HANDLE(req->id, sp->handle)); + abt_iocb->handle = + cpu_to_le32(MAKE_HANDLE(aio->u.abt.req_que_no, + aio->u.abt.cmd_hndl)); abt_iocb->nport_handle = cpu_to_le16(sp->fcport->loop_id); abt_iocb->handle_to_abort = cpu_to_le32(MAKE_HANDLE(req->id, aio->u.abt.cmd_hndl)); @@ -3283,7 +3285,7 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb) abt_iocb->port_id[1] = sp->fcport->d_id.b.area; abt_iocb->port_id[2] = sp->fcport->d_id.b.domain; abt_iocb->vp_index = vha->vp_idx; - abt_iocb->req_que_no = cpu_to_le16(req->id); + abt_iocb->req_que_no = cpu_to_le16(aio->u.abt.req_que_no); /* Send the command to the firmware */ wmb(); }