Skip to content

Commit bb35066

Browse files
suganathprabu0512martinkpetersen
authored andcommitted
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: Chaitra P B <chaitra.basappa@broadcom.com> Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com> Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent b2fe6be commit bb35066

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/scsi/mpt3sas/mpt3sas_base.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,7 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
19591959
{
19601960
struct msix_entry *entries, *a;
19611961
int r;
1962-
int i;
1962+
int i, local_max_msix_vectors;
19631963
u8 try_msix = 0;
19641964

19651965
if (msix_disable == -1 || msix_disable == 0)
@@ -1979,13 +1979,15 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
19791979
ioc->cpu_count, max_msix_vectors);
19801980

19811981
if (!ioc->rdpq_array_enable && max_msix_vectors == -1)
1982-
max_msix_vectors = 8;
1982+
local_max_msix_vectors = 8;
1983+
else
1984+
local_max_msix_vectors = max_msix_vectors;
19831985

1984-
if (max_msix_vectors > 0) {
1985-
ioc->reply_queue_count = min_t(int, max_msix_vectors,
1986+
if (local_max_msix_vectors > 0) {
1987+
ioc->reply_queue_count = min_t(int, local_max_msix_vectors,
19861988
ioc->reply_queue_count);
19871989
ioc->msix_vector_count = ioc->reply_queue_count;
1988-
} else if (max_msix_vectors == 0)
1990+
} else if (local_max_msix_vectors == 0)
19891991
goto try_ioapic;
19901992

19911993
if (ioc->msix_vector_count < ioc->cpu_count)

0 commit comments

Comments
 (0)