[dpdk-dev] [PATCH 3/9] drivers: no more pdev drivers

David Marchand david.marchand at 6wind.com
Wed Feb 10 12:38:20 CET 2016


On Wed, Feb 10, 2016 at 11:20 AM, Jan Viktorin <viktorin at rehivetech.com> wrote:
> On Wed, 10 Feb 2016 10:27:14 +0100
> David Marchand <david.marchand at 6wind.com> wrote:
>> #define RTE_EAL_PCI_REGISTER(name, d)\
>> void pciinitfn_ ##name(void);\
>> void __attribute__((constructor, used)) pciinitfn_ ##name(void)\
>> {\
>>         rte_eal_pci_register(d);\
>
> I meant
>         rte_eal_pci_register(&(d)->pci_drv);\
>
> Perhaps, my assumption that a PCI driver is always referred as pci_drv is wrong...

Well, I suppose we will always have a pci driver embedded in some
other internal pmd structure.
So we can always expect it to be called pci_drv ...

Btw, for drivers like mlx or virtio that need to do some more stuff in
their constructor (the iopl stuff for virtio is the most interesting
case, since the pci register happens only if iopl succeeded), we might
need some RTE_MODULE_INIT for those.

But in such a case, I think having RTE_MODULE_INIT in all pmds would
make more sense, and RTE_EAL_PCI_REGISTER looks unneeded ?

-- 
David Marchand


More information about the dev mailing list