public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [SCSI] mpt3sas: Added a driver module parameter max_msix_vectors
@ 2013-08-14 12:53 Sreekanth Reddy
  2013-08-14 15:17 ` Tomas Henzl
  0 siblings, 1 reply; 6+ messages in thread
From: Sreekanth Reddy @ 2013-08-14 12:53 UTC (permalink / raw)
  To: jejb, JBottomley
  Cc: linux-scsi, thenzl, Nagalakshmi.Nandigama, Sreekanth.Reddy

Added a 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 parameter.

The default value of this module parameter is set to 8. The default value of this parameter
is set to 8 inorder to reduce the amount of memory required for Reply Descriptor Post queue.
This is because with the higher MSI-X vectors, some times kernel is not able to allocate the
requested amount of memory and crash is observed. To overcome this problem,
the default value is set to 8.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
--- 

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index a32d63b..d40ba0b 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -82,6 +82,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 = 8;
+module_param(max_msix_vectors, int, 0);
+MODULE_PARM_DESC(max_msix_vectors,
+	" max msix vectors - (default=8)");
 
 static int mpt3sas_fwfault_debug;
 MODULE_PARM_DESC(mpt3sas_fwfault_debug,
@@ -1723,6 +1727,16 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
 	ioc->reply_queue_count = min_t(int, ioc->cpu_count,
 	    ioc->msix_vector_count);
 
+	printk(MPT3SAS_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);
+
+	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;
+	}
+
 	entries = kcalloc(ioc->reply_queue_count, sizeof(struct msix_entry),
 	    GFP_KERNEL);
 	if (!entries) {


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-22 13:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-14 12:53 [PATCH] [SCSI] mpt3sas: Added a driver module parameter max_msix_vectors Sreekanth Reddy
2013-08-14 15:17 ` Tomas Henzl
2013-08-14 15:38   ` Reddy, Sreekanth
2013-08-15 10:05     ` Tomas Henzl
2013-08-15 13:53     ` Joe Lawrence
2013-08-22 13:45       ` Reddy, Sreekanth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox