On 05/27/2016 05:05 PM, Thomas Monjalon wrote: > 2016-05-27 17:12, Jerin Jacob: >> IMHO, I think we should have means to abstract this _logical_ changes >> under conditional compilation flags and any arch/platform can choose >> to select what it suites better for that arch/platform. >> >> We may NOT need to have frequent patches to select the specific >> configuration, but logical patches under compilation flags can be accepted >> and >> each arch/platform can choose specific set configuration when we make >> the final release candidate for the release. >> >> Any thoughts? > > Yes having some #ifdefs for arch configuration may be reasonnable. > But other methods must be preffered first: > 1/ try implementing the function in arch-specific files
I agree with Thomas. This option should be preferred, and I think we should avoid as much as possible to have: #if ARCH1 do stuff optimized for arch1 #elif ARCH2 do the same stuff optimized for arch2 #else ... In this particular case, rte_memcpy() seems to be the appropriate function, because it should already be arch-optimized. > 2/ and check at runtime if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_X > 3/ or check #ifdef RTE_MACHINE_CPUFLAG_X > 4/ or check #ifdef RTE_ARCH_Y > 5/ or check a specific #ifdef RTE_FEATURE_NAME to choose in config files > > The option 2 is a nice to have which implies other options. > > Maybe that doc/guides/contributing/design.rst needs to be updated. Regards, Olivier