From patchwork Tue Sep 4 21:19:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587987 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 2B37F920 for ; Tue, 4 Sep 2018 21:19:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AE7D28F76 for ; Tue, 4 Sep 2018 21:19:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F0542A127; Tue, 4 Sep 2018 21:19:39 +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 6149A28F76 for ; Tue, 4 Sep 2018 21:19:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727320AbeIEBqc (ORCPT ); Tue, 4 Sep 2018 21:46:32 -0400 Received: from mail-dm3nam03on0050.outbound.protection.outlook.com ([104.47.41.50]:21561 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727361AbeIEBqb (ORCPT ); Tue, 4 Sep 2018 21:46:31 -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=zd6QmUk6mB2BojEHKhz4Nz9zCnLKFvrdnFzIbyffjA8=; b=gz4aTzebfBAeEJ2eGt2blsap3zqwZ45Kw+Td57t0Uf8yESSE1VstoLPF37RRQyQiIA6lTZjd3W/zBYea6UogMQbXcuWQjcGpJ/9XgWTuSpU+Cxl1Cp2rpF6146pHMGJJfgSlk/CcOnizQqCaJ+lUzDlQXKCnxlhpsbMOt0iuxvk= Received: from DM5PR07CA0077.namprd07.prod.outlook.com (2603:10b6:4:ad::42) by SN6PR07MB4397.namprd07.prod.outlook.com (2603:10b6:805:58::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Tue, 4 Sep 2018 21:19:33 +0000 Received: from CO1NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::200) by DM5PR07CA0077.outlook.office365.com (2603:10b6:4:ad::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.16 via Frontend Transport; Tue, 4 Sep 2018 21:19:33 +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 CO1NAM05FT006.mail.protection.outlook.com (10.152.96.111) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1143.1 via Frontend Transport; Tue, 4 Sep 2018 21:19:32 +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; Tue, 4 Sep 2018 14:19:21 -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 w84LJMR6031990; Tue, 4 Sep 2018 14:19:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w84LJMKB031989; Tue, 4 Sep 2018 14:19:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 07/13] qla2xxx: Move {get|rel}_sp to base_qpair struct Date: Tue, 4 Sep 2018 14:19:15 -0700 Message-ID: <20180904211921.31927-8-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180904211921.31927-1-himanshu.madhani@cavium.com> References: <20180904211921.31927-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)(376002)(136003)(346002)(39860400002)(396003)(2980300002)(438002)(189003)(199004)(6666003)(336012)(2616005)(476003)(8676002)(5660300001)(51416003)(110136005)(87636003)(76176011)(54906003)(106002)(86362001)(11346002)(126002)(2906002)(186003)(446003)(1076002)(69596002)(356003)(36756003)(80596001)(4326008)(486006)(305945005)(81166006)(81156014)(44832011)(50226002)(47776003)(106466001)(14444005)(72206003)(50466002)(478600001)(316002)(26005)(42186006)(16586007)(8936002)(48376002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB4397;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT006;1:fHZRAvOkHGDH4h5nsOzdzO959Qbcu9OkEY9YGhLMuwMbppDmD6d1alraV9xIjpsr+Gh+cOoWV/3edYZa1iOLNeqByu29j3GRjD1UWwd+WnuHYfePWq1Zjdd9O1YyObki X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 14269aa9-5fef-4de1-cbf7-08d612ac1be1 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR07MB4397; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;3:WtX6zMV/GD76cXWqRHqHjSKc//ChZ7jPXKH+KwEEPM697637+qGWepR1FcDrS3QB6K/XfQ+WaQ9qjOCyvg+WxO48jXZSmYvZvfIfFWQyP9+8n1cBpwAtGn8M6Px5BTZd4guNnfbSMDs0mrAJbcKMY8LBky5CJUWe6REM0G5ooVEtLh9QiC98pz9+1skMycTD++3hsNbeF7B2kCaf4TWzdpMYrmtHCGOuXldjOnYks1JpAGZZBQUqePuss3q+nfPElprrBPdY+pFv38CfA4HocOhBVnV6dKSoygBqydP7KrGwarOIGWcU8Xp1EQdxLp3RyhfJO/qu9+O0+KGxMBmDOw3W+iPpzBx2Ux5zlrfgyIk=;25:1ToZn1n/j3+2+XaWCE6v6E1vF6l1k1amqoGKD9eLq7wbZAPor7yFt0DOlT5Y5I4gAFm57OpWag2I81Kn/lgLmyp7sGFZsPVVU4TwQ7QtUfVAiBboTtCiDNG8iE1Ytm8SlaM5gQ3OZ56/bNNDsF0t0wlYMpoZVZbum39vrvDJrfk2QATVJN4UAsP5EuedJMw5dmGeYeXfBcKkXMRv2fL4ZoAA4Z35zTaHLmDVzAwwfBbKyvigBUt/5ukGjNCEX2WskhGq2hqqZxlgUBwI6TrBJTkgTBdnwZR4VGuvPwaxqON+6tEPGD+vLV5vNsW4eISGQD9jQjxYo4SF5c0aKlLenw== X-MS-TrafficTypeDiagnostic: SN6PR07MB4397: X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;31:HVkN4QP/YUZCTFHBPH/0d4FPwitPTuspnnqCFKjBXshDU+UFaSkLFnQuCbdKBp+85L9TI1lkFEBP+Lk/VfZcQE6SJ+oI2OQLmEzsj6wWHHnAqL0jcWjnubsbOyNjT2A7rlIxd0Fk//4sSw4BZFcklTNf1mW1ORUx2yDqVaZGa0N5XGzL63xo+16E0EdyOu7D4CRYd/TuGWo15/sxvspQQQMDd0mh4p6nWGfLGylk1Qc=;20:J8JaG6a8Xtsi9PQYhZIJgm7OE72DTqYU9NjJxchXR+GKsF9H1FlWQsnQDFbdQfBTo2sYwvynSLIEEGV8TXmORFbFt/JrzJDWzL923doIqPXySdfGonFIgVzVafYG6pFGm1ZLkkoccd+8ieIcqS1FsL8wKdE1eRDK0nA3fIUZnyQTdjAXftpVTG62fINgVKmq3z69AQvs+UG3XnNV6XrSjvXa9mPpY1KrE+e8CW/S5vSpn2+NlkRAXPTQ2sHe1Sf9PNGypHx8/qqItTJxK7rgr4lXK33w4H7HtcWYL8B1p8xbTBrVsIY4Arkd/1c876weykpSt3/1V0Pbj1Zmr9DpUPWKyO9LK+RzxT2oMmsUR371pz+ioJ9V/hQq8ABIaN9NUWMqkRaLr/s5PfIEHBLh1Fa5CKP0Fijfp755tmMRx7vGfLxfiI8mYImHnhL3Iuq+/f8yfQdBgzBHrAPetDCYEN3UO5Cu6m4SVBD+4uEr+4nHOYF+7WySbV5uWU+/gF2y X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:SN6PR07MB4397;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB4397; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;4:go2SC9s2j3iZUQ4fq3jN8COirdDsxsix1FA0TnvcJmRp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CNalyhA9PRaBzqDvwXPnfl+Szg2NnGgKJ3kjsxDaD4+dNXdLpUO45IUSXycK4yHMLZ4fJ+0PaNNIYwwkDutLKcNsK3JlZubaE2R27IkK0W2A/HkNyZGVdgDEHqqhU/M506+GNLrkdx05WPbwSMJVHVeEoeNO420XEf2Z+yWHA==;5:fjl3uV2BJ8chSdqCxnWuP75cjnZ2A1IxGC0vBKtMVbcbMFDCpc+AkWW3C+gR8CLRXSpXdsxhFNmXQIRVJ5Eyt6sUgJULzH/U9oUGtiRpYc9Ph22jXDLRElWceO+Gv0bSd9O2gPtgMv7GLub5zthA01KOyiXaTaWP2TD17ifFxOM=;7:4flVwZ3ezQFEeJLkuH0aXeJGSPOff2Xmc5pwf8H2KrC7TsZS9HiPOp4wL1vvqhU8UMh/3fAe60WDSQWr+VuQMgdSe/wcSZVBQi2GN2YXAjEY1UEeezE2botCRYGlSLHPG0Qxc8agNkC9hfM4nkRjhQH7U0u8zFzFCWkT1Pd7OHagp5g+by11F2Lwq4k0xzyDCIif+bpGjdkZOj8gYKqDJ7ZOSc3xiFUtQtkj8rkxPMngrpy41sXy8URHkjJd7odh SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:32.8461 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14269aa9-5fef-4de1-cbf7-08d612ac1be1 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: SN6PR07MB4397 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 Currently, qla2x00_[get_sp|rel_sp] routines does {get|release} of srb resource/srb_mempool directly from qla_hw_data. qla2x00_start_sp() is used to issue management commands thorugh the default Request Q 0 & Response Q 0 or base_qpair. This patch moves access of these resources through base_qpair. Instead of having knowledge of specific Q number and lock to rsp/req queue, this change will key off the qpair that is assigned to the srb resource. This lays the ground work for other routines to see this resource through the qpair. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_gs.c | 1 - drivers/scsi/qla2xxx/qla_init.c | 3 ++- drivers/scsi/qla2xxx/qla_inline.h | 17 +++++++++-------- drivers/scsi/qla2xxx/qla_iocb.c | 9 +++++---- drivers/scsi/qla2xxx/qla_nvme.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 3 ++- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 902106f97020..385c46f2576e 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -4157,7 +4157,6 @@ static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res) if (rc) { /* Cleanup here to prevent memory leak */ qla24xx_sp_unmap(vha, sp); - sp->free(sp); } spin_lock_irqsave(&vha->work_lock, flags); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index fbbf530a38e0..49c8f0119620 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1761,7 +1761,8 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) srb_t *sp; int rval = QLA_FUNCTION_FAILED; - sp = qla2xxx_get_qpair_sp(cmd_sp->qpair, cmd_sp->fcport, GFP_KERNEL); + sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport, + GFP_KERNEL); if (!sp) goto done; diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index 4351736b2426..bf9a6f01fd9f 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -209,7 +209,8 @@ qla2x00_chip_is_down(scsi_qla_host_t *vha) } static inline srb_t * -qla2xxx_get_qpair_sp(struct qla_qpair *qpair, fc_port_t *fcport, gfp_t flag) +qla2xxx_get_qpair_sp(scsi_qla_host_t *vha, struct qla_qpair *qpair, + fc_port_t *fcport, gfp_t flag) { srb_t *sp = NULL; uint8_t bail; @@ -225,7 +226,9 @@ qla2xxx_get_qpair_sp(struct qla_qpair *qpair, fc_port_t *fcport, gfp_t flag) memset(sp, 0, sizeof(*sp)); sp->fcport = fcport; sp->iocbs = 1; - sp->vha = qpair->vha; + sp->vha = vha; + sp->qpair = qpair; + sp->cmd_type = TYPE_SRB; INIT_LIST_HEAD(&sp->elem); done: @@ -246,19 +249,17 @@ qla2x00_get_sp(scsi_qla_host_t *vha, fc_port_t *fcport, gfp_t flag) { srb_t *sp = NULL; uint8_t bail; + struct qla_qpair *qpair; QLA_VHA_MARK_BUSY(vha, bail); if (unlikely(bail)) return NULL; - sp = mempool_alloc(vha->hw->srb_mempool, flag); + qpair = vha->hw->base_qpair; + sp = qla2xxx_get_qpair_sp(vha, qpair, fcport, flag); if (!sp) goto done; - memset(sp, 0, sizeof(*sp)); - sp->fcport = fcport; - sp->cmd_type = TYPE_SRB; - sp->iocbs = 1; sp->vha = vha; done: if (!sp) @@ -270,7 +271,7 @@ static inline void qla2x00_rel_sp(srb_t *sp) { QLA_VHA_MARK_NOT_BUSY(sp->vha); - mempool_free(sp, sp->vha->hw->srb_mempool); + qla2xxx_rel_qpair_sp(sp->qpair, sp); } static inline void diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index c699bbb8485b..6335b8ce5fbd 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -3440,12 +3440,13 @@ qla2x00_start_sp(srb_t *sp) int rval; scsi_qla_host_t *vha = sp->vha; struct qla_hw_data *ha = vha->hw; + struct qla_qpair *qp = sp->qpair; void *pkt; unsigned long flags; rval = QLA_FUNCTION_FAILED; - spin_lock_irqsave(&ha->hardware_lock, flags); - pkt = qla2x00_alloc_iocbs(vha, sp); + spin_lock_irqsave(qp->qp_lock_ptr, flags); + pkt = __qla2x00_alloc_iocbs(sp->qpair, sp); if (!pkt) { ql_log(ql_log_warn, vha, 0x700c, "qla2x00_alloc_iocbs failed.\n"); @@ -3523,9 +3524,9 @@ qla2x00_start_sp(srb_t *sp) } wmb(); - qla2x00_start_iocbs(vha, ha->req_q_map[0]); + qla2x00_start_iocbs(vha, qp->req); done: - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(qp->qp_lock_ptr, flags); return rval; } diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 8dc7a5c64800..ad923965be3c 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -506,7 +506,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, return -EBUSY; /* Alloc SRB structure */ - sp = qla2xxx_get_qpair_sp(qpair, fcport, GFP_ATOMIC); + sp = qla2xxx_get_qpair_sp(vha, qpair, fcport, GFP_ATOMIC); if (!sp) return -EBUSY; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 6fa321a4229d..210e5c2999f4 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -398,6 +398,7 @@ static void qla_init_base_qpair(struct scsi_qla_host *vha, struct req_que *req, ha->base_qpair->qp_lock_ptr = &ha->hardware_lock; ha->base_qpair->use_shadow_reg = IS_SHADOW_REG_CAPABLE(ha) ? 1 : 0; ha->base_qpair->msix = &ha->msix_entries[QLA_MSIX_RSP_Q]; + ha->base_qpair->srb_mempool = ha->srb_mempool; INIT_LIST_HEAD(&ha->base_qpair->hints_list); ha->base_qpair->enable_class_2 = ql2xenableclass2; /* init qpair to this cpu. Will adjust at run time. */ @@ -1013,7 +1014,7 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, else goto qc24_target_busy; - sp = qla2xxx_get_qpair_sp(qpair, fcport, GFP_ATOMIC); + sp = qla2xxx_get_qpair_sp(vha, qpair, fcport, GFP_ATOMIC); if (!sp) goto qc24_host_busy;