summaryrefslogtreecommitdiff
path: root/lib/librte_ip_frag
diff options
context:
space:
mode:
authorJia Yu <jyu@vmware.com>2014-11-07 09:28:09 -0800
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-12-11 01:42:02 +0100
commit3a52e64742c370bebc465b91f3197d940d5738cd (patch)
treeaddfa35c616455e8b49c3b53404aab9c64c5b3e3 /lib/librte_ip_frag
parentff41b5785a1a6ff195852eae14659f95723bd399 (diff)
downloaddpdk-3a52e64742c370bebc465b91f3197d940d5738cd.zip
dpdk-3a52e64742c370bebc465b91f3197d940d5738cd.tar.gz
dpdk-3a52e64742c370bebc465b91f3197d940d5738cd.tar.xz
lib: fix cache alignment of structures
Include rte_memory.h for lib files that use __rte_cache_aligned attribute. Consider the following code: struct per_core_foo { ... } __rte_cache_aligned; struct global_foo { struct per_core_foo foo[RTE_MAX_CORE]; }; If __rte_cache_aligned is not defined (rte_memory.h is not included), the code compiles but the structure is not aligned... it defines the structure and creates a global variable called __rte_cache_aligned. And this can lead to really bad things if this code is in a .h that is included by files that may or may not include rte_memory.h Signed-off-by: Jia Yu <jyu@vmware.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Diffstat (limited to 'lib/librte_ip_frag')
-rw-r--r--lib/librte_ip_frag/rte_ip_frag.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/librte_ip_frag/rte_ip_frag.h b/lib/librte_ip_frag/rte_ip_frag.h
index 230a903..3989a5a 100644
--- a/lib/librte_ip_frag/rte_ip_frag.h
+++ b/lib/librte_ip_frag/rte_ip_frag.h
@@ -46,6 +46,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
+#include <rte_memory.h>
#include <rte_ip.h>
#include <rte_byteorder.h>