diff options
author | Sreekanth Reddy <Sreekanth.Reddy@lsi.com> | 2013-08-14 08:53:20 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-09-03 10:27:55 -0400 |
commit | 9c5000606d2a0dda8de892ac00b1bcf44b1834f6 (patch) | |
tree | 0d890cc0f393a7adb02ca117f4808aacb32ff665 | |
parent | a9623da05f8a2930fadafd27fe621b16886b259d (diff) |
[SCSI] mpt3sas: Added a driver module parameter max_msix_vectors
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>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_base.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 34ff896a140d..fa785062e97b 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c | |||
@@ -82,6 +82,10 @@ static int msix_disable = -1; | |||
82 | module_param(msix_disable, int, 0); | 82 | module_param(msix_disable, int, 0); |
83 | MODULE_PARM_DESC(msix_disable, " disable msix routed interrupts (default=0)"); | 83 | MODULE_PARM_DESC(msix_disable, " disable msix routed interrupts (default=0)"); |
84 | 84 | ||
85 | static int max_msix_vectors = 8; | ||
86 | module_param(max_msix_vectors, int, 0); | ||
87 | MODULE_PARM_DESC(max_msix_vectors, | ||
88 | " max msix vectors - (default=8)"); | ||
85 | 89 | ||
86 | static int mpt3sas_fwfault_debug; | 90 | static int mpt3sas_fwfault_debug; |
87 | MODULE_PARM_DESC(mpt3sas_fwfault_debug, | 91 | MODULE_PARM_DESC(mpt3sas_fwfault_debug, |
@@ -1721,6 +1725,16 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc) | |||
1721 | ioc->reply_queue_count = min_t(int, ioc->cpu_count, | 1725 | ioc->reply_queue_count = min_t(int, ioc->cpu_count, |
1722 | ioc->msix_vector_count); | 1726 | ioc->msix_vector_count); |
1723 | 1727 | ||
1728 | printk(MPT3SAS_FMT "MSI-X vectors supported: %d, no of cores" | ||
1729 | ": %d, max_msix_vectors: %d\n", ioc->name, ioc->msix_vector_count, | ||
1730 | ioc->cpu_count, max_msix_vectors); | ||
1731 | |||
1732 | if (max_msix_vectors > 0) { | ||
1733 | ioc->reply_queue_count = min_t(int, max_msix_vectors, | ||
1734 | ioc->reply_queue_count); | ||
1735 | ioc->msix_vector_count = ioc->reply_queue_count; | ||
1736 | } | ||
1737 | |||
1724 | entries = kcalloc(ioc->reply_queue_count, sizeof(struct msix_entry), | 1738 | entries = kcalloc(ioc->reply_queue_count, sizeof(struct msix_entry), |
1725 | GFP_KERNEL); | 1739 | GFP_KERNEL); |
1726 | if (!entries) { | 1740 | if (!entries) { |