From patchwork Thu Aug 30 16:35:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10582305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3F66175A for ; Thu, 30 Aug 2018 16:36:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E43F12C12C for ; Thu, 30 Aug 2018 16:36:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D85DA2C138; Thu, 30 Aug 2018 16:36:03 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 522C92C12C for ; Thu, 30 Aug 2018 16:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727682AbeH3Ui7 (ORCPT ); Thu, 30 Aug 2018 16:38:59 -0400 Received: from mail-eopbgr710080.outbound.protection.outlook.com ([40.107.71.80]:5824 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727073AbeH3Ui7 (ORCPT ); Thu, 30 Aug 2018 16:38:59 -0400 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:X-MS-Exchange-SenderADCheck; bh=F1DRQlgUQqaTI5eT1mxZmUPNMXc77g/P28TLACLBgb8=; b=U5vZ2ZUC1HkHz7Ey+WtcVbNY2ird5y4unYa7hSpQY9ENU9LW3T7YA7AMpQ3eP4siFd70E7KQbnXj4S5lPt1K0PKpIOEJKie/XOIjyrLZCuYu1Kh8cje4C/MSOk0H5scbupusAxyYujiHfFqDov1YeEFGmrZHABRmifRdQROjiHY= Received: from CO2PR07CA0050.namprd07.prod.outlook.com (2603:10b6:100::18) by BN7PR07MB4386.namprd07.prod.outlook.com (2603:10b6:406:b6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Thu, 30 Aug 2018 16:35:58 +0000 Received: from CO1NAM05FT009.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::203) by CO2PR07CA0050.outlook.office365.com (2603:10b6:100::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.16 via Frontend Transport; Thu, 30 Aug 2018 16:35:58 +0000 Authentication-Results: spf=pass (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=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 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 CO1NAM05FT009.mail.protection.outlook.com (10.152.96.116) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1122.2 via Frontend Transport; Thu, 30 Aug 2018 16:35:58 +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; Thu, 30 Aug 2018 09:35:50 -0700 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 w7UGZoOI027335; Thu, 30 Aug 2018 09:35:50 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w7UGZo6G027334; Thu, 30 Aug 2018 09:35:50 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 03/14] qla2xxx: Use correct qpair for ABTS/CMD Date: Thu, 30 Aug 2018 09:35:39 -0700 Message-ID: <20180830163550.27288-4-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180830163550.27288-1-himanshu.madhani@cavium.com> References: <20180830163550.27288-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)(136003)(39860400002)(346002)(376002)(396003)(2980300002)(438002)(199004)(189003)(26005)(50226002)(87636003)(478600001)(106002)(69596002)(50466002)(6666003)(72206003)(51416003)(44832011)(48376002)(8936002)(186003)(36756003)(76176011)(2906002)(305945005)(8676002)(81166006)(1076002)(4326008)(81156014)(80596001)(356003)(486006)(106466001)(47776003)(126002)(42186006)(16586007)(2616005)(336012)(476003)(86362001)(14444005)(54906003)(446003)(11346002)(110136005)(316002)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR07MB4386;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT009;1:kDddHT7kILN6FOQfqLXGqqff9VR/5ja7nPXY4CdWfoYm1ivm1XccGHxCn99OoeCUloQ72VeTFZ3QV8WNonbZwI9LomfecaSQp7Bv8AFz48CpHKRWF0OaLSKU8zx10Bat X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cc9f7473-57c3-4049-da40-08d60e96aa66 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN7PR07MB4386; X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4386;3:yDPyw6Ysdhr2TFoxEyGdTkOQHJl9Ld8bu9evCpu8BYtzO++UzQwNwn6b3l0y+3FERvmsv0gnGFEO9nBFWTdfDozrnWDyYnHUxvJM7btqANAherbQAaXi0ntTYszranTq6LBMwbu9TsyHzMAljNIxHCFaC/xduU9YM9vgYZJUuKIjL08KoRWz1NxYvBqRmDPMJM9XhDcM6QqbhtlbgYU5JYMFiv9CklxhY9l6fRb5KyLFZT3kfAiKulRqwCpAJDILlZ9oU484OL0pISdwfwZPRZqJlhn+SYdc7bRn6fAaN75qvxYVElP4xRrDObUvFbHCCTaegbbfplDom4+25krpLk7itYJbKoNm91ObRh9VDW8=;25:+j0rfeSono/59NMhh5WV2jHMatd/I0dsWj5qie+E5fKuaNleQ5UxC7yCMh/6QbTeXDljxWbV805c/TZqXFFeVLyRXE93H0vsYJrZ1S6B6wsKqG67G1BGM3YsXU7Blrwgtzu+hEMS00A3OFF2J8UvMFS1RO8SQ5zIreGy5w7eOYAEjncyOsR6OGsDUkoFU3lZMOHNByQ1Y6jKCsbrCThAHUPzyrJoYWlmgp1yF0D6u8eHn4I8TuJwL0QjLonpKtAwJVXicpQUR0NqaTNqoQin4aYPck0C1YvZWVjsuDBvDr3FWmeP3TNcpw7d/9XjTX5/ZWHItvdANdNVvZGr82Xb4w== X-MS-TrafficTypeDiagnostic: BN7PR07MB4386: X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4386;31:Mw+vTWnUiN7eUHEGbgoNDl/ghNXdSuESWPmPXjFgdd6LI0dg2vzB9MW0qgnvdwEU2/OGgrG4qIGkWFgVwW7V3c+7EgGuySslBCODwaT3Aw+OiZ3E63YOw8Ga13MqXUGwYkpGYYaUvJtysfGzbM4gDXrXrKf+RwvVmTHpIjirFVCSYSPdIWr6l9Jp2EW1xRrk9kda0uSz/YzJw1isbGgJU3rz3Eul1KnFdkI5ezohtyY=;20:VxjPYIkzQpCpUlnaUKS6IKBJJajJbEKr9rMGYvvUjqD5y2R2kax/Onz0EVEVjCp9SA1eiESPyTcFrqYwCuy5vNSM5fYKGTiFDTJpnFBH39IPBExnffGto71HGfaiwnEeH7gu4wVb4utiu5cCt+qDUbNgP+mIClAD+03mxwz7oRjmO1XqnEO2la/f5NbXkWKwi9L6ekdSIQtLv0xk5Ai2JFCp1jjMQW69ERn9C+AVvcXvC9UcO3uCBTVrI1h/78y6zLw01rAUEj3zmF/bJv4dDuxx9khYh7HDuFv9dpj+IrAWrlLylyS8sz38WvnVJ4bbJpyCC3CKPZg8d7TkzYpleg5i3RvV/zxvk+Ul5AMh2ygNDXA08ckYNQeNa4QrRe1OGXq8hsHOoMODoQvqfJ20meTfbqBk/DFgZ2uUr8+fvPlFk3GZyID5RjZmAcUGkBKczlCqNd5sSEZSzFxlqE9sgv4Dv/cK4VvEKoVxkCmV50ZY1duYs/+X7p5cp7/w+7Nu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(269456686620040); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(3002001)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699016);SRVR:BN7PR07MB4386;BCL:0;PCL:0;RULEID:;SRVR:BN7PR07MB4386; X-Microsoft-Exchange-Diagnostics: 1;BN7PR07MB4386;4:elbnYUaF9SJzKBrae+9JE2cb7dyjzKCTQiU0JVjc0SaBOqQf40Inm6uzr9YmD/5cNhRY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6Fg1SWZ9rmho+zh7DVJDpAfBF3V/M0EmBlqHprj3iJeLzUtUsB+viM1x42fs+rLrseEEIYZvGogEaRQ0qyJPexFjzRV1nRokOWU3IHLXJoQL8bl2YCoVuZSTb4FIqTigDuizu92vocxd34HH4x8f0W/2lEyLj7X9bejkOg0POVkPw0TdF4o8BgflTr77ztNyVf5fdySRlA5pG9G1V8oxDKXpP53bZ7XOARg==;5:0CRr/HIJJkchHs0mcVHKBy6MpQUrQd3UuXU6wAO2bnlAJM+bYN8PMAHv0ADBZ6CWpxESFquPO+ciXbUfPF4UlrsbphHaNMp5S6k2cQwzzUvMPuPAKxuMAMn7cny4wy2VF1AsXOgFD64+NBl5wIndkAOdDmhFvtfdbTA3/xNDp4s=;7:LNYBj3Mzxkm6R7JvlxeRc9u0kmU6Th4R0e1P7E2bcQ4HcKwLIPQh2Etyeqrje8kxfrqNJSsVYl86UMyJhSRR4ZWC7xKM11oPc3pvLgCK+HI+k8njSn+i+ohcgkLhuAwGLCWBqBFNQyAclrBE7yKrKlS55xMJqPGo6+mfp8e7G6bBODVKaSwcpBf8hVDk2Em/c1LPrbL05X1kOfITmWh5RRd23yFMoSV0+bsGRopRH63mb8Y6E40WD2gAWJRvuJJA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2018 16:35:58.3441 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc9f7473-57c3-4049-da40-08d60e96aa66 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: BN7PR07MB4386 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: Quinn Tran On Abort of initiator scsi command, the abort needs to follow the same qpair as the the scsi command to prevent out of order processing. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 15 +++++---------- drivers/scsi/qla2xxx/qla_iocb.c | 12 +++++++----- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 4686fb5f26aa..53c4eb3b9c27 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1747,18 +1747,18 @@ int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) { scsi_qla_host_t *vha = cmd_sp->vha; - fc_port_t *fcport = cmd_sp->fcport; struct srb_iocb *abt_iocb; srb_t *sp; int rval = QLA_FUNCTION_FAILED; - sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); + sp = qla2xxx_get_qpair_sp(cmd_sp->qpair, cmd_sp->fcport, GFP_KERNEL); if (!sp) goto done; abt_iocb = &sp->u.iocb_cmd; sp->type = SRB_ABT_CMD; sp->name = "abort"; + sp->qpair = cmd_sp->qpair; if (wait) sp->flags = SRB_WAKEUP_ON_COMP; @@ -1767,12 +1767,7 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) 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 = - cpu_to_le16(cmd_sp->qpair->req->id); - else - abt_iocb->u.abt.req_que_no = cpu_to_le16(vha->req->id); + abt_iocb->u.abt.req_que_no = cmd_sp->qpair->req->id; sp->done = qla24xx_abort_sp_done; @@ -1781,8 +1776,8 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) goto done_free_sp; ql_dbg(ql_dbg_async, vha, 0x507c, - "Abort command issued - hdl=%x, target_id=%x\n", - cmd_sp->handle, fcport->tgt_id); + "Abort command issued - hdl=%x, type=%x\n", + cmd_sp->handle, cmd_sp->type); if (wait) { wait_for_completion(&abt_iocb->u.abt.comp); diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 119927220299..c699bbb8485b 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -3297,19 +3297,21 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb) { struct srb_iocb *aio = &sp->u.iocb_cmd; scsi_qla_host_t *vha = sp->vha; - struct req_que *req = vha->req; + struct req_que *req = sp->qpair->req; 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->nport_handle = cpu_to_le16(sp->fcport->loop_id); + if (sp->fcport) { + abt_iocb->nport_handle = cpu_to_le16(sp->fcport->loop_id); + abt_iocb->port_id[0] = sp->fcport->d_id.b.al_pa; + abt_iocb->port_id[1] = sp->fcport->d_id.b.area; + abt_iocb->port_id[2] = sp->fcport->d_id.b.domain; + } abt_iocb->handle_to_abort = cpu_to_le32(MAKE_HANDLE(aio->u.abt.req_que_no, aio->u.abt.cmd_hndl)); - abt_iocb->port_id[0] = sp->fcport->d_id.b.al_pa; - 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(aio->u.abt.req_que_no); /* Send the command to the firmware */