From patchwork Tue Sep 4 21:19:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10587985 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 A25B3175A for ; Tue, 4 Sep 2018 21:19:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 916122A124 for ; Tue, 4 Sep 2018 21:19:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 856F92A128; Tue, 4 Sep 2018 21:19:38 +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 C004B2A127 for ; Tue, 4 Sep 2018 21:19:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727443AbeIEBqb (ORCPT ); Tue, 4 Sep 2018 21:46:31 -0400 Received: from mail-by2nam01on0055.outbound.protection.outlook.com ([104.47.34.55]:30752 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727320AbeIEBqa (ORCPT ); Tue, 4 Sep 2018 21:46:30 -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=OqK6ZNnYjJSPIZMLiojoMtgrn1C3Gv5pmO9g2c3X2S0=; b=KDZTF/ax8CpBySZQU4KDmwjfo6Be97qRxJVQX0JAHWDf4iiwmRt0j5W5AkdBPOIg6zHCvf76ABPO/8KB0uEkMmpd2thUg8GQULcQAt5gVcBFLZd5ol2Ai96VvI7QN+xSpqatHClKgfp/ra6TkwEHhK96oyXoCoa1jwOFuO0ERqQ= Received: from DM5PR07CA0075.namprd07.prod.outlook.com (2603:10b6:4:ad::40) by DM6PR07MB4395.namprd07.prod.outlook.com (2603:10b6:5:bf::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.14; Tue, 4 Sep 2018 21:19:33 +0000 Received: from CO1NAM05FT049.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::208) by DM5PR07CA0075.outlook.office365.com (2603:10b6:4:ad::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.14 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 CO1NAM05FT049.mail.protection.outlook.com (10.152.96.164) 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:20 -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 w84LJMJF031986; 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 w84LJMn1031985; Tue, 4 Sep 2018 14:19:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 06/13] qla2xxx: Add support for ZIO6 interrupt threshold Date: Tue, 4 Sep 2018 14:19:14 -0700 Message-ID: <20180904211921.31927-7-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)(346002)(136003)(396003)(39860400002)(2980300002)(438002)(189003)(199004)(476003)(2616005)(446003)(336012)(575784001)(86362001)(486006)(106466001)(11346002)(87636003)(44832011)(478600001)(1076002)(81156014)(126002)(47776003)(2906002)(186003)(26005)(36756003)(14444005)(6666003)(106002)(8936002)(50226002)(8676002)(16586007)(110136005)(54906003)(72206003)(69596002)(356003)(5660300001)(4326008)(316002)(42186006)(51416003)(76176011)(305945005)(80596001)(50466002)(48376002)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB4395;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;CO1NAM05FT049;1:PwiUUnowUGlWvsvv/F0k8f0uuBD4y64RvC4XFCPG1lvQU1QGilb5hfbl7exBB5l1LFALpoBCyaIDg481w30U1Z4ceBJCrQ100c3IbRtE2+WoJL1VJABu+X6fhczIVLlF X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c8c09a9-eb03-41a0-a71b-08d612ac1bcd X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR07MB4395; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4395;3:wJFMrgHHNwbPK3HR71MA/xmBCAOt7CmjC/fRzPBlbu9H5+EmyILR6KlwXoOSw0ECZvufW57rClAxWNp2yaXaMThd/YmSf/EWgGVZKL+LQghV639pMKq0aAmPGhfIgjuRS/axEPi/ibwOAtMjOblgRsGEbiWVTvVchqfcSSiPHzbkhv9yogX3eDR9fI7Cdiy5zSKUuHN+mQ2dOgR+XIrr45X/qpvMG7BpKyEfkbsVNFPjA7wk71ImLvXAE6dKwVwO/jHZu3pooQmLAs6bjtFcPePvVrVDrBGDHXhUdlqzEX7CUIE9tOetyL8yWv4T2+U8PFlCGiCBfit3it953vGOf/VDFmey2Sz8dzLzipIcTpQ=;25:DbOBF2GIcZqiPms2Ewrn++XjPAUj5+dfIPaUel4POnNmk2uDSw4UHZun4PPqV9Qr3damYPJOK/o8eT+lwwddJA5vP0Q4l6WMxTylEOpT+fuVYVm/k6PYEBYSWDuSV7mhk2LnqhxvPXLMj+DKiJQGeBNx/9nAwvfGwZRqxLaDpG/qbVshEVYlOV5QzGaRzmNITgZdE3rcru+GnKBaBNEms37xDzcFcFmThZDD51MbV6C0aXXr8XJY6zje5iMQ2GOQiNVRSlhL4k/MS9yG48bmgfaiogg+EFgULIz21tUrHwon/2E82WXHtb09x0NqsTzrqcR99fNbyFg5aThckBkQLQ== X-MS-TrafficTypeDiagnostic: DM6PR07MB4395: X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4395;31:zWNAPUHEn5pZY0QwbSlI80N/h2GhwkHP7ClVHAsITrlaqh1zoO6Rpl6KUZ2uJif4nZdJJ3Rkdf+sqwSYeScBknBk9AN/5jg1uKEPbQiUejDroPMDUPZssNZkNjfGpyrzkKCiy08KKeaOwExQpm3TCSMr9kNeydRp0kp99Mp+yzQOQr2HaNExIA+KQGBkM5GSWFIHb+4N3h5y1O5vzUaAGBORTQOmbvNQv+pS0Om1Zeo=;20:WO34OQDUXtzwiMwBaLGJD9Vc/t9675+13j+fRCf8uD0QWdIWCrDKSFmh+M7WvY6yxzk6OZqQ2MqGygBKOyCSj00Z4uFyw0RzzKDmk0nDm6EhPmLT5BYEz6xKjamMHEvjPRIsNlgwLaXIgo6bp9WDvlHmdxyuVFOcJeVrBZX/F67Xjt+1iLoTrnPWgOctSW40B1Flafj9hzYdeyRGvU0K+Tup87KHag5SzIhoFghoSOiuVClmLhWEWREyNH1ruBlaZxWSDVEIGTpP+HZhuB94dMDV89v3zwiK64BLsKUGizESX+tPPKQLla1u90iIrStrNxVrLRbgASZbDOBPkRjcxBwKtx3qHozZwdARUCZshoanDe7k6XtrASUXy8u5TpiKVBfwzViRbvnWModuVwkTcB6vbHaQUEKyvz7B+VCBVhFEREemOhX+SEUlS+3CrFWh24sHoFCcgSKbb85QuySOGgN4qP3vQHwl9/hKuX5qvZyQB4+Yu3K6ZpcJc03VuWIb 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)(3231311)(944501410)(52105095)(93006095)(93004095)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:DM6PR07MB4395;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB4395; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4395;4:7CmT6Djv8qtb8+KZfFbNZo3I7nHZg2PooAiDfryNmcKlW2HfMZXgw8+XoQfClZ5QyA0tQjqauAb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GmZjp28OKgds0YY7TXsGmYe9BiViQaL2D2T5LU9VOMm/PYI0mmrMHuzjmmN9m1Zbu1JL3iWGTI1lAykpHgLW97YrnRhqgUClZgsS0YoczmXTwckLtlV6jU/VGmLpCETlCGxgakJwthk7Mbotolm3OTX4QxD52ZVyVh7Q==;5:aQSUc8WgRnHo3dwz6/hHy1G4rCJpPar9ywQprTxyvtaM4xhRR8Kz5HRDrOvR2R4IW6gHAbNQ0NcmWT8+y0JKnDArAZEf61tl2bcH7CDysNR0m5NMsqB3gfVSvYI1T7KDVdsQhMaA/8auDQHOYvpy+5xDxGMx+b9wkH9wsh+lFWc=;7:2Jvcieyf5kJ2/GQg8GEE1NW6syE6RPMjZ2AleEpQW6+5hFahql1RF9l2/Raic6J04qvHrR9bzPVh7NrLNOLAoQRuVugxzsI/dEqY/H80bentGiLlcOIMSHYiCfzJhPyww+RJDXe2GwptDkU3bjSVsKIZi0hQdfVeAtdYhBwqId7zpbCCd0UFYENoNu/rMLv+bzwnph8n87HIuV3ddjroP4iv6Hwp8bW7J+gv6CzpsdxmNxW0prrGQquydbW4eiyS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 21:19:32.7141 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c8c09a9-eb03-41a0-a71b-08d612ac1bcd 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: DM6PR07MB4395 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 Add SysFS support to control zio6 interrupt threshold. Using this SysFS hook user can set when to generate intrrupts. This value will be used to tell firmware to generate interrupt at a cetratin interval. If the number of exchanges/commands fall below defiened setting, then the interrupt will be generated immediately by the firmware. By default ZIO6 will coalesce interrupts to a specified interval regardless of low traffic or high traffic. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 32 +++++++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_def.h | 7 ++++++- drivers/scsi/qla2xxx/qla_init.c | 5 +++++ drivers/scsi/qla2xxx/qla_mbx.c | 1 + drivers/scsi/qla2xxx/qla_os.c | 42 ++++++++++++++++++++++++++++++--------- drivers/scsi/qla2xxx/qla_target.c | 17 ---------------- 6 files changed, 77 insertions(+), 27 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 14c496bab280..e1ae880d5b68 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1208,6 +1208,34 @@ qla2x00_zio_timer_store(struct device *dev, struct device_attribute *attr, } static ssize_t +qla_zio_threshold_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + + return scnprintf(buf, PAGE_SIZE, "%d exchanges\n", + vha->hw->last_zio_threshold); +} + +static ssize_t +qla_zio_threshold_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + int val = 0; + + if (vha->hw->zio_mode != QLA_ZIO_MODE_6) + return -EINVAL; + if (sscanf(buf, "%d", &val) != 1) + return -EINVAL; + if (val > 256) + return -ERANGE; + + atomic_set(&vha->hw->zio_threshold, val); + return strlen(buf); +} + +static ssize_t qla2x00_beacon_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -1651,6 +1679,9 @@ static DEVICE_ATTR(allow_cna_fw_dump, S_IRUGO | S_IWUSR, static DEVICE_ATTR(pep_version, S_IRUGO, qla2x00_pep_version_show, NULL); static DEVICE_ATTR(min_link_speed, S_IRUGO, qla2x00_min_link_speed_show, NULL); static DEVICE_ATTR(max_speed_sup, S_IRUGO, qla2x00_max_speed_sup_show, NULL); +static DEVICE_ATTR(zio_threshold, 0644, + qla_zio_threshold_show, + qla_zio_threshold_store); struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_driver_version, @@ -1687,6 +1718,7 @@ struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_pep_version, &dev_attr_min_link_speed, &dev_attr_max_speed_sup, + &dev_attr_zio_threshold, NULL, }; diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 8cbfbeb0751c..3a03fe217ac2 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -4190,6 +4190,10 @@ struct qla_hw_data { atomic_t nvme_active_aen_cnt; uint16_t nvme_last_rptd_aen; /* Last recorded aen count */ + + atomic_t zio_threshold; + uint16_t last_zio_threshold; +#define DEFAULT_ZIO_THRESHOLD 64 }; #define FW_ABILITY_MAX_SPEED_MASK 0xFUL @@ -4269,10 +4273,11 @@ typedef struct scsi_qla_host { #define FX00_CRITEMP_RECOVERY 25 #define FX00_HOST_INFO_RESEND 26 #define QPAIR_ONLINE_CHECK_NEEDED 27 -#define SET_ZIO_THRESHOLD_NEEDED 28 +#define SET_NVME_ZIO_THRESHOLD_NEEDED 28 #define DETECT_SFP_CHANGE 29 #define N2N_LOGIN_NEEDED 30 #define IOCB_WORK_ACTIVE 31 +#define SET_ZIO_THRESHOLD_NEEDED 32 unsigned long pci_flags; #define PFLG_DISCONNECTED 0 /* PCI device removed */ diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index c3c7ab6fe6e1..fbbf530a38e0 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3532,6 +3532,11 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) if (rval == QLA_SUCCESS) { qla24xx_detect_sfp(vha); + if ((IS_QLA83XX(ha) || IS_QLA27XX(ha)) && + (ha->zio_mode == QLA_ZIO_MODE_6)) + qla27xx_set_zio_threshold(vha, + ha->last_zio_threshold); + rval = qla2x00_set_exlogins_buffer(vha); if (rval != QLA_SUCCESS) goto failed; diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 9d5e320fc1bc..3213017658a6 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -60,6 +60,7 @@ static struct rom_cmd { { MBC_GET_ADAPTER_LOOP_ID }, { MBC_READ_SFP }, { MBC_GET_RNID_PARAMS }, + { MBC_GET_SET_ZIO_THRESHOLD }, }; static int is_rom_cmd(uint16_t cmd) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index d0d5e332bafc..6fa321a4229d 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2840,6 +2840,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) atomic_set(&ha->num_pend_mbx_stage1, 0); atomic_set(&ha->num_pend_mbx_stage2, 0); atomic_set(&ha->num_pend_mbx_stage3, 0); + atomic_set(&ha->zio_threshold, DEFAULT_ZIO_THRESHOLD); + ha->last_zio_threshold = DEFAULT_ZIO_THRESHOLD; /* Assign ISP specific operations. */ if (IS_QLA2100(ha)) { @@ -6224,17 +6226,28 @@ qla2x00_do_dpc(void *data) mutex_unlock(&ha->mq_lock); } - if (test_and_clear_bit(SET_ZIO_THRESHOLD_NEEDED, &base_vha->dpc_flags)) { + if (test_and_clear_bit(SET_NVME_ZIO_THRESHOLD_NEEDED, + &base_vha->dpc_flags)) { ql_log(ql_log_info, base_vha, 0xffffff, "nvme: SET ZIO Activity exchange threshold to %d.\n", ha->nvme_last_rptd_aen); - if (qla27xx_set_zio_threshold(base_vha, ha->nvme_last_rptd_aen)) { + if (qla27xx_set_zio_threshold(base_vha, + ha->nvme_last_rptd_aen)) { ql_log(ql_log_info, base_vha, 0xffffff, - "nvme: Unable to SET ZIO Activity exchange threshold to %d.\n", - ha->nvme_last_rptd_aen); + "nvme: Unable to SET ZIO Activity exchange threshold to %d.\n", + ha->nvme_last_rptd_aen); } } + if (test_and_clear_bit(SET_ZIO_THRESHOLD_NEEDED, + &base_vha->dpc_flags)) { + ql_log(ql_log_info, base_vha, 0xffffff, + "SET ZIO Activity exchange threshold to %d.\n", + ha->last_zio_threshold); + qla27xx_set_zio_threshold(base_vha, + ha->last_zio_threshold); + } + if (!IS_QLAFX00(ha)) qla2x00_do_dpc_all_vps(base_vha); @@ -6447,13 +6460,24 @@ qla2x00_timer(struct timer_list *t) * FC-NVME * see if the active AEN count has changed from what was last reported. */ - if (!vha->vp_idx && - atomic_read(&ha->nvme_active_aen_cnt) != ha->nvme_last_rptd_aen && - ha->zio_mode == QLA_ZIO_MODE_6) { + if (!vha->vp_idx && (atomic_read(&ha->nvme_active_aen_cnt) != + ha->nvme_last_rptd_aen) && ha->zio_mode == QLA_ZIO_MODE_6) { ql_log(ql_log_info, vha, 0x3002, - "nvme: Sched: Set ZIO exchange threshold to %d.\n", - ha->nvme_last_rptd_aen); + "nvme: Sched: Set ZIO exchange threshold to %d.\n", + ha->nvme_last_rptd_aen); ha->nvme_last_rptd_aen = atomic_read(&ha->nvme_active_aen_cnt); + set_bit(SET_NVME_ZIO_THRESHOLD_NEEDED, &vha->dpc_flags); + start_dpc++; + } + + if (!vha->vp_idx && + (atomic_read(&ha->zio_threshold) != ha->last_zio_threshold) && + (ha->zio_mode == QLA_ZIO_MODE_6) && + (IS_QLA83XX(ha) || IS_QLA27XX(ha))) { + ql_log(ql_log_info, vha, 0x3002, + "Sched: Set ZIO exchange threshold to %d.\n", + ha->last_zio_threshold); + ha->last_zio_threshold = atomic_read(&ha->zio_threshold); set_bit(SET_ZIO_THRESHOLD_NEEDED, &vha->dpc_flags); start_dpc++; } diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index c2076758a4b6..79c290fc36dd 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -7052,14 +7052,6 @@ qlt_24xx_config_nvram_stage2(struct scsi_qla_host *vha, memcpy(icb->node_name, ha->tgt.tgt_node_name, WWN_SIZE); icb->firmware_options_1 |= cpu_to_le32(BIT_14); } - - /* disable ZIO at start time. */ - if (!vha->flags.init_done) { - uint32_t tmp; - tmp = le32_to_cpu(icb->firmware_options_2); - tmp &= ~(BIT_3 | BIT_2 | BIT_1 | BIT_0); - icb->firmware_options_2 = cpu_to_le32(tmp); - } } void @@ -7163,15 +7155,6 @@ qlt_81xx_config_nvram_stage2(struct scsi_qla_host *vha, memcpy(icb->node_name, ha->tgt.tgt_node_name, WWN_SIZE); icb->firmware_options_1 |= cpu_to_le32(BIT_14); } - - /* disable ZIO at start time. */ - if (!vha->flags.init_done) { - uint32_t tmp; - tmp = le32_to_cpu(icb->firmware_options_2); - tmp &= ~(BIT_3 | BIT_2 | BIT_1 | BIT_0); - icb->firmware_options_2 = cpu_to_le32(tmp); - } - } void