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

Function test_period_overflow

dpdk/app/test/test_thash.c:538–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538static int
539test_period_overflow(void)
540{
541 struct rte_thash_ctx *ctx;
542 int reta_sz = 7; /* reflects polynomial degree */
543 int ret;
544
545 /* first create without RTE_THASH_IGNORE_PERIOD_OVERFLOW flag */
546 ctx = rte_thash_init_ctx("test", 40, reta_sz, NULL, 0);
547 RTE_TEST_ASSERT(ctx != NULL, "Can not create thash ctx\n");
548
549 /* requested range > (2^reta_sz) - 1 */
550 ret = rte_thash_add_helper(ctx, "test", (1 << reta_sz), 0);
551 RTE_TEST_ASSERT(ret == -ENOSPC,
552 "Call succeeded with invalid parameters\n");
553
554 /* requested range == len + 32 - 1, smaller than (2^reta_sz) - 1 */
555 ret = rte_thash_add_helper(ctx, "test", (1 << reta_sz) - 32, 0);
556 RTE_TEST_ASSERT(ret == 0, "Can not create helper\n");
557
558 rte_thash_free_ctx(ctx);
559
560 /* create with RTE_THASH_IGNORE_PERIOD_OVERFLOW flag */
561 ctx = rte_thash_init_ctx("test", 40, reta_sz, NULL,
562 RTE_THASH_IGNORE_PERIOD_OVERFLOW);
563 RTE_TEST_ASSERT(ctx != NULL, "Can not create thash ctx\n");
564
565 /* requested range > (2^reta_sz - 1) */
566 ret = rte_thash_add_helper(ctx, "test", (1 << reta_sz) + 10, 0);
567 RTE_TEST_ASSERT(ret == 0, "Can not create helper\n");
568
569 rte_thash_free_ctx(ctx);
570
571 return TEST_SUCCESS;
572}
573
574static int
575test_predictable_rss_min_seq(void)

Callers

nothing calls this directly

Calls 3

rte_thash_init_ctxFunction · 0.85
rte_thash_add_helperFunction · 0.85
rte_thash_free_ctxFunction · 0.85

Tested by

no test coverage detected