On Wed, Mar 18, 2009 at 09:55:29AM +1100, Michael Ellerman wrote: > > +4.3.1 pci_enable_msix > > + > > +int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec) > > + > > +Calling this function asks the PCI subsystem to allocate 'nvec' MSIs. > > +The 'entries' argument is a pointer to an array of msix_entry structs > > +which should be at least 'nvec' entries in size. On success, the > > +function will return 0 and the device will have been switched into > > +MSI-X interrupt mode. The 'vector' elements in each entry will have > > +been filled in with the interrupt number. The driver should then call > > +request_irq() for each 'vector' that it decides to use. > > + > > +If this function returns a negative number, it indicates an error and > > +the driver should not attempt to allocate any more MSI-X interrupts for > > +this device. If it returns a positive number, it indicates the maximum > > +number of interrupt vectors that could have been allocated. > > .. that perhaps we should have an example here. eg: > > static int foo_driver_enable_msix(struct foo_adapter *adapter, int nvec) > { > while (nvec >= FOO_DRIVER_MINIMUM_NVEC) { > rc = pci_enable_msix(adapter->pdev, adapter->msix_entries, nvec); > if (rc > 0) > nvec = rc; > else > return rc; > } > > return -ENOSPC; > } > > > To at least plant the seed in driver writers' minds that they should try > and support a variable number of MSI-X. I think that's a great thing to add. It probably doesn't need to delay these patches going upstream, but if I need to respin the series, I'll add it. We can always add it later ... -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html