| 479 | } |
| 480 | |
| 481 | int |
| 482 | main(int argc, char **argv) |
| 483 | { |
| 484 | struct ipsec_test_data td_outb[RTE_DIM(alg_list)]; |
| 485 | struct ipsec_test_data td_inb[RTE_DIM(alg_list)]; |
| 486 | struct ipsec_test_flags flags; |
| 487 | uint32_t lcore_id; |
| 488 | uint8_t nb_lcores; |
| 489 | unsigned long i; |
| 490 | int ret; |
| 491 | |
| 492 | memset(&ctx, 0, sizeof(struct test_ctx)); |
| 493 | memset(&flags, 0, sizeof(flags)); |
| 494 | |
| 495 | ret = rte_eal_init(argc, argv); |
| 496 | if (ret < 0) |
| 497 | rte_exit(EXIT_FAILURE, "Invalid EAL arguments!\n"); |
| 498 | argc -= ret; |
| 499 | argv += ret; |
| 500 | |
| 501 | nb_lcores = rte_lcore_count() - 1; |
| 502 | if (nb_lcores < 1) { |
| 503 | RTE_LOG(ERR, USER1, |
| 504 | "Number of worker cores need to be higher than 1\n"); |
| 505 | return -EINVAL; |
| 506 | } |
| 507 | |
| 508 | ctx.nb_sess = DEF_NB_SESSIONS + RTE_MEMPOOL_CACHE_MAX_SIZE * nb_lcores; |
| 509 | |
| 510 | if (argc > 1) |
| 511 | args_parse(argc, argv); |
| 512 | |
| 513 | ctx.nb_lcores = nb_lcores; |
| 514 | |
| 515 | ret = cryptodev_init(&ctx, nb_lcores); |
| 516 | if (ret) |
| 517 | goto exit; |
| 518 | |
| 519 | ret = mempool_init(&ctx, nb_lcores); |
| 520 | if (ret) |
| 521 | goto cryptodev_fini; |
| 522 | |
| 523 | test_ipsec_alg_list_populate(); |
| 524 | |
| 525 | for (i = 0; i < RTE_DIM(alg_list); i++) { |
| 526 | test_ipsec_td_prepare(alg_list[i].param1, |
| 527 | alg_list[i].param2, |
| 528 | &flags, |
| 529 | &td_outb[i], |
| 530 | 1); |
| 531 | if (ctx.is_inbound) |
| 532 | test_ipsec_td_in_from_out(&td_outb[i], &td_inb[i]); |
| 533 | } |
| 534 | |
| 535 | ctx.td = td_outb; |
| 536 | if (ctx.is_inbound) |
| 537 | ctx.td = td_inb; |
| 538 |
nothing calls this directly
no test coverage detected