On Sunday 04 December 2011 17:39, Or Gerlitz wrote:
> On 12/4/2011 4:29 PM, Jack Morgenstein wrote:
> > 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html