summaryrefslogtreecommitdiff
path: root/examples/l3fwd
diff options
context:
space:
mode:
authorHariprasad Govindharajan <hariprasad.govindharajan@intel.com>2019-07-30 14:26:38 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-07-30 22:05:00 +0200
commitd7f936190e8d8ad3f2c447c3e59d754501c44884 (patch)
treeef74b4961e2e7e897fa3954810b9bc88307328eb /examples/l3fwd
parent1868b17b570298e6fca900f047b9b8c3e7cf7373 (diff)
downloaddpdk-d7f936190e8d8ad3f2c447c3e59d754501c44884.zip
dpdk-d7f936190e8d8ad3f2c447c3e59d754501c44884.tar.gz
dpdk-d7f936190e8d8ad3f2c447c3e59d754501c44884.tar.xz
examples/l3fwd: fix unaligned memory access on x86
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: stable@dpdk.org 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>
Diffstat (limited to 'examples/l3fwd')
-rw-r--r--examples/l3fwd/l3fwd_em.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index 5f499e0..74a7c8f 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -287,7 +287,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