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);\
}

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


-- 
David Marchand

Reply via email to