* Fill in gaps in ptrs list with the ptr at the end of the list */
| 478 | * Fill in gaps in ptrs list with the ptr at the end of the list |
| 479 | */ |
| 480 | static void |
| 481 | acl_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 | |
| 514 | static int |
| 515 | acl_resolve_leaf(struct acl_build_context *context, |
no test coverage detected