Thread (146 messages) 146 messages, 18 authors, 2013-10-15

Re: [PATCH RFC 00/77] Re-design MSI/MSI-X interrupts enablement pattern

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2013-10-09 03:57:51
Also in: linux-ide, linux-mips, linux-pci, linux-rdma, linux-s390, linux-scsi, lkml, netdev

On 10/02/2013 03:29 AM, Alexander Gordeev wrote:
As result, device drivers will cease to use the overcomplicated
repeated fallbacks technique and resort to a straightforward
pattern - determine the number of MSI/MSI-X interrupts required
before calling pci_enable_msi_block() and pci_enable_msix()
interfaces:


	rc = pci_msix_table_size(adapter->pdev);
	if (rc < 0)
		return rc;

	nvec = min(nvec, rc);
	if (nvec < FOO_DRIVER_MINIMUM_NVEC) {
		return -ENOSPC;

	for (i = 0; i < nvec; i++)
		adapter->msix_entries[i].entry = i;

	rc = pci_enable_msix(adapter->pdev,
			     adapter->msix_entries, nvec);
	return rc;
Why not add a minimum number to pci_enable_msix(), i.e.:

pci_enable_msix(pdev, msix_entries, nvec, minvec)

... which means "nvec" is the number of interrupts *requested*, and
"minvec" is the minimum acceptable number (otherwise fail).

	-hpa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help