Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Logan Gunthorpe and committed by
Jon Mason
fcdf8e95 d7cc609f

+10 -2
+10 -2
drivers/pci/switch/switchtec.c
··· 30 30 MODULE_PARM_DESC(use_dma_mrpc, 31 31 "Enable the use of the DMA MRPC feature"); 32 32 33 + static int nirqs = 32; 34 + module_param(nirqs, int, 0644); 35 + MODULE_PARM_DESC(nirqs, "number of interrupts to allocate (more may be useful for NTB applications)"); 36 + 33 37 static dev_t switchtec_devt; 34 38 static DEFINE_IDA(switchtec_minor_ida); 35 39 ··· 1267 1263 int dma_mrpc_irq; 1268 1264 int rc; 1269 1265 1270 - nvecs = pci_alloc_irq_vectors(stdev->pdev, 1, 4, 1271 - PCI_IRQ_MSIX | PCI_IRQ_MSI); 1266 + if (nirqs < 4) 1267 + nirqs = 4; 1268 + 1269 + nvecs = pci_alloc_irq_vectors(stdev->pdev, 1, nirqs, 1270 + PCI_IRQ_MSIX | PCI_IRQ_MSI | 1271 + PCI_IRQ_VIRTUAL); 1272 1272 if (nvecs < 0) 1273 1273 return nvecs; 1274 1274