From patchwork Thu Jan 28 15:34:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 8151651 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 96DB9BEEE5 for ; Thu, 28 Jan 2016 15:37:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1E3E20373 for ; Thu, 28 Jan 2016 15:37:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F046920376 for ; Thu, 28 Jan 2016 15:36:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967117AbcA1Pgv (ORCPT ); Thu, 28 Jan 2016 10:36:51 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:33083 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966476AbcA1Pfs (ORCPT ); Thu, 28 Jan 2016 10:35:48 -0500 Received: by mail-pa0-f53.google.com with SMTP id cy9so24858603pac.0 for ; Thu, 28 Jan 2016 07:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5SeDItGdFeKMJT3ZxIZGxUpjZxK4e9XozBTLBmFUtGQ=; b=m52QoG9M7PT6kHi8qfednBdLCF8OiYZFWgCgMupMZZ0/eL0DMQe4jmRC2caB9S5pNe oy+FXyoV+pU1eiOZhw0/OiFy+PDZBr2QBjoPoFaS4L2UiSgEEAjtU1Xj6JQU/xFO+jwm 4263crxt2csPY0PPAY5ijsEwsE1sDLidToVTE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5SeDItGdFeKMJT3ZxIZGxUpjZxK4e9XozBTLBmFUtGQ=; b=E6ZEX1QmgqB6fz3SBsDiuPOtdic6lMy5vftRPz2lPdKdmdpbIABuai5VtU6Tk9nnph 1N9TwiG1xKQeuXj8tgzSc1R799Bj2g2XEyvODf1h16fPQEBzvGhkHaekjvJsiGR+bi3C 913omI8i0+0FEe1WtrkuszakgNCouZ9P7MQhQJmHGZWWNz0NCsE6ipfQGfniQUDTb10w /FbkUxBElZBEt1HZRtjAEcyqGprtOFn5HdjPrlwREgnnf0Y3hGAMcTD2dHCiazAo/1YI hgQpgpxDx5F28hPblVDKaCgaEv1xlpoYJqG5paRQxWsszyyBcB9arZTSyvuZscc+crP2 bmXg== X-Gm-Message-State: AG10YOQDefKPEa496g5EhU2XRwS34NWTtqy+pxUcLVI1nhy0FPplMmDodmX+D/WJKcys0TSd X-Received: by 10.66.139.234 with SMTP id rb10mr5414919pab.82.1453995346931; Thu, 28 Jan 2016 07:35:46 -0800 (PST) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id y18sm17231752pfi.84.2016.01.28.07.35.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 07:35:45 -0800 (PST) From: Sumit Saxena To: jbottomley@parallels.com, hch@infradead.org, martin.petersen@oracle.com, thenzl@redhat.com Cc: linux-scsi@vger.kernel.org, kashyap.desai@avagotech.com, sumit.saxena@avagotech.com Subject: [PATCH v2 10/15] megaraid_sas: IO throttling support Date: Thu, 28 Jan 2016 21:04:31 +0530 Message-Id: <1453995276-24955-11-git-send-email-sumit.saxena@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1453995276-24955-1-git-send-email-sumit.saxena@avagotech.com> References: <1453995276-24955-1-git-send-email-sumit.saxena@avagotech.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch will add capability in driver to tell firmware that it can throttle IOs in case Controller's Queue depth is downgraded post OFU (Online firmware upgrade). This feature will ensure firmware can be downgraded from higher queue depth to lower queue depth without needing system reboot. Added throttling code in IO path of driver, in case OS tries to send more IOs than post OFU firmware's queue depth. I have accomodated Tomas' comments provided on last time sent patch- removed the un-necessary code of throttling of IOs against can_queue inside function- megasas_build_and_issue_cmd_fusion() as SCSI mid layer will anyways does this. Signed-off-by: Sumit Saxena Signed-off-by: Kashyap Desai --- drivers/scsi/megaraid/megaraid_sas.h | 6 ++++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 2a2f491..c8d25a7 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1537,7 +1537,8 @@ union megasas_sgl_frame { typedef union _MFI_CAPABILITIES { struct { #if defined(__BIG_ENDIAN_BITFIELD) - u32 reserved:21; + u32 reserved:20; + u32 support_qd_throttling:1; u32 support_fp_rlbypass:1; u32 support_vfid_in_ioframe:1; u32 support_ext_io_size:1; @@ -1561,7 +1562,8 @@ typedef union _MFI_CAPABILITIES { u32 support_ext_io_size:1; u32 support_vfid_in_ioframe:1; u32 support_fp_rlbypass:1; - u32 reserved:21; + u32 support_qd_throttling:1; + u32 reserved:20; #endif } mfi_capabilities; __le32 reg; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 6b8547c..2c4912f 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -803,6 +803,7 @@ megasas_ioc_init_fusion(struct megasas_instance *instance) if (!dual_qdepth_disable) drv_ops->mfi_capabilities.support_ext_queue_depth = 1; + drv_ops->mfi_capabilities.support_qd_throttling = 1; /* Convert capability to LE32 */ cpu_to_le32s((u32 *)&init_frame->driver_operations.mfi_capabilities);