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

Function insert_after

dpdk/lib/hash/rte_thash.c:532–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

530}
531
532static inline int
533insert_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
571int
572rte_thash_add_helper(struct rte_thash_ctx *ctx, const char *name, uint32_t len,

Callers 1

rte_thash_add_helperFunction · 0.85

Calls 5

rte_freeFunction · 0.85
attach_lfsrFunction · 0.85
generate_subkeyFunction · 0.85
free_lfsrFunction · 0.85

Tested by

no test coverage detected