MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_acl_build

Function rte_acl_build

dpdk/lib/acl/acl_bld.c:1621–1673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1619}
1620
1621int
1622rte_acl_build(struct rte_acl_ctx *ctx, const struct rte_acl_config *cfg)
1623{
1624 int32_t rc;
1625 uint32_t n;
1626 size_t max_size;
1627 struct acl_build_context bcx;
1628
1629 rc = acl_check_bld_param(ctx, cfg);
1630 if (rc != 0)
1631 return rc;
1632
1633 acl_build_reset(ctx);
1634
1635 if (cfg->max_size == 0) {
1636 n = NODE_MIN;
1637 max_size = SIZE_MAX;
1638 } else {
1639 n = NODE_MAX;
1640 max_size = cfg->max_size;
1641 }
1642
1643 for (rc = -ERANGE; n >= NODE_MIN && rc == -ERANGE; n /= 2) {
1644
1645 /* perform build phase. */
1646 rc = acl_bld(&bcx, ctx, cfg, n);
1647
1648 if (rc == 0) {
1649 /* allocate and fill run-time structures. */
1650 rc = rte_acl_gen(ctx, bcx.tries, bcx.bld_tries,
1651 bcx.num_tries, bcx.cfg.num_categories,
1652 ACL_MAX_INDEXES * RTE_DIM(bcx.tries) *
1653 sizeof(ctx->data_indexes[0]), max_size);
1654 if (rc == 0) {
1655 /* set data indexes. */
1656 acl_set_data_indexes(ctx);
1657
1658 /* determine can we always do 4B load */
1659 ctx->first_load_sz = get_first_load_size(cfg);
1660
1661 /* copy in build config. */
1662 ctx->config = *cfg;
1663 }
1664 }
1665
1666 acl_build_log(&bcx);
1667
1668 /* cleanup after build. */
1669 tb_free_pool(&bcx.pool);
1670 }
1671
1672 return rc;
1673}

Callers 9

acl_table_createFunction · 0.85
rte_table_acl_buildFunction · 0.85
rte_acl_resetFunction · 0.85
rte_acl_ipv4vlan_buildFunction · 0.85
build_convert_rulesFunction · 0.85
acx_initFunction · 0.85
app_acl_initFunction · 0.85
acl6_initFunction · 0.85
acl4_initFunction · 0.85

Calls 8

acl_check_bld_paramFunction · 0.85
acl_build_resetFunction · 0.85
acl_bldFunction · 0.85
rte_acl_genFunction · 0.85
acl_set_data_indexesFunction · 0.85
get_first_load_sizeFunction · 0.85
acl_build_logFunction · 0.85
tb_free_poolFunction · 0.85

Tested by 2

rte_acl_ipv4vlan_buildFunction · 0.68
build_convert_rulesFunction · 0.68