[dpdk-dev] [PATCH v2 05/10] eal: add and use unaligned integer types

Cyril Chemparathy cchemparathy at ezchip.com
Mon Jun 22 18:47:26 CEST 2015


On Mon, 22 Jun 2015 11:36:20 +0200
Thomas Monjalon <thomas.monjalon at 6wind.com> wrote:

> 2015-06-19 10:34, Cyril Chemparathy:
> > On machines that are strict on pointer alignment, current code
> > breaks on GCC's -Wcast-align checks on casts from narrower to wider
> > types. This patch introduces new unaligned_uint(16|32|64)_t types,
> > which correctly retain alignment in such cases.
> [...]
> > +#ifdef RTE_ARCH_STRICT_ALIGN
> > +typedef uint64_t unaligned_uint64_t __attribute__ ((aligned(1)));
> > +typedef uint32_t unaligned_uint32_t __attribute__ ((aligned(1)));
> > +typedef uint16_t unaligned_uint16_t __attribute__ ((aligned(1)));
> > +#else
> > +typedef uint64_t unaligned_uint64_t;
> > +typedef uint32_t unaligned_uint32_t;
> > +typedef uint16_t unaligned_uint16_t;
> > +#endif
> 
> CONFIG_RTE_ARCH_STRICT_ALIGN should be declared (and disabled) in
> config templates.

Sure.  Will include in v3.  I'm assuming this goes into
common_linuxapp and common_bsdapp, allowing specific architectures to
override if necessary.  Correct?


More information about the dev mailing list