Re: [RFC][PATCH] Add sysfs entry that displays MSI-X IRQs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2008-10-31 at 14:48 +1100, Vincent Rizza wrote:
> Michael raised the issue of dev->stop() calling pci_disable_msi()
> on ifconfig down. The rtnl_lock eliminates that problem.

I did, but that's only one example of something that can call
pci_disable_msi(). It needs to be robust against anything that might
call it, eg. a hotplug disk controller or something.

So I think using list_for_each_entry_safe() is the right option, using
rtnl_lock() definitely isn't.

cheers

> @@ -45,6 +47,27 @@ pci_config_attr(subsystem_device, "0x%04x\n");
>  pci_config_attr(class, "0x%06x\n");
>  pci_config_attr(irq, "%u\n");
>  
> +#ifdef CONFIG_PCI_MSI
> +static ssize_t msix_show(struct device *dev,
> +			 struct device_attribute *attr, char *buf)
> +{
> +	struct pci_dev *pdev = to_pci_dev(dev);
> +	struct msi_desc *entry;
> +	u32 total = 0;
> +
> +	if (pdev->msix_enabled) {
> +		/* netdev interface lock in case someone does an ifdown */
> +		rtnl_lock();
> +		list_for_each_entry(entry, &pdev->msi_list, list) {
> +			total += sprintf(buf + total, "%u\n", entry->irq);
> +		}
> +		rtnl_unlock();
> +	}
> +
> +	return total;
> +}


-- 
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


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux