[dpdk-dev] [PATCH v2] examples/l3fwd: fix unaligned memory access

Jerin Jacob Kollanukkaran jerinj at marvell.com
Thu Jul 25 19:14:44 CEST 2019


> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Bruce Richardson
> Sent: Thursday, July 25, 2019 10:16 PM
> To: hgovindh <hariprasad.govindharajan at intel.com>
> Cc: Remy Horton <remy.horton at intel.com>; Marko Kovacevic
> <marko.kovacevic at intel.com>; Ori Kam <orika at mellanox.com>; Pablo de
> Lara <pablo.de.lara.guarch at intel.com>; Radu Nicolau
> <radu.nicolau at intel.com>; Akhil Goyal <akhil.goyal at nxp.com>; Tomasz
> Kantecki <tomasz.kantecki at intel.com>; dev at dpdk.org;
> maciej.czekaj at caviumnetworks.com; stable at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] examples/l3fwd: fix unaligned memory
> access
> 
> On Thu, Jul 25, 2019 at 05:29:03PM +0100, hgovindh wrote:
> > Fix unaligned memory access when reading IPv6 header which leads to
> > segmentation fault by changing aligned memory read to unaligned memory
> > read.
> >
> > Bugzilla ID: 279
> > Fixes: 64d3955de1de ("examples/l3fwd: fix ARM build")
> > Cc: maciej.czekaj at caviumnetworks.com
> > Cc: stable at dpdk.org
> > Signed-off-by: hgovindh <hariprasad.govindharajan at intel.com>
> > ---
> > V2: Added functions which will do unaligned load based on the
> > underlying architecture
> > ---
> > ---
> >  examples/l3fwd/l3fwd_em.c | 26 ++++++++++++++++++++++++--
> >  1 file changed, 24 insertions(+), 2 deletions(-)
> >
> > diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
> > index fa8f82be6..f2641586b 100644
> > --- a/examples/l3fwd/l3fwd_em.c
> > +++ b/examples/l3fwd/l3fwd_em.c
> > @@ -244,6 +244,29 @@ em_mask_key(void *key, xmm_t mask)  #error No
> > vector engine (SSE, NEON, ALTIVEC) available, check your toolchain
> > #endif
> >
> > +#if defined(RTE_MACHINE_CPUFLAG_SSE2) static inline xmm_t
> > +em_load_key(void *key) {
> > +	return _mm_loadu_si128((__m128i *)(key)); } #elif
> > +defined(RTE_MACHINE_CPUFLAG_NEON)
> > +static inline xmm_t
> > +em_load_key(void *key)
> > +{
> > +	return vld1q_s32((int32_t *)key);
> > +}
> > +#elif defined(RTE_MACHINE_CPUFLAG_ALTIVEC)
> > +static inline xmm_t
> > +em_load_key(void *key)
> > +{
> > +	return vec_ld(0, (xmm_t *)(key));
> > +}

Added power pc maintainer

Not sure all architecture need SIMD instructions for access to unaligned memory location.

@hgovindh,
Could you provide exact setup details for reproducing this issue, I can test it on arm64.
Like l3fwd command, Traffic generator traffic pattern




More information about the dev mailing list