| 1742 | } |
| 1743 | |
| 1744 | static void |
| 1745 | ipsec_session_free(struct rte_swx_ipsec *ipsec, |
| 1746 | struct rte_ipsec_session *s) |
| 1747 | { |
| 1748 | if (!s) |
| 1749 | return; |
| 1750 | |
| 1751 | /* IPsec library SA. */ |
| 1752 | if (s->sa) |
| 1753 | rte_ipsec_sa_fini(s->sa); |
| 1754 | free(s->sa); |
| 1755 | |
| 1756 | /* Cryptodev library session. */ |
| 1757 | if (s->crypto.ses) |
| 1758 | rte_cryptodev_sym_session_free(ipsec->dev_id, s->crypto.ses); |
| 1759 | |
| 1760 | /* IPsec library session. */ |
| 1761 | memset(s, 0, sizeof(*s)); |
| 1762 | } |
| 1763 | |
| 1764 | int |
| 1765 | rte_swx_ipsec_sa_add(struct rte_swx_ipsec *ipsec, |
no test coverage detected