summaryrefslogtreecommitdiff
path: root/lib/librte_acl
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2015-06-08 11:41:24 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-06-18 17:59:18 +0200
commit12c4e86969f92b2de5aade476261edcf3acaf693 (patch)
tree95265234af722c0c908ec0d7f4ad545f98d21839 /lib/librte_acl
parentfaea1ce70c77ee5ec95fe7c2fb79265fd5b3dcb1 (diff)
downloaddpdk-12c4e86969f92b2de5aade476261edcf3acaf693.zip
dpdk-12c4e86969f92b2de5aade476261edcf3acaf693.tar.gz
dpdk-12c4e86969f92b2de5aade476261edcf3acaf693.tar.xz
acl: remove redundant macro
Use global RTE_LEN2MASK macro, instead of local LEN2MASK. Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'lib/librte_acl')
-rw-r--r--lib/librte_acl/acl_bld.c3
-rw-r--r--lib/librte_acl/rte_acl.c3
-rw-r--r--lib/librte_acl/rte_acl.h2
-rw-r--r--lib/librte_acl/rte_acl_osdep.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c
index aee6ed5..ff3ba8b 100644
--- a/lib/librte_acl/acl_bld.c
+++ b/lib/librte_acl/acl_bld.c
@@ -1772,7 +1772,8 @@ acl_bld(struct acl_build_context *bcx, struct rte_acl_ctx *ctx,
bcx->pool.alignment = ACL_POOL_ALIGN;
bcx->pool.min_alloc = ACL_POOL_ALLOC_MIN;
bcx->cfg = *cfg;
- bcx->category_mask = LEN2MASK(bcx->cfg.num_categories);
+ bcx->category_mask = RTE_LEN2MASK(bcx->cfg.num_categories,
+ typeof(bcx->category_mask));
bcx->node_max = node_max;
rc = sigsetjmp(bcx->pool.fail, 0);
diff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c
index b6ddeeb..a54d531 100644
--- a/lib/librte_acl/rte_acl.c
+++ b/lib/librte_acl/rte_acl.c
@@ -271,7 +271,8 @@ acl_add_rules(struct rte_acl_ctx *ctx, const void *rules, uint32_t num)
static int
acl_check_rule(const struct rte_acl_rule_data *rd)
{
- if ((rd->category_mask & LEN2MASK(RTE_ACL_MAX_CATEGORIES)) == 0 ||
+ if ((RTE_LEN2MASK(RTE_ACL_MAX_CATEGORIES, typeof(rd->category_mask)) &
+ rd->category_mask) == 0 ||
rd->priority > RTE_ACL_MAX_PRIORITY ||
rd->priority < RTE_ACL_MIN_PRIORITY ||
rd->userdata == RTE_ACL_INVALID_USERDATA)
diff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h
index 3a93730..8d9bbe5 100644
--- a/lib/librte_acl/rte_acl.h
+++ b/lib/librte_acl/rte_acl.h
@@ -115,7 +115,7 @@ struct rte_acl_field {
enum {
RTE_ACL_TYPE_SHIFT = 29,
- RTE_ACL_MAX_INDEX = LEN2MASK(RTE_ACL_TYPE_SHIFT),
+ RTE_ACL_MAX_INDEX = RTE_LEN2MASK(RTE_ACL_TYPE_SHIFT, uint32_t),
RTE_ACL_MAX_PRIORITY = RTE_ACL_MAX_INDEX,
RTE_ACL_MIN_PRIORITY = 0,
};
diff --git a/lib/librte_acl/rte_acl_osdep.h b/lib/librte_acl/rte_acl_osdep.h
index 81fdefb..41f7e3d 100644
--- a/lib/librte_acl/rte_acl_osdep.h
+++ b/lib/librte_acl/rte_acl_osdep.h
@@ -56,8 +56,6 @@
* Common defines.
*/
-#define LEN2MASK(ln) ((uint32_t)(((uint64_t)1 << (ln)) - 1))
-
#define DIM(x) RTE_DIM(x)
#include <rte_common.h>