eal: detect endianness
authorThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 3 Dec 2014 20:01:19 +0000 (21:01 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 5 Dec 2014 15:55:00 +0000 (16:55 +0100)
commit72c605807ae855ac64b64a388fe81005336db7c1
tree1f1814ad592192842c60da907183a28993dbe2e1
parentaaa662e75c23c61a1d79bd4d1f9f35b4967c39db
eal: detect endianness

There is no standard to check endianness.
So we need to try different checks.
Previous trials were done in testpmd (see commits
51f694dd40f56 and 64741f237cf29) without full success.
This one is not guaranteed to work everywhere so it could
evolve when exceptions are found.

If endianness is not detected, there is a fallback on x86
to little endian. It could be forced before doing detection
but it would add some arch-dependent code in the generic header.

The option CONFIG_RTE_ARCH_BIG_ENDIAN introduced for IBM Power only
(commit a982ec81d84d53) can be removed. A compile-time check is better.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
config/defconfig_ppc_64-power8-linuxapp-gcc
lib/librte_eal/common/include/arch/ppc_64/rte_byteorder.h
lib/librte_eal/common/include/arch/x86/rte_byteorder.h
lib/librte_eal/common/include/generic/rte_byteorder.h