| 1517 | } |
| 1518 | |
| 1519 | void |
| 1520 | ut_teardown(void) |
| 1521 | { |
| 1522 | struct crypto_testsuite_params *ts_params = &testsuite_params; |
| 1523 | struct crypto_unittest_params *ut_params = &unittest_params; |
| 1524 | |
| 1525 | /* free crypto session structure */ |
| 1526 | #ifdef RTE_LIB_SECURITY |
| 1527 | if (ut_params->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) { |
| 1528 | if (ut_params->sec_session) { |
| 1529 | rte_security_session_destroy(rte_cryptodev_get_sec_ctx |
| 1530 | (ts_params->valid_devs[0]), |
| 1531 | ut_params->sec_session); |
| 1532 | ut_params->sec_session = NULL; |
| 1533 | } |
| 1534 | } else |
| 1535 | #endif |
| 1536 | { |
| 1537 | if (ut_params->sess) { |
| 1538 | rte_cryptodev_sym_session_free(ts_params->valid_devs[0], |
| 1539 | ut_params->sess); |
| 1540 | ut_params->sess = NULL; |
| 1541 | } |
| 1542 | } |
| 1543 | |
| 1544 | /* free crypto operation structure */ |
| 1545 | rte_crypto_op_free(ut_params->op); |
| 1546 | |
| 1547 | /* |
| 1548 | * free mbuf - both obuf and ibuf are usually the same, |
| 1549 | * so check if they point at the same address is necessary, |
| 1550 | * to avoid freeing the mbuf twice. |
| 1551 | */ |
| 1552 | if (ut_params->obuf) { |
| 1553 | rte_pktmbuf_free(ut_params->obuf); |
| 1554 | if (ut_params->ibuf == ut_params->obuf) |
| 1555 | ut_params->ibuf = 0; |
| 1556 | ut_params->obuf = 0; |
| 1557 | } |
| 1558 | if (ut_params->ibuf) { |
| 1559 | rte_pktmbuf_free(ut_params->ibuf); |
| 1560 | ut_params->ibuf = 0; |
| 1561 | } |
| 1562 | |
| 1563 | if (ts_params->mbuf_pool != NULL) |
| 1564 | RTE_LOG(DEBUG, USER1, "CRYPTO_MBUFPOOL count %u\n", |
| 1565 | rte_mempool_avail_count(ts_params->mbuf_pool)); |
| 1566 | |
| 1567 | /* Stop the device */ |
| 1568 | rte_cryptodev_stop(ts_params->valid_devs[0]); |
| 1569 | } |
| 1570 | |
| 1571 | static void |
| 1572 | ut_teardown_rx_inject(void) |
no test coverage detected