-----Original Message-----
From: Hannes Reinecke [mailto:h...@suse.de] 
Sent: Tuesday, December 18, 2018 1:57 AM
To: Don Brace <don.br...@microsemi.com>; Kevin Barnett - C33748 
<kevin.barn...@microchip.com>; Scott Teel - C33730 <scott.t...@microchip.com>; 
Justin Lindley - C33718 <justin.lind...@microchip.com>; Scott Benesh - C33703 
<scott.ben...@microchip.com>; bader.alisa...@microchip.com; Gerry Morong - 
C33720 <gerry.mor...@microchip.com>; Mahesh Rajashekhara - I30583 
<mahesh.rajashekh...@microchip.com>; h...@infradead.org; 
j...@linux.vnet.ibm.com; joseph.szczy...@hpe.com; posw...@suse.com; 
shunyong.y...@hxt-semitech.com
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] hpsa: add module parameter to disable irq affinity

EXTERNAL EMAIL


On 12/3/18 11:35 PM, Don Brace wrote:
> The PCI_IRQ_AFFINITY flag prevents customers from changing the 
> smp_affinity and smp_affinity_list entries.
>
> - add a module parameter to allow this flag to be turned
>    off.
>
> - to turn off PCI_IRQ_AFFINITY:
>    flag hpsa_disable_irq_affinity=1
>
> Reviewed-by: David Carroll <david.carr...@microsemi.com>
> Reviewed-by: Scott Teel <scott.t...@microsemi.com>
> Signed-off-by: Don Brace <don.br...@microsemi.com>
> ---
>   drivers/scsi/hpsa.c |   13 ++++++++++---
>   1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 
> c9cccf35e9d7..0aa5aa66151f 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -87,6 +87,10 @@ static int hpsa_simple_mode;
>   module_param(hpsa_simple_mode, int, S_IRUGO|S_IWUSR);
>   MODULE_PARM_DESC(hpsa_simple_mode,
>       "Use 'simple mode' rather than 'performant mode'");
> +static bool hpsa_disable_irq_affinity; 
> +module_param(hpsa_disable_irq_affinity, bool, S_IRUGO|S_IWUSR); 
> +MODULE_PARM_DESC(hpsa_disable_irq_affinity,
> +     "Turn off managed irq affinity. Allows smp_affinity to be 
> +changed.");
>
>   /* define the PCI info for the cards we can control */
>   static const struct pci_device_id hpsa_pci_device_id[] = { @@ 
> -7389,7 +7393,7 @@ static void hpsa_setup_reply_map(struct ctlr_info *h)
>    */
>   static int hpsa_interrupt_mode(struct ctlr_info *h)
>   {
> -     unsigned int flags = PCI_IRQ_LEGACY;
> +     unsigned int flags;
>       int ret;
>
>       /* Some boards advertise MSI but don't really support it */ @@ 
> -7400,17 +7404,20 @@ static int hpsa_interrupt_mode(struct ctlr_info *h)
>       case 0x40830E11:
>               break;
>       default:
> +             flags = PCI_IRQ_MSIX;
> +             if (!hpsa_disable_irq_affinity)
> +                     flags |= PCI_IRQ_AFFINITY;
>               ret = pci_alloc_irq_vectors(h->pdev, 1, MAX_REPLY_QUEUES,
> -                             PCI_IRQ_MSIX | PCI_IRQ_AFFINITY);
> +                             flags);
>               if (ret > 0) {
>                       h->msix_vectors = ret;
>                       return 0;
>               }
>
> -             flags |= PCI_IRQ_MSI;
>               break;
>       }
>
> +     flags = PCI_IRQ_LEGACY | PCI_IRQ_MSI;
>       ret = pci_alloc_irq_vectors(h->pdev, 1, 1, flags);
>       if (ret < 0)
>               return ret;
>
That completely breaks multiqueue.
You sure about this?
What is the intention here?

Cheers,

Hannes

This patch is a result of some customers complaining that they cannot
alter the smp_affinity* entries for hpsa because the vectors are managed.

The message is: write error: Input/output error

I added the module parameter to allow them to turn off the affinity flag
so they can set the mask to whatever they want, but leaves the default
behavior in-place.

Is there a better method?

--
Dr. Hannes Reinecke                Teamlead Storage & Networking
h...@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)

Reply via email to