Thread (1 message) 1 message, 1 author, 2011-12-05

Re: [PATCH net-next V0 19/21] mlx4_core: Modify driver initialization flow to accommodate SRIOV for Ethernet

From: Jack Morgenstein <hidden>
Date: 2011-12-05 07:19:38
Also in: linux-rdma

On Sunday 04 December 2011 17:39, Or Gerlitz wrote:
On 12/4/2011 4:29 PM, Jack Morgenstein wrote:
quoted
If the kernel is not configured to support IOV, pci_enable_sriov will 
fail.
Jack,

If CONFIG_PCI_IOV isn't set, pci_enable_sriov isn't there...

Or.
Not so.  I checked. If CONFIG_PCI_IOV isn't set, pci_enable_sriov returns -ENODEV
via a static inline function.
Look in kernel file include/linux/pci.h (for the most recent kernel):
 
#ifdef CONFIG_PCI_IOV
extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
extern void pci_disable_sriov(struct pci_dev *dev);
extern irqreturn_t pci_sriov_migration(struct pci_dev *dev);
extern int pci_num_vf(struct pci_dev *dev);
#else
static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
{
        return -ENODEV;
}
static inline void pci_disable_sriov(struct pci_dev *dev)
{
}
static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev)
{
        return IRQ_NONE;
}
static inline int pci_num_vf(struct pci_dev *dev)
{
        return 0;
}
#endif

- Jack
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help