Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1504839 > unrolled thread

[PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors enabled when non RDPQ card is enumerated first.

Started bySuganath Prabu S <suganath-prabu.subramani@broadcom.com>
First post2016-10-20 14:30 +0200
Last post2016-10-25 16:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors  enabled when  non RDPQ card is enumerated first. Suganath Prabu S <suganath-prabu.subramani@broadcom.com> - 2016-10-20 14:30 +0200
    Re: [PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors  enabled when non RDPQ card is enumerated first. Hannes Reinecke <hare@suse.de> - 2016-10-24 16:50 +0200
    Re: [PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors  enabled when non RDPQ card is enumerated first. Tomas Henzl <thenzl@redhat.com> - 2016-10-25 16:40 +0200

#1504839 — [PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors enabled when non RDPQ card is enumerated first.

FromSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
Date2016-10-20 14:30 +0200
Subject[PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors enabled when non RDPQ card is enumerated first.
Message-ID<sukDV-7vO-51@gated-at.bofh.it>
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>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index a1a5ceb..4ea81e1 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -1959,7 +1959,7 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
 {
 	struct msix_entry *entries, *a;
 	int r;
-	int i;
+	int i, local_max_msix_vectors;
 	u8 try_msix = 0;
 
 	if (msix_disable == -1 || msix_disable == 0)
@@ -1979,13 +1979,15 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
 	  ioc->cpu_count, max_msix_vectors);
 
 	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) {
-		ioc->reply_queue_count = min_t(int, max_msix_vectors,
+	if (local_max_msix_vectors > 0) {
+		ioc->reply_queue_count = min_t(int, local_max_msix_vectors,
 			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;
 
 	if (ioc->msix_vector_count < ioc->cpu_count)
-- 
1.8.3.1

[toc] | [next] | [standalone]


#1507263 — Re: [PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors enabled when non RDPQ card is enumerated first.

FromHannes Reinecke <hare@suse.de>
Date2016-10-24 16:50 +0200
SubjectRe: [PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors enabled when non RDPQ card is enumerated first.
Message-ID<svOJA-qi-43@gated-at.bofh.it>
In reply to#1504839
On 10/20/2016 02:20 PM, Suganath Prabu S wrote:
> 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>
> ---
>  drivers/scsi/mpt3sas/mpt3sas_base.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
> index a1a5ceb..4ea81e1 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_base.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
> @@ -1959,7 +1959,7 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
>  {
>  	struct msix_entry *entries, *a;
>  	int r;
> -	int i;
> +	int i, local_max_msix_vectors;
>  	u8 try_msix = 0;
>
>  	if (msix_disable == -1 || msix_disable == 0)
> @@ -1979,13 +1979,15 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
>  	  ioc->cpu_count, max_msix_vectors);
>
>  	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) {
> -		ioc->reply_queue_count = min_t(int, max_msix_vectors,
> +	if (local_max_msix_vectors > 0) {
> +		ioc->reply_queue_count = min_t(int, local_max_msix_vectors,
>  			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;
>
>  	if (ioc->msix_vector_count < ioc->cpu_count)
>
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

[toc] | [prev] | [next] | [standalone]


#1508329 — Re: [PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors enabled when non RDPQ card is enumerated first.

FromTomas Henzl <thenzl@redhat.com>
Date2016-10-25 16:40 +0200
SubjectRe: [PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors enabled when non RDPQ card is enumerated first.
Message-ID<swb3s-6RL-27@gated-at.bofh.it>
In reply to#1504839
On 20.10.2016 14:20, Suganath Prabu S wrote:
> 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: Tomas Henzl <thenzl@redhat.com>

Tomas

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web