From patchwork Mon Jun 4 05:09:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10445703 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 A994160284 for ; Mon, 4 Jun 2018 05:10:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A4DA286C2 for ; Mon, 4 Jun 2018 05:10:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AE4B288F4; Mon, 4 Jun 2018 05:10: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 AC4FA286C2 for ; Mon, 4 Jun 2018 05:10:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751438AbeFDFJ7 (ORCPT ); Mon, 4 Jun 2018 01:09:59 -0400 Received: from mail-sn1nam02on0043.outbound.protection.outlook.com ([104.47.36.43]:23291 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751061AbeFDFJ6 (ORCPT ); Mon, 4 Jun 2018 01:09:58 -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=Y+9asqtxtzs17GYKquPjkMzxxgve1OhABh4sNMO1bHQ=; b=WJJ4wcEL5ncojzsBzq4U92xZoNGqzJZDeKdZkCm4YqLewYqpIAbTsRYkFWQZ3kjQrRYej3tmF7AxsN4naQshMVsT1yVqgRt1pOjJNwBPh8imgHhzWqScJ4jaqLo3CAPjScUMiS+QHE4/ErbQnEC8e8BlEevmzXI9JHzpaa9zvfs= Received: from DM6PR07CA0026.namprd07.prod.outlook.com (2603:10b6:5:94::39) by DM5PR07MB2825.namprd07.prod.outlook.com (2603:10b6:3:7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.15; Mon, 4 Jun 2018 05:09:55 +0000 Received: from DM3NAM05FT034.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::208) by DM6PR07CA0026.outlook.office365.com (2603:10b6:5:94::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.820.11 via Frontend Transport; Mon, 4 Jun 2018 05:09:55 +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 DM3NAM05FT034.mail.protection.outlook.com (10.152.98.146) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.841.6 via Frontend Transport; Mon, 4 Jun 2018 05:09:55 +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; Sun, 3 Jun 2018 22:09:52 -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 w5459r3X002416; Sun, 3 Jun 2018 22:09:53 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w5459rYC002415; Sun, 3 Jun 2018 22:09:53 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH] qla2xxx: Fix setting lower transfer speed if GPSC fails Date: Sun, 3 Jun 2018 22:09:53 -0700 Message-ID: <20180604050953.2381-1-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 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)(39850400004)(39380400002)(396003)(376002)(2980300002)(438002)(199004)(189003)(42186006)(2906002)(16586007)(356003)(336012)(5660300001)(305945005)(47776003)(54906003)(110136005)(86362001)(8676002)(316002)(126002)(50226002)(80596001)(106002)(106466001)(44832011)(486006)(81156014)(81166006)(72206003)(186003)(478600001)(2616005)(69596002)(4326008)(476003)(87636003)(1857600001)(59450400001)(51416003)(50466002)(36756003)(1076002)(8936002)(48376002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB2825; 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; DM3NAM05FT034; 1:eNA0+2eOlrJOQojthroXvDQgH3yfWNJ3i63yloqPkWFldtlEhsI9RD9DaxrQMZlfwwQT6jNKE1etWh8MNZXOM8BxYFeY/MZXS3TCCal0QP1sGjbZfgHinpKjaSe2uec2 X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153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d60w+4Il4vJmjN3NqgV+HM=; 20:kgEEYlUcURB1EjtKCVXFj/uQRv5ADxTwIHkciTymiLKpB/KCrTH5JRzI1yzwODf9IjaFxj8wbI96tiB3w5b45cGp7RmXf0cNLEupP6xnMN4C/dMUnHp4/jSsz7vCod/ToPAKRkCtbc1QdLhg7N2ZmWCkc2pVCXBsP45mtaGa/LrBT0J46gVPdmjIJbOTMiHhOcgWy+CSzQtwT1sIbW3C8PVtEzeK7jDmbo5hD1q2ol8mf/8ZCC9v5uFhHt1NCCzpUyGGx+IlF1y1LDK0ieGf0kkwZvxJL4QuqSZ7TOvuZzTG6UrhvWzpRDoK6WVwyWNB4MTQMtQPJ3mR0MOax5ul23PJmBn3D7kL6YOAhFPSrtV7rQ/a0SwzG4aRrwQC7wyZunf4G1kC4wod8LbK5P5nE6YcNN5le4HjAei2018+vZstT8Gh0Nbn+gw/tGbl5Yd8CB7Kcc/dTVB7nEvrBpqOivZbW2Gq9c1lLLHXGDvGSKKX5FNRPYHNOWiLEyiZyqCN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93004095)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:DM5PR07MB2825; BCL:0; PCL:0; RULEID:; SRVR:DM5PR07MB2825; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB2825; 4:fq6q3+gi+6SORXz2KLlBXZpiYIcvQf1qPrQbHw1d5ECAjMtKsHGXl1aYXpEhtV0g4gJrCwb/e4MY/iBlm2fcwu1WLcPg14hLo7CjXWexP11MU3Y/V6x0U+7lSF0Y/t20CqJTvXWnU7WxSXhx/lrWRnY5jpjlipq/c8/X6VMOb44fnc25IkoTbnecQodjd4Hj7o4en248NX7znvSEOQ4RlOD383dgTNDUFjeKeNKNn4oO4t+Aw7eYrclB2w0tNZtwXuqcu25GYTWKjF+fj+ySdYFRxr4OEEETcvxce2diSkFFM/eq+h78osLiMN0IT0Eg X-Forefront-PRVS: 069373DFB6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB2825; 23:QNNXvZtzJNvJm+sFRkrkhx17s8ABiR2+Uc//aU4mf?= =?us-ascii?Q?s46LErnQLRa2i1y6fjRyx2Rkk1+vkr5f/F9SzAsCCFld9tVSka2vfvoYjX4n?= =?us-ascii?Q?G+2rHb6n85LQBApGK7cZDzB+AFk9H8MoDNL5Wg/x30hhKtMMfe+FjJ0/KdCK?= =?us-ascii?Q?Mopq9a0PvgaJLAtcnwcegZADf5dTJYEmNHzMHZhxaR5hdSZ54PuoRspFWIuD?= =?us-ascii?Q?0uMT0StVhSsB2x0O9//zLccAnErin+RTbcp9sW4/mkhMkcsMfKJlgiymQzja?= =?us-ascii?Q?SpBU1jS3ysaT8a3sug0MMogkTXpw5wg5fTLtAzydD0Ves2KyceqXhiZaFIHz?= =?us-ascii?Q?YW3xJmOMm1NCN0C3BG5PJF9xBf6HpYuvojnJFSG9WHUVvy2APpu4SoPf/NNx?= =?us-ascii?Q?CY6Ae3RtXON9SlcTPDaUAo+F39fIBSNDr6+NpECfs7eeOGkhnew8qMbKiAvj?= =?us-ascii?Q?m5UkfoE8uWrI74cKSmFemT8/y9NmWNicY1boAOsE+qRRBu5xImL6pzaXpANM?= =?us-ascii?Q?R8IxywtAZ4N0+MZVqmqXVyLnRmrW8SDYT7cTy7GFrxoDxJWXUY0FAhHgt+tt?= =?us-ascii?Q?4UYJbCocGohuZGJp/S99Ehp0bEGT6raP2c/d+UFkhuardSvZ70H++J50/oIT?= =?us-ascii?Q?FVFXpyp9lw5rz9pSC8U+TPEa9Q2LQ924iKI/HfI3UmO3WtoRRPoZ3eakxxzR?= =?us-ascii?Q?tNiOmbwIBi3dOGSJwDyKl0vwnwFAdr6P3OcQa7OfCtTNr6y1oKjIv8bqP4VY?= =?us-ascii?Q?n8WRrp5mHQUl9Gg0rUhEqgjwB7b4BR9f9qpXIQT+aWIrn/N/OvGd6tjs/nng?= =?us-ascii?Q?iOsvQU9iSncwBJMCPQlMOX/KG6SIRMIlfH36FlnGOptDZI+QANu63TFBiL1C?= =?us-ascii?Q?geQN11btJ30FcEY5jHbu3IfIi4lm3V4CHYxfm+o/BUc+9S4YgHfUJdsKin8F?= =?us-ascii?Q?tuh4FAX2R53ypNN7lIY3CWHY+1Sa3gTiWWKaM4TQWvuamt2AICS+sxa5WWR8?= =?us-ascii?Q?6FPBTXoyRkZ1uvfoQZJSyMGN56kQYZIO60O6qSjIhcaIqytMDHAUNE2BM7id?= =?us-ascii?Q?CxQkWK8ir+IQYInOfszXufHrxSmNlGFfGWZxlhH9nJJqgMRaA=3D=3D?= X-Microsoft-Antispam-Message-Info: eg0ykGUparYlCVueZaIBmUuGj/s4fLkTFUvIe78OchLW4+5KH5L5Ux9imLJYukkEdojr6X3NktNUnGpndqP6fLaTIqViyknar2wg3OwFjklxg7MZ3yRdJfUyPOx16KsmzIaoYd5jgXbHgJm6/AM6pMcV7CbSEKxKFqf0PWOoQRxxednkynY+OIRdefvuv2wN X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB2825; 6:e2OcoD0cODhDsAFuIx6HLvZV7++joeVW2SGoMArKIqrJqZ+0rjq+2NJB5dEBZq2xgFjl1HQ91THan9Y5scf2uuZ+J42LE4VfMogHHvCsycng7NqqTlYlQA5K4XOBuXPDEWDaLwVoahFgp1TZlS8HxwXOAu02br+tQeDK8fpydF89jAAuAr66/joZ7XbQ3WpNETA6xj0gKRuuUMu6k95fVe11SaG2Vb3SUf3xIpKDZhqUsrlBF3NeZHguJeu+78/E0kJku/uJU/9tcB+kfb619tTO/5G8w4zK0R7dqA0k/x4OwMNjx7MyJBXqY34eBiWkbbKl3IqwmWfjYChlv2h1dwuKS+ILQ4kz096dR44Hkgd1ZegK4K006gyJLRs3uGYUXJUiZvlgp8iMpwYcStOwUC61N5/RxCxj4q22rHZpsvODV58cWkETuU+6bELgtrUBuDAwpYh33AfNiJUeXyeRRQ==; 5:1GfRDU8Q8clYSwe16SUTbJNprgT9dIV/vvzkaBWQb+mhzGh5Huq4t64AbEA63tBpINbVNxD0K1LafH8JvDjT9vbHw7lYAFxBaD0MgoiE9fbUNzM031RQNljXJ4uihtGLdzUOLj6xsyGY3QayRTjd9APTNHf0AFdkihDw5SLm/SU=; 24:VsLO0dSfL0ly4Vtx1ZL5rsFxgQWVOesSf6gmgVH9wDiZ8A+LRl15XAyHvqUXHFapocHXmQwCFGIrpuM1FdXAImMsFwGcybWgvxP0+NYp/xQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB2825; 7:UJavubauODGNRoG/svnc6U+ItI8Gvrv4KsbZMVd+vZqx7Ab4HBWhjpMRg9GMKWL/VRETLiTzPrrCqXEVlp14k/auq0LZloA7yBQefkQiTOFPMZv3zBH5j3Tozp13t/QKXfivGRS2MIAIdhPEjK1jSKfIn46TSsZiKGnBDP0qvM6B5GZG/ojas7HksplySiDuAuA+du7qNSvbZn8aLtsXZTmSPV1hpfWUFkA09zojwoKS6ITas/HGGDM/KcWmaq0u X-MS-Office365-Filtering-Correlation-Id: 9e7f3abc-6c02-4be7-0408-08d5c9d96959 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2018 05:09:55.2195 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e7f3abc-6c02-4be7-0408-08d5c9d96959 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: DM5PR07MB2825 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 This patch prevents driver from setting lower default speed of 1 GB/sec, if the switch does not support Get Port Speed Capabilities (GPSC) command. Setting this default speed results into much lower write performance for large sequential WRITE. This patch modifies driver to check for gpsc_supported flags and prevents driver from issuing MBC_SET_PORT_PARAM (001Ah) to set default speed of 1 GB/sec. If driver does not send this mailbox command, firmware assumes maximum supported link speed and will operate at the max speed. Cc: stable@vger.kernel.org Signed-off-by: Himanshu Madhani Reported-by: Eda Zhou Reviewed-by: Ewan D. Milne Tested-by: Ewan D. Milne --- Hi Martin, This patch fixes lower write performance for large sequential Writes. Please apply this to 4.18-scsi-fixes at your earliest convenience. Thanks, Himanshu --- drivers/scsi/qla2xxx/qla_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 1aa3720ea2ed..b0430a280ce6 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5007,7 +5007,8 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) return; if (fcport->fp_speed == PORT_SPEED_UNKNOWN || - fcport->fp_speed > ha->link_data_rate) + fcport->fp_speed > ha->link_data_rate || + !ha->flags.gpsc_supported) return; rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed,