acl: remove redundant macro
[dpdk.git] / lib / librte_acl / acl_bld.c
index 3801843..ff3ba8b 100644 (file)
@@ -1362,6 +1362,9 @@ acl_calc_wildness(struct rte_acl_build_rule *head,
                for (n = 0; n < config->num_fields; n++) {
 
                        double wild = 0;
+                       uint64_t msk_val =
+                               RTE_LEN2MASK(CHAR_BIT * config->defs[n].size,
+                               typeof(msk_val));
                        double size = CHAR_BIT * config->defs[n].size;
                        int field_index = config->defs[n].field_index;
                        const struct rte_acl_field *fld = rule->f->field +
@@ -1369,8 +1372,8 @@ acl_calc_wildness(struct rte_acl_build_rule *head,
 
                        switch (rule->config->defs[n].type) {
                        case RTE_ACL_FIELD_TYPE_BITMASK:
-                               wild = (size - __builtin_popcount(
-                                       fld->mask_range.u8)) /
+                               wild = (size - __builtin_popcountll(
+                                       fld->mask_range.u64 & msk_val)) /
                                        size;
                                break;
 
@@ -1769,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);