On Wed, Apr 20, 2016 at 3:29 PM, Neil Horman <nhorman at tuxdriver.com> wrote: >> +#ifndef RTE_PCI_DEV_ID_DECL_EM >> +#define RTE_PCI_DEV_ID_DECL_EM(vend, dev) >> +#endif >> + >> +#ifndef PCI_VENDOR_ID_INTEL >> +/** Vendor ID used by Intel devices */ >> +#define PCI_VENDOR_ID_INTEL 0x8086 >> +#endif >> + > This is broken, PCI_VENDOR_ID_INTEL should be defined in a central location > for > all pci drivers, not redefined in every compilation unit. And you can likely
Well we can keep the vendors in a common header, but I don't see the benefit. > just remvoe the RTE_PCI_DEV_ID_DECL_* macros from each patch and use the > RTE_PCI_DEV macro, as all the DECL macros just evaluate to that anyway. app/test/test_pci.c:#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, lib/librte_eal/linuxapp/kni/kni_misc.c: #define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev): All this stuff is because of pci tests and kni code. >><snip> > >> + >> +#undef RTE_PCI_DEV_ID_DECL_EM > Why are you undefining this here? Is it because its in a header file and > you're > concerned about multiple inclusion? You should use an ifdef guard instead, or > just define all the device id's in the header and ennumerate the pci table in > one of the C files for the driver. That should apply to all the patches in > this > series I think Just moved the code. -- David Marchand