| 530 | } |
| 531 | |
| 532 | static inline int |
| 533 | insert_after(struct rte_thash_ctx *ctx, |
| 534 | struct rte_thash_subtuple_helper *ent, |
| 535 | struct rte_thash_subtuple_helper *cur_ent, |
| 536 | struct rte_thash_subtuple_helper *next_ent, |
| 537 | struct rte_thash_subtuple_helper *prev_ent, |
| 538 | uint32_t end, uint32_t range_end) |
| 539 | { |
| 540 | int ret; |
| 541 | |
| 542 | if ((next_ent != NULL) && (end > next_ent->offset)) { |
| 543 | RTE_LOG(ERR, HASH, |
| 544 | "Can't add helper %s due to conflict with existing" |
| 545 | " helper %s\n", ent->name, next_ent->name); |
| 546 | rte_free(ent); |
| 547 | return -EEXIST; |
| 548 | } |
| 549 | |
| 550 | attach_lfsr(ent, cur_ent->lfsr); |
| 551 | if (end > range_end) { |
| 552 | /** |
| 553 | * generate partially overlapping range |
| 554 | * (range_end, end) |
| 555 | */ |
| 556 | ret = generate_subkey(ctx, ent->lfsr, range_end, end - 1); |
| 557 | if (ret != 0) { |
| 558 | free_lfsr(ent->lfsr); |
| 559 | rte_free(ent); |
| 560 | return ret; |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | LIST_INSERT_AFTER(prev_ent, ent, next); |
| 565 | generate_complement_table(ctx, ent); |
| 566 | ctx->subtuples_nb++; |
| 567 | |
| 568 | return 0; |
| 569 | } |
| 570 | |
| 571 | int |
| 572 | rte_thash_add_helper(struct rte_thash_ctx *ctx, const char *name, uint32_t len, |
no test coverage detected