for (i = 0; i < BURST_SIZE; i++) {
/* free crypto operation structure */
- if (ut_params->cop[i])
+ if (ut_params->cop[i]) {
rte_crypto_op_free(ut_params->cop[i]);
+ ut_params->cop[i] = NULL;
+ }
/*
* free mbuf - both obuf and ibuf are usually the same,
if (ut_params->obuf[i]) {
rte_pktmbuf_free(ut_params->obuf[i]);
if (ut_params->ibuf[i] == ut_params->obuf[i])
- ut_params->ibuf[i] = 0;
- ut_params->obuf[i] = 0;
+ ut_params->ibuf[i] = NULL;
+ ut_params->obuf[i] = NULL;
}
if (ut_params->ibuf[i]) {
rte_pktmbuf_free(ut_params->ibuf[i]);
- ut_params->ibuf[i] = 0;
+ ut_params->ibuf[i] = NULL;
}
if (ut_params->testbuf[i]) {
rte_pktmbuf_free(ut_params->testbuf[i]);
- ut_params->testbuf[i] = 0;
+ ut_params->testbuf[i] = NULL;
}
}
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;
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,
};
prm->userdata = 1;
prm->flags = flags;
- prm->replay_win_sz = replay_win_sz;
/* setup ipsec xform */
prm->ipsec_xform = ut_params->ipsec_xform;
prm->ipsec_xform.salt = (uint32_t)rte_rand();
+ prm->ipsec_xform.replay_win_sz = replay_win_sz;
/* setup tunnel related fields */
prm->tun.hdr_len = sizeof(ipv4_outer);
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]));
}