On Tue, 2009-03-17 at 08:54 -0400, Matthew Wilcox wrote: > I didn't find the previous version very useful, so I rewrote it. > > Signed-off-by: Matthew Wilcox <willy@xxxxxxxxxxxxxxx> > Reviewed-by: Randy Dunlap <randy.dunlap@xxxxxxxxxx> > Reviewed-by: Grant Grundler <grundler@xxxxxxxxxxxxxxxxx> Sorry I didn't comment on this previously, but it occured to me the other day .. > --- > Documentation/PCI/MSI-HOWTO.txt | 758 ++++++++++++++------------------------- > 1 files changed, 277 insertions(+), 481 deletions(-) > > diff --git a/Documentation/PCI/MSI-HOWTO.txt b/Documentation/PCI/MSI-HOWTO.txt > index 256defd..1c02431 100644 > --- a/Documentation/PCI/MSI-HOWTO.txt > +++ b/Documentation/PCI/MSI-HOWTO.txt <snip> > +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. cheers -- Michael Ellerman OzLabs, IBM Australia Development Lab wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person
Attachment:
signature.asc
Description: This is a digitally signed message part