| 439 | } |
| 440 | |
| 441 | static void |
| 442 | ut_teardown_ipsec(void) |
| 443 | { |
| 444 | struct ipsec_testsuite_params *ts_params = &testsuite_params; |
| 445 | struct ipsec_unitest_params *ut_params = &unittest_params; |
| 446 | int i; |
| 447 | |
| 448 | for (i = 0; i < BURST_SIZE; i++) { |
| 449 | /* free crypto operation structure */ |
| 450 | if (ut_params->cop[i]) { |
| 451 | rte_crypto_op_free(ut_params->cop[i]); |
| 452 | ut_params->cop[i] = NULL; |
| 453 | } |
| 454 | |
| 455 | /* |
| 456 | * free mbuf - both obuf and ibuf are usually the same, |
| 457 | * so check if they point at the same address is necessary, |
| 458 | * to avoid freeing the mbuf twice. |
| 459 | */ |
| 460 | if (ut_params->obuf[i]) { |
| 461 | rte_pktmbuf_free(ut_params->obuf[i]); |
| 462 | if (ut_params->ibuf[i] == ut_params->obuf[i]) |
| 463 | ut_params->ibuf[i] = NULL; |
| 464 | ut_params->obuf[i] = NULL; |
| 465 | } |
| 466 | if (ut_params->ibuf[i]) { |
| 467 | rte_pktmbuf_free(ut_params->ibuf[i]); |
| 468 | ut_params->ibuf[i] = NULL; |
| 469 | } |
| 470 | |
| 471 | if (ut_params->testbuf[i]) { |
| 472 | rte_pktmbuf_free(ut_params->testbuf[i]); |
| 473 | ut_params->testbuf[i] = NULL; |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | if (ts_params->mbuf_pool != NULL) |
| 478 | RTE_LOG(DEBUG, USER1, "CRYPTO_MBUFPOOL count %u\n", |
| 479 | rte_mempool_avail_count(ts_params->mbuf_pool)); |
| 480 | |
| 481 | /* Stop the device */ |
| 482 | rte_cryptodev_stop(ts_params->valid_dev); |
| 483 | } |
| 484 | |
| 485 | #define IPSEC_MAX_PAD_SIZE UINT8_MAX |
| 486 |
nothing calls this directly
no test coverage detected