[2/4] eal: set byteorder in Windows to little endian
Checks
Commit Message
From: Tal Shnaiderman <talshn@mellanox.com>
Set the endianness in Windows to RTE_LITTLE_ENDIAN as support
for Windows is limited to x86 architecture for now.
Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
---
lib/librte_eal/include/generic/rte_byteorder.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
01/06/2020 11:38, talshn@mellanox.com:
> From: Tal Shnaiderman <talshn@mellanox.com>
>
> Set the endianness in Windows to RTE_LITTLE_ENDIAN as support
> for Windows is limited to x86 architecture for now.
>
> Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
> ---
> --- a/lib/librte_eal/include/generic/rte_byteorder.h
> +++ b/lib/librte_eal/include/generic/rte_byteorder.h
> #ifdef RTE_EXEC_ENV_FREEBSD
> #include <sys/endian.h>
> -#else
> +#elif defined RTE_EXEC_ENV_LINUX
> #include <endian.h>
> +#elif defined RTE_EXEC_ENV_WINDOWS && !defined RTE_BYTE_ORDER
Why "&& !defined RTE_BYTE_ORDER" ?
How can it be defined earlier?
> +#define RTE_BYTE_ORDER RTE_LITTLE_ENDIAN
> #endif
> Subject: Re: [dpdk-dev] [PATCH 2/4] eal: set byteorder in Windows to little
> endian
>
> 01/06/2020 11:38, talshn@mellanox.com:
> > From: Tal Shnaiderman <talshn@mellanox.com>
> >
> > Set the endianness in Windows to RTE_LITTLE_ENDIAN as support for
> > Windows is limited to x86 architecture for now.
> >
> > Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
> > ---
> > --- a/lib/librte_eal/include/generic/rte_byteorder.h
> > +++ b/lib/librte_eal/include/generic/rte_byteorder.h
> > #ifdef RTE_EXEC_ENV_FREEBSD
> > #include <sys/endian.h>
> > -#else
> > +#elif defined RTE_EXEC_ENV_LINUX
> > #include <endian.h>
> > +#elif defined RTE_EXEC_ENV_WINDOWS && !defined RTE_BYTE_ORDER
>
> Why "&& !defined RTE_BYTE_ORDER" ?
> How can it be defined earlier?
>
You're right, it's unneeded since it is defined later on.
The entire "#elif defined RTE_EXEC_ENV_WINDOWS" section could be removed actually,
looks like both clang and MinGW contain the predefined __BYTE_ORDER__ macro and detect the right endianness on compile time.
> > +#define RTE_BYTE_ORDER RTE_LITTLE_ENDIAN
> > #endif
>
>
>
@@ -17,8 +17,10 @@
#include <stdint.h>
#ifdef RTE_EXEC_ENV_FREEBSD
#include <sys/endian.h>
-#else
+#elif defined RTE_EXEC_ENV_LINUX
#include <endian.h>
+#elif defined RTE_EXEC_ENV_WINDOWS && !defined RTE_BYTE_ORDER
+#define RTE_BYTE_ORDER RTE_LITTLE_ENDIAN
#endif
#include <rte_common.h>