PCI/switchtec: Add module parameter to request more interrupts
Seeing the we want to use more interrupts in the NTB MSI code we need to be able allocate more (sometimes virtual) interrupts in the switchtec driver. Therefore add a module parameter to request to allocate additional interrupts. This puts virtually no limit on the number of MSI interrupts available to NTB clients. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
This commit is contained in:
committed by
Jon Mason
parent
d7cc609fb6
commit
fcdf8e95fa
@@ -30,6 +30,10 @@ module_param(use_dma_mrpc, bool, 0644);
|
|||||||
MODULE_PARM_DESC(use_dma_mrpc,
|
MODULE_PARM_DESC(use_dma_mrpc,
|
||||||
"Enable the use of the DMA MRPC feature");
|
"Enable the use of the DMA MRPC feature");
|
||||||
|
|
||||||
|
static int nirqs = 32;
|
||||||
|
module_param(nirqs, int, 0644);
|
||||||
|
MODULE_PARM_DESC(nirqs, "number of interrupts to allocate (more may be useful for NTB applications)");
|
||||||
|
|
||||||
static dev_t switchtec_devt;
|
static dev_t switchtec_devt;
|
||||||
static DEFINE_IDA(switchtec_minor_ida);
|
static DEFINE_IDA(switchtec_minor_ida);
|
||||||
|
|
||||||
@@ -1263,8 +1267,12 @@ static int switchtec_init_isr(struct switchtec_dev *stdev)
|
|||||||
int dma_mrpc_irq;
|
int dma_mrpc_irq;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
nvecs = pci_alloc_irq_vectors(stdev->pdev, 1, 4,
|
if (nirqs < 4)
|
||||||
PCI_IRQ_MSIX | PCI_IRQ_MSI);
|
nirqs = 4;
|
||||||
|
|
||||||
|
nvecs = pci_alloc_irq_vectors(stdev->pdev, 1, nirqs,
|
||||||
|
PCI_IRQ_MSIX | PCI_IRQ_MSI |
|
||||||
|
PCI_IRQ_VIRTUAL);
|
||||||
if (nvecs < 0)
|
if (nvecs < 0)
|
||||||
return nvecs;
|
return nvecs;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user