Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756129AbaFYKex (ORCPT ); Wed, 25 Jun 2014 06:34:53 -0400 Received: from mail-bn1blp0184.outbound.protection.outlook.com ([207.46.163.184]:23962 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755990AbaFYKev (ORCPT ); Wed, 25 Jun 2014 06:34:51 -0400 Date: Wed, 25 Jun 2014 16:00:28 +0530 From: "Reddy, Sreekanth" To: , CC: , , , , , , Subject: [RESEND][PATCH 01/10][SCSI]mpt2sas: Added driver module parameter max_msix_vectors Message-ID: <20140625103028.GA12870@avagotech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-EOPAttributedMessage: 0 X-Matching-Connectors: 130481660878918958;(f081dce6-2920-4dfc-23e8-08d07091c5e3);() X-Forefront-Antispam-Report: CIP:192.19.220.100;CTRY:US;IPV:CAL;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(6009001)(199002)(189002)(47776003)(86362001)(106466001)(33656002)(81542001)(92726001)(81342001)(54356999)(87936001)(23726002)(50986999)(83322001)(105596002)(46406003)(19580395003)(107046001)(6806004)(92566001)(99396002)(20776003)(46102001)(21056001)(74502001)(74662001)(76482001)(102836001)(83072002)(26826002)(79102001)(85306003)(57986006)(80022001)(95666004)(77096002)(19580405001)(31966008)(16796002)(85852003)(50466002)(64706001)(36756003)(77982001)(97756001)(44976005)(4396001)(76506005)(83506001)(2101003);DIR:OUT;SFP:;SCL:1;SRVR:BN1PR07MB022;H:COSEXCH10.lsi.com;FPR:;MLV:ovrnspm;PTR:cosexch10.lsi.com;A:1;MX:1;LANG:en; X-Microsoft-Antispam: BL:0;ACTION:Default;RISK:Low;SCL:0;SPMLVL:NotSpam;PCL:0;RULEID: X-Forefront-PRVS: 02530BD3AA Authentication-Results: spf=softfail (sender IP is 192.19.220.100) smtp.mailfrom=Sreekanth.Reddy@avagotech.com; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Added driver module parameter max_msix_vectors. Using this module parameter the maximum number of MSI-X vectors could be set. The number of MSI-X vectors used would be the minimum of MSI-X vectors supported by the HBA, the number of CPU cores and the value set to max_msix_vectors module parameters. Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpt2sas/mpt2sas_base.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index bde63f7..ed810fb 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c @@ -80,6 +80,10 @@ static int msix_disable = -1; module_param(msix_disable, int, 0); MODULE_PARM_DESC(msix_disable, " disable msix routed interrupts (default=0)"); +static int max_msix_vectors = -1; +module_param(max_msix_vectors, int, 0); +MODULE_PARM_DESC(max_msix_vectors, " max msix vectors "); + static int mpt2sas_fwfault_debug; MODULE_PARM_DESC(mpt2sas_fwfault_debug, " enable detection of firmware fault " "and halt firmware - (default=0)"); @@ -1420,6 +1424,16 @@ _base_enable_msix(struct MPT2SAS_ADAPTER *ioc) ioc->reply_queue_count = min_t(int, ioc->cpu_count, ioc->msix_vector_count); + if (max_msix_vectors > 0) { + ioc->reply_queue_count = min_t(int, max_msix_vectors, + ioc->reply_queue_count); + ioc->msix_vector_count = ioc->reply_queue_count; + } + + printk(MPT2SAS_INFO_FMT + "MSI-X vectors supported: %d, no of cores: %d, max_msix_vectors: %d\n", + ioc->name, ioc->msix_vector_count, ioc->cpu_count, max_msix_vectors); + entries = kcalloc(ioc->reply_queue_count, sizeof(struct msix_entry), GFP_KERNEL); if (!entries) { -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/