On Tue, Feb 9, 2016 at 6:05 PM, Jan Viktorin <viktorin at rehivetech.com> wrote: > Maybe, a better subject? > > drivers: init pdev drivers in constructors
Why not, I will try to find a best one, and if I can't, I will go with this. > On Fri, 29 Jan 2016 15:08:30 +0100 > David Marchand <david.marchand at 6wind.com> wrote: >> -static int >> -rte_qat_pmd_init(const char *name __rte_unused, const char *params >> __rte_unused) >> +/* Driver registration */ >> +static void __attribute__((constructor, used)) >> +rte_qat_pmd_init(void) >> { >> PMD_INIT_FUNC_TRACE(); >> rte_eal_pci_register(&rte_qat_pmd.pci_drv); >> - return 0; >> } >> - >> -static struct rte_driver pmd_qat_drv = { >> - .type = PMD_PDEV, >> - .init = rte_qat_pmd_init, >> -}; >> - >> -PMD_REGISTER_DRIVER(pmd_qat_drv); > > What about introducing a macro for this? > > RTE_REGISTER_PCI_DRIVER(rte_qad_pmd); Yes. -- David Marchand