examples/l3fwd: fix crash with unaligned L2 header
authorHarish Patil <harish.patil@qlogic.com>
Sun, 8 Nov 2015 19:39:56 +0000 (11:39 -0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 7 Dec 2015 02:21:13 +0000 (03:21 +0100)
commit74ac982875fc787191ba3434429cf80c54edbf68
tree540ca8205fbab8739a9e090284acf782e9ccd44d
parent3edf8754d8d46394da06de6bc678bd3125b5a3c1
examples/l3fwd: fix crash with unaligned L2 header

l3fwd app expects PMDs to return packets whose L2 header is
16-byte aligned due to usage of _mm_load_si128()/_mm_store_si128()
intrinsics in the app. However, most of the protocol stacks expects
packets such that its IP/L3 header be aligned on a 16-byte boundary.

Based on the recommendations received on dpdk-dev, we are changing
the l3fwd app to use _mm_loadu_si128()/_mm_loadu_si128() so that the
address need not be 16-byte aligned and thereby preventing crash.
We have tested that there is no performance impact due to this
change.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
examples/l3fwd/main.c