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

Function acl_compact_node_ptrs

dpdk/lib/acl/acl_bld.c:480–512  ·  view source on GitHub ↗

* Fill in gaps in ptrs list with the ptr at the end of the list */

Source from the content-addressed store, hash-verified

478 * Fill in gaps in ptrs list with the ptr at the end of the list
479 */
480static void
481acl_compact_node_ptrs(struct rte_acl_node *node_a)
482{
483 uint32_t n;
484 int min_add = node_a->min_add;
485
486 while (node_a->num_ptrs > 0 &&
487 node_a->ptrs[node_a->num_ptrs - 1].ptr == NULL)
488 node_a->num_ptrs--;
489
490 for (n = min_add; n + 1 < node_a->num_ptrs; n++) {
491
492 /* if this entry is empty */
493 if (node_a->ptrs[n].ptr == NULL) {
494
495 /* move the last pointer to this entry */
496 acl_include(&node_a->ptrs[n].values,
497 &node_a->ptrs[node_a->num_ptrs - 1].values,
498 0);
499 node_a->ptrs[n].ptr =
500 node_a->ptrs[node_a->num_ptrs - 1].ptr;
501
502 /*
503 * mark the end as empty and adjust the number
504 * of used pointer enum_tries
505 */
506 node_a->ptrs[node_a->num_ptrs - 1].ptr = NULL;
507 while (node_a->num_ptrs > 0 &&
508 node_a->ptrs[node_a->num_ptrs - 1].ptr == NULL)
509 node_a->num_ptrs--;
510 }
511 }
512}
513
514static int
515acl_resolve_leaf(struct acl_build_context *context,

Callers 1

acl_merge_trieFunction · 0.85

Calls 1

acl_includeFunction · 0.85

Tested by

no test coverage detected