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

Jan Viktorin viktorin at rehivetech.com
Wed Feb 10 11:20:28 CET 2016


On Wed, 10 Feb 2016 10:27:14 +0100
David Marchand <david.marchand at 6wind.com> wrote:

> On Wed, Feb 10, 2016 at 9:51 AM, David Marchand
> <david.marchand at 6wind.com> wrote:
> > On Tue, Feb 9, 2016 at 6:05 PM, Jan Viktorin <viktorin at rehivetech.com> wrote:  
> >> What about introducing a macro for this?
> >>
> >> RTE_REGISTER_PCI_DRIVER(rte_qad_pmd);  
> >
> > Yes.  
> 
> The only problem here, is that rte_qad_pmd is a crypto structure (same
> problem with ethdev), so I can't just pass it to eal.
> I can't just pass the pci driver, for the cases where multiple drivers
> are registered in a single file (look at ixgbe driver).
> 
> So, how about :
> 
> In rte_pci.h :
> 
> #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...

> }
> 
> Then, in qat driver :
> RTE_EAL_PCI_REGISTER(qat, &rte_qat_pmd.pci_drv);
> 

However, I think that this is a detail. Passing rte_pci_driver is good.

Regards
Jan

-- 
   Jan Viktorin                  E-mail: Viktorin at RehiveTech.com
   System Architect              Web:    www.RehiveTech.com
   RehiveTech
   Brno, Czech Republic


More information about the dev mailing list