| 536 | } |
| 537 | |
| 538 | static int |
| 539 | test_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 | |
| 574 | static int |
| 575 | test_predictable_rss_min_seq(void) |
nothing calls this directly
no test coverage detected