test/ipsec: fixes
cover test/ipsec: fixes
The patches in this patch set depend on the following patches:
http://patches.dpdk.org/patch/54541/
http://patches.dpdk.org/patch/54542/
http://patches.dpdk.org/patch/54543/
Bernard Iremonger (2):
test/ipsec: fix teardown function
test/ipsec: fix destroy sa function
app/test/test_ipsec.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/2 test/ipsec: fix teardown function
Set freed cop pointers to NULL
Set other freed pointers to NULL instead of 0
--- app/test/test_ipsec.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
app/test/test_ipsec.c +7 -5
@@ -451,8 +451,10 @@ ut_teardown(void)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,
@@ -462,17 +464,17 @@ ut_teardown(void)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 ; } }
Signature · 1 line
2.7.4
PATCH 2/2 test/ipsec: fix destroy sa function
In reply to Bernard IremongerCall rte_cryptodev_sym_session_clear() function.
--- app/test/test_ipsec.c | 2 ++ 1 file changed, 2 insertions(+)
app/test/test_ipsec.c +2 -0
@@ -1170,9 +1170,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])); }
Signature · 1 line
2.7.4
Quoted 20 lines
-----Original Message-----
From: Bernard Iremonger <[email protected]>
Sent: Friday, June 28, 2019 6:59 PM
To: [email protected]; [email protected]; Akhil Goyal <[email protected]>
Cc: Bernard Iremonger <[email protected]>
Subject: [PATCH 0/2] test/ipsec: fixesThe patches in this patch set depend on the following patches:
http://patches.dpdk.org/patch/54541/
http://patches.dpdk.org/patch/54542/
http://patches.dpdk.org/patch/54543/Bernard Iremonger (2):
test/ipsec: fix teardown function
test/ipsec: fix destroy sa function
Quoted 5 lines
app/test/test_ipsec.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)--
2.7.4
Applied to dpdk-next-crypto
Thanks.