Skip to content

Commit

Permalink
examples/l3fwd: fix unaligned memory access on x86
Browse files Browse the repository at this point in the history
[ upstream commit d7f9361 ]

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: 64d3955 ("examples/l3fwd: fix ARM build")

Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Tested-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
  • Loading branch information
hgovindh86 authored and kevintraynor committed Sep 4, 2019
1 parent 018688e commit 14340ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/l3fwd/l3fwd_em.c
Expand Up @@ -285,7 +285,11 @@ em_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct)
* Get part of 5 tuple: dst IP address lower 96 bits
* and src IP address higher 32 bits.
*/
#if defined RTE_ARCH_X86
key.xmm[1] = _mm_loadu_si128(data1);
#else
key.xmm[1] = *(xmm_t *)data1;
#endif

/*
* Get part of 5 tuple: dst port and src port
Expand Down

0 comments on commit 14340ce

Please sign in to comment.