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

Function generate_complement_table

dpdk/lib/hash/rte_thash.c:450–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450static inline void
451generate_complement_table(struct rte_thash_ctx *ctx,
452 struct rte_thash_subtuple_helper *h)
453{
454 int i, j, k;
455 uint32_t val;
456 uint32_t start;
457
458 start = h->offset + h->len - (2 * ctx->reta_sz_log - 1);
459
460 for (i = 1; i < (1 << ctx->reta_sz_log); i++) {
461 val = 0;
462 for (j = i; j; j &= (j - 1)) {
463 k = rte_bsf32(j);
464 val ^= get_subvalue(ctx, start - k +
465 ctx->reta_sz_log - 1);
466 }
467 h->compl_table[val] = i;
468 }
469}
470
471static inline int
472insert_before(struct rte_thash_ctx *ctx,

Callers 3

insert_beforeFunction · 0.85
insert_afterFunction · 0.85
rte_thash_add_helperFunction · 0.85

Calls 2

get_subvalueFunction · 0.85
rte_bsf32Function · 0.50

Tested by

no test coverage detected