* Function that expands a rule across the data structure when a less-generic * one has been added before. It assures that every possible combination of bits * in the IP address returns a match. */
| 519 | * in the IP address returns a match. |
| 520 | */ |
| 521 | static void |
| 522 | expand_rule(struct rte_lpm6 *lpm, uint32_t tbl8_gindex, uint8_t old_depth, |
| 523 | uint8_t new_depth, uint32_t next_hop, uint8_t valid) |
| 524 | { |
| 525 | uint32_t tbl8_group_end, tbl8_gindex_next, j; |
| 526 | |
| 527 | tbl8_group_end = tbl8_gindex + RTE_LPM6_TBL8_GROUP_NUM_ENTRIES; |
| 528 | |
| 529 | struct rte_lpm6_tbl_entry new_tbl8_entry = { |
| 530 | .valid = valid, |
| 531 | .valid_group = valid, |
| 532 | .depth = new_depth, |
| 533 | .next_hop = next_hop, |
| 534 | .ext_entry = 0, |
| 535 | }; |
| 536 | |
| 537 | for (j = tbl8_gindex; j < tbl8_group_end; j++) { |
| 538 | if (!lpm->tbl8[j].valid || (lpm->tbl8[j].ext_entry == 0 |
| 539 | && lpm->tbl8[j].depth <= old_depth)) { |
| 540 | |
| 541 | lpm->tbl8[j] = new_tbl8_entry; |
| 542 | |
| 543 | } else if (lpm->tbl8[j].ext_entry == 1) { |
| 544 | |
| 545 | tbl8_gindex_next = lpm->tbl8[j].lpm6_tbl8_gindex |
| 546 | * RTE_LPM6_TBL8_GROUP_NUM_ENTRIES; |
| 547 | expand_rule(lpm, tbl8_gindex_next, old_depth, new_depth, |
| 548 | next_hop, valid); |
| 549 | } |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | /* |
| 554 | * Init a tbl8 header |
no outgoing calls
no test coverage detected