[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201112050919.39280.jackm@dev.mellanox.co.il>
Date: Mon, 5 Dec 2011 09:19:38 +0200
From: Jack Morgenstein <jackm@....mellanox.co.il>
To: Or Gerlitz <ogerlitz@...lanox.com>
Cc: Roland Dreier <roland@...estorage.com>,
Yevgeny Petrilin <yevgenyp@...lanox.co.il>,
davem@...emloft.net, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, liranl@...lanox.co.il
Subject: Re: [PATCH net-next V0 19/21] mlx4_core: Modify driver initialization flow to accommodate SRIOV for Ethernet
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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists