summaryrefslogtreecommitdiff
path: root/lib/librte_acl
diff options
context:
space:
mode:
authorSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>2014-11-19 12:26:06 +0000
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-11-27 16:21:11 +0100
commitfdf20fa7bee9df9037116318a87080e1eb7e757e (patch)
tree555c742ef267d7d6b1b60aeaad00f9f1407a62f2 /lib/librte_acl
parentbe04c7072745e0471fc185c31c2a2df835ee4e06 (diff)
downloaddpdk-fdf20fa7bee9df9037116318a87080e1eb7e757e.zip
dpdk-fdf20fa7bee9df9037116318a87080e1eb7e757e.tar.gz
dpdk-fdf20fa7bee9df9037116318a87080e1eb7e757e.tar.xz
add prefix to cache line macros
CACHE_LINE_SIZE is a macro defined in machine/param.h in FreeBSD and conflicts with DPDK macro version. Adding RTE_ prefix to avoid conflicts. CACHE_LINE_MASK and CACHE_LINE_ROUNDUP are also prefixed. Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com> [Thomas: updated on HEAD, including PPC]
Diffstat (limited to 'lib/librte_acl')
-rw-r--r--lib/librte_acl/acl_gen.c6
-rw-r--r--lib/librte_acl/rte_acl.c2
-rw-r--r--lib/librte_acl/rte_acl_osdep_alone.h6
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/librte_acl/acl_gen.c b/lib/librte_acl/acl_gen.c
index f65e397..b1f766b 100644
--- a/lib/librte_acl/acl_gen.c
+++ b/lib/librte_acl/acl_gen.c
@@ -415,12 +415,12 @@ rte_acl_gen(struct rte_acl_ctx *ctx, struct rte_acl_trie *trie,
node_bld_trie, num_tries, match_num);
/* Allocate runtime memory (align to cache boundary) */
- total_size = RTE_ALIGN(data_index_sz, CACHE_LINE_SIZE) +
+ total_size = RTE_ALIGN(data_index_sz, RTE_CACHE_LINE_SIZE) +
indices.match_index * sizeof(uint64_t) +
(match_num + 2) * sizeof(struct rte_acl_match_results) +
XMM_SIZE;
- mem = rte_zmalloc_socket(ctx->name, total_size, CACHE_LINE_SIZE,
+ mem = rte_zmalloc_socket(ctx->name, total_size, RTE_CACHE_LINE_SIZE,
ctx->socket_id);
if (mem == NULL) {
RTE_LOG(ERR, ACL,
@@ -432,7 +432,7 @@ rte_acl_gen(struct rte_acl_ctx *ctx, struct rte_acl_trie *trie,
/* Fill the runtime structure */
match_index = indices.match_index;
node_array = (uint64_t *)((uintptr_t)mem +
- RTE_ALIGN(data_index_sz, CACHE_LINE_SIZE));
+ RTE_ALIGN(data_index_sz, RTE_CACHE_LINE_SIZE));
/*
* Setup the NOMATCH node (a SINGLE at the
diff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c
index 4b21b8e..547e6da 100644
--- a/lib/librte_acl/rte_acl.c
+++ b/lib/librte_acl/rte_acl.c
@@ -203,7 +203,7 @@ rte_acl_create(const struct rte_acl_param *param)
goto exit;
}
- ctx = rte_zmalloc_socket(name, sz, CACHE_LINE_SIZE, param->socket_id);
+ ctx = rte_zmalloc_socket(name, sz, RTE_CACHE_LINE_SIZE, param->socket_id);
if (ctx == NULL) {
RTE_LOG(ERR, ACL,
diff --git a/lib/librte_acl/rte_acl_osdep_alone.h b/lib/librte_acl/rte_acl_osdep_alone.h
index bdeba54..a84b6f9 100644
--- a/lib/librte_acl/rte_acl_osdep_alone.h
+++ b/lib/librte_acl/rte_acl_osdep_alone.h
@@ -180,13 +180,13 @@ rte_rdtsc(void)
* rte_memory related.
*/
#define SOCKET_ID_ANY -1 /**< Any NUMA socket. */
-#define CACHE_LINE_SIZE 64 /**< Cache line size. */
-#define CACHE_LINE_MASK (CACHE_LINE_SIZE-1) /**< Cache line mask. */
+#define RTE_CACHE_LINE_SIZE 64 /**< Cache line size. */
+#define RTE_CACHE_LINE_MASK (RTE_CACHE_LINE_SIZE-1) /**< Cache line mask. */
/**
* Force alignment to cache line.
*/
-#define __rte_cache_aligned __attribute__((__aligned__(CACHE_LINE_SIZE)))
+#define __rte_cache_aligned __attribute__((__aligned__(RTE_CACHE_LINE_SIZE)))
/*