Commit bb350661 authored by Suganath Prabu Subramani's avatar Suganath Prabu Subramani Committed by Martin K. Petersen

scsi: mpt3sas: Fix for incorrect numbers for MSIX vectors enabled when non...

scsi: mpt3sas: Fix for incorrect numbers for MSIX vectors enabled when non RDPQ card is enumerated first.

No. of MSIX vectors supported = min (Total no. of CPU cores,
MSIX vectors supported by card)

when RDPQ is disabled "max_msix_vectors" module parameter which was
declared as global was set to '8' and hence if there are more than one card
in system among which if RDPQ disabled card is enumerated first then only 8
MSIX vectors was getting enabled for all the cards(including RDPQ enabled
card,which can support more than 8 MSIX vectors).

Used local variable instead of global variable ,if RDPQ is disabled this
local variable is set to '8' else it is set to "max_msix_vectors" (by
default this is set to -1, whose value can be set by user during driver
load time).So now regardless of whether RDPQ disabled card is enumerated
first or RDPQ enabled card is enumerated first , MSIX vectors enabled
depends on the cards capability.
Signed-off-by: default avatarChaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: default avatarSathya Prakash <sathya.prakash@broadcom.com>
Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b2fe6be7
...@@ -1959,7 +1959,7 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc) ...@@ -1959,7 +1959,7 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
{ {
struct msix_entry *entries, *a; struct msix_entry *entries, *a;
int r; int r;
int i; int i, local_max_msix_vectors;
u8 try_msix = 0; u8 try_msix = 0;
if (msix_disable == -1 || msix_disable == 0) if (msix_disable == -1 || msix_disable == 0)
...@@ -1979,13 +1979,15 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc) ...@@ -1979,13 +1979,15 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
ioc->cpu_count, max_msix_vectors); ioc->cpu_count, max_msix_vectors);
if (!ioc->rdpq_array_enable && max_msix_vectors == -1) if (!ioc->rdpq_array_enable && max_msix_vectors == -1)
max_msix_vectors = 8; local_max_msix_vectors = 8;
else
local_max_msix_vectors = max_msix_vectors;
if (max_msix_vectors > 0) { if (local_max_msix_vectors > 0) {
ioc->reply_queue_count = min_t(int, max_msix_vectors, ioc->reply_queue_count = min_t(int, local_max_msix_vectors,
ioc->reply_queue_count); ioc->reply_queue_count);
ioc->msix_vector_count = ioc->reply_queue_count; ioc->msix_vector_count = ioc->reply_queue_count;
} else if (max_msix_vectors == 0) } else if (local_max_msix_vectors == 0)
goto try_ioapic; goto try_ioapic;
if (ioc->msix_vector_count < ioc->cpu_count) if (ioc->msix_vector_count < ioc->cpu_count)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment