From patchwork Fri Aug 31 18:24:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10584337 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 774BA5A4 for ; Fri, 31 Aug 2018 18:24:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6424F2C535 for ; Fri, 31 Aug 2018 18:24:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5877A2C5B2; Fri, 31 Aug 2018 18:24:53 +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 D1A4B2C5B4 for ; Fri, 31 Aug 2018 18:24:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727538AbeHaWdc (ORCPT ); Fri, 31 Aug 2018 18:33:32 -0400 Received: from mail-sn1nam01on0062.outbound.protection.outlook.com ([104.47.32.62]:14183 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727531AbeHaWdc (ORCPT ); Fri, 31 Aug 2018 18:33:32 -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=rvgjRJ3NElUy+ExVRJSyd8TDcG4WNBwq+c4LsoBMDok=; b=QE/P3OGIF5eCAwFWU1qCXoUoqG6+UhE+QzYj9jykaGjlkyRrFQFuY9sCldmP1PfzzhhQRPyLPkWuxJ4DeWYnE+djpUxYES7gykH3LampQd/ghSmb5HPcvtAwJRXcgfnDRAWo79KOAyQBm/D6crW+Zu0K4bY5Sa12VwSrN1xPN5g= Received: from BYAPR07CA0014.namprd07.prod.outlook.com (2603:10b6:a02:bc::27) by DM2PR07MB1449.namprd07.prod.outlook.com (2a01:111:e400:50c3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Fri, 31 Aug 2018 18:24:47 +0000 Received: from DM3NAM05FT013.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::200) by BYAPR07CA0014.outlook.office365.com (2603:10b6:a02:bc::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1080.15 via Frontend Transport; Fri, 31 Aug 2018 18:24:46 +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 DM3NAM05FT013.mail.protection.outlook.com (10.152.98.122) 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; Fri, 31 Aug 2018 18:24:45 +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; Fri, 31 Aug 2018 11:24:40 -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 w7VIOdBZ024229; Fri, 31 Aug 2018 11:24:39 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w7VIOdxV024228; Fri, 31 Aug 2018 11:24:39 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 03/14] qla2xxx: Use correct qpair for ABTS/CMD Date: Fri, 31 Aug 2018 11:24:28 -0700 Message-ID: <20180831182439.24182-4-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180831182439.24182-1-himanshu.madhani@cavium.com> References: <20180831182439.24182-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)(346002)(396003)(376002)(136003)(39860400002)(2980300002)(438002)(199004)(189003)(50466002)(42186006)(316002)(110136005)(54906003)(16586007)(186003)(81166006)(81156014)(48376002)(26005)(5660300001)(106002)(14444005)(8676002)(36756003)(44832011)(51416003)(478600001)(76176011)(80596001)(72206003)(86362001)(336012)(69596002)(126002)(106466001)(476003)(486006)(2616005)(4326008)(87636003)(446003)(6666003)(11346002)(1076002)(305945005)(2906002)(8936002)(50226002)(356003)(47776003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR07MB1449;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;DM3NAM05FT013;1:C3bVlt/Qw7zBPxatRduBpXCf4G0XFzSC6BQ1oreF3qB6+Vbuv2KkGdbdnUH7TNJsYuCrHcjhYkNBdzq9N1mJKhEtn0JvikPbthu9DYDdcVgS9yd4MV1MFV40rhh26c4d X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01be2d6c-ce9d-4506-662d-08d60f6f0781 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM2PR07MB1449; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1449;3:nJcS4VU+tstq2oFDI36Xhdy9h0mDpX9V7OrjoFgbydbLimjwDdzeUKdz63EbcsLbA2TcCyQ5oq2yZVFDdOXuVItct0X3AqjO1rBA+ZKNeSHbO3Z+2rC3rgmZMOFSRp4AxQScp9LLOWeS/1GnPwW8d95JT6CU4dVxjM0dnTw+XG/PQlVNca6woaQak15j242x6YsFIXtNsi7xgdwcTwlQmfeEiOT6YwIWPYkrZaWONo5/900hzokWHvBGoT5KxVINBKndehtjjeIxLncp7Etgs2rzFKedJvAY/aQyuPscRpW34FKrjHtPtnOOOUz+HJjKDdCLNCyTdFntlbFn6NEpmfbuwOg0+I8v7yRATdYPuH0=;25:fu9n2zykJfwdyECMQf/LItY807LY0VjqmRKcqdcO3w66mtmoX+rKk2oq2FoTRYNtFoxPQviOCVSvpqRJyjGfvupPeC9m2A8LuPmc1urxGNbLZxIkkdhGWzvs67rgk+NZP1mRJ1SLvn+toDeE6fe7OEmqx0Cp+0rP3biyFawN/CwfFsYnYjtCHs65l0bY0S3s14TOHeSkvfC67TdsL/qhL/3qL4ezjCYcWNpo7kitpvAv/xIMrW0V7dhr9E6nkmaLZzChH7fRk6BFIflWqZQ0XTA6TUopPAfxM/ngt3QbXxok6SUNM5PYk9+sErS30EDdUEwli/gZecvtZn8N4JO0MA== X-MS-TrafficTypeDiagnostic: DM2PR07MB1449: X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1449;31:jcsf9HJntuxH5+l3MLj2iv2uD0VMOs38YFvYF+rfd9cMJzI2vBnP5hTvIQCT86szlpfmTzxYwuAnawkluObd+TRyXnwAy+xRED/bdUhfLP1X1waFHnX5NAxoxVlQJuvsYcVR+XqBBzRwD8jDkReRgOaPPc2OpqYRvyGoJVDClX03urZTuZ5tyUrq1j1Fp/wqFXXIqwx9J7bzsGKG1uL5FMU2G8yWPfrwMLPqOa+Pv1Y=;20:6TKfY3v3JhimR/nsHJj65f3KZvUx4bFRQ/8No4zVgIXdEuyTaawbHZsKkc6RVQuEufBEvhpgmk2o9zG6EpXpTrDtSomzNLC+QWweNiItWRYVyd25iaj8+/QocmohcOQyBSCV8iA68czV1LRRWDx7jv6+Wv9fU+FcIMb7R6EEqJ/9xaoCtkbOTXuMf6ifBWKs/S8IfakdstlOlWidXTTi5NLeIZ681ZU+OIw5xlIVNtvZTCYEmFH6Q4SSsuGQsSGyHg4gnGERQ711uCwEnhxAVbt3locbRZTSZDpyKcwDIFKgg8IcrLcP7puKwxiQimzyo7MHL4CRU3g8cj7ASCDag+kATVFF+9PO0InN4i4a94aG9dRL4Q6L8fZh17YNpDnXPjzYz8OjzK0ol6VUwm5f9ABEiEuvMdj6G+lOVN+aA14t0tVs5mP2QabDBriskgTjjPs/5DuUXo0hXOAYWtbKUNRIJDl+UiRtpGy4ZBPeAYZ5O0k8ALXYWJW8OeHmMIJ5 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)(3002001)(3231311)(944501410)(52105095)(10201501046)(93006095)(93004095)(149027)(150027)(6041310)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(201708071742011)(7699016);SRVR:DM2PR07MB1449;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB1449; X-Microsoft-Exchange-Diagnostics: 1;DM2PR07MB1449;4:uHJPvp6RQYNqL6Jb31Xd/aJkkL9DFfl6EFtUTxKQbu2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IsoL3Pn9K+L0hWh3My98dfEoclZ/HqQSawamImyg6/0RtrqnYxT66OMuWqahQsHESHGDYk9NKFLZ3G8vND33YDPAyvtOxAbqFYH0wi3vEirk43ClbU87m8yRhJ5OH1ydJ0AEzfYGOUdCk1umjv13HTzF29bs4M6j642NdW3eJLs0HAJ/plxestf6An30VFEGg85eVsNr9InXvPjZSbpeBAPqMiPo9Q==;5:0eOgBcMjfOJhfNe6th4ixflsF0aiPZOCvah5pClWA+yfMz/DqhJUdg/Ax2tcKRLJ2PBXZW0QAnAIIS50+sa65WR/Fz+0rfEPmqbGANYkHpffF5S2Ddz0XGXITtoK0eDRJt8/Fq2ZMb3H4XBHFln8/n1gPvX0MkHJ9RnafWE+Qp8=;7:1xYBpbaeGXMoEgoJtTBkNInahwKwMIlDnyJGSPwKMzxQbhQGrRhBa+G5cWtDym7aLPZQNn7DN/hZE8xllr21lGm+JsdD4ibX6taXPX68H3p7zLyYYZ/Hz6NsegpFSty0XGsmpcgCqyUjylEzKPcC3sl4bq3s76RjM8m5DrF6MrEi57+RIGNNy/nQTU++6KYj5tmxwGfhtgMnBZ4ZKz8LL1aGbovOf4wbYmSXZbt+C6XTLy726mxqG+qi+k7gs9xX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 18:24:45.7773 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 01be2d6c-ce9d-4506-662d-08d60f6f0781 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: DM2PR07MB1449 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..3eb3c4f554fa 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 = cpu_to_le16(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 */