test/distributor: fix spurious failure
[dpdk.git] / app / test / test_ipsec.c
index df87884..4007eff 100644 (file)
@@ -574,7 +574,7 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,
        struct rte_mbuf *m = rte_pktmbuf_alloc(mpool);
        uint32_t hdrlen = sizeof(struct rte_ipv4_hdr) +
                sizeof(struct rte_esp_hdr);
-       uint32_t taillen = sizeof(struct esp_tail);
+       uint32_t taillen = sizeof(struct rte_esp_tail);
        uint32_t t_len = len + hdrlen + taillen;
        uint32_t padlen;
 
@@ -586,7 +586,7 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,
        padlen = RTE_ALIGN(t_len, 4) - t_len;
        t_len += padlen;
 
-       struct esp_tail espt  = {
+       struct rte_esp_tail espt = {
                .pad_len = padlen,
                .next_proto = IPPROTO_IPIP,
        };
@@ -1171,9 +1171,11 @@ static void
 destroy_sa(uint32_t j)
 {
        struct ipsec_unitest_params *ut = &unittest_params;
+       struct ipsec_testsuite_params *ts = &testsuite_params;
 
        rte_ipsec_sa_fini(ut->ss[j].sa);
        rte_free(ut->ss[j].sa);
+       rte_cryptodev_sym_session_clear(ts->valid_dev, ut->ss[j].crypto.ses);
        rte_cryptodev_sym_session_free(ut->ss[j].crypto.ses);
        memset(&ut->ss[j], 0, sizeof(ut->ss[j]));
 }