[1/3] net/iavf: fix security session destroy

Message ID 20221013121913.3543260-1-radu.nicolau@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [1/3] net/iavf: fix security session destroy |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Radu Nicolau Oct. 13, 2022, 12:19 p.m. UTC
  Replace mempool_put with memset 0, the internal session memory block
is no longer allocated from a mempool

Fixes: 3f3fc3308bd0 ("security: remove private mempool usage")
Cc: gakhil@marvell.com

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 drivers/net/iavf/iavf_ipsec_crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Akhil Goyal Oct. 13, 2022, 12:23 p.m. UTC | #1
> Replace mempool_put with memset 0, the internal session memory block
> is no longer allocated from a mempool
> 
> Fixes: 3f3fc3308bd0 ("security: remove private mempool usage")
> Cc: gakhil@marvell.com
> 
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
Acked-by: Akhil Goyal <gakhil@marvell.com>
  
Qi Zhang Oct. 18, 2022, 4:13 a.m. UTC | #2
> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Thursday, October 13, 2022 8:24 PM
> To: Nicolau, Radu <radu.nicolau@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [EXT] [PATCH 1/3] net/iavf: fix security session destroy
> 
> > Replace mempool_put with memset 0, the internal session memory block
> > is no longer allocated from a mempool
> >
> > Fixes: 3f3fc3308bd0 ("security: remove private mempool usage")
> > Cc: gakhil@marvell.com
> >
> > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> > ---
> Acked-by: Akhil Goyal <gakhil@marvell.com>
> 

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c
index afd7f8f467..46a77afa27 100644
--- a/drivers/net/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/iavf/iavf_ipsec_crypto.c
@@ -1042,7 +1042,7 @@  iavf_ipsec_crypto_session_destroy(void *device,
 		return -EINVAL;
 
 	ret = iavf_ipsec_crypto_sa_del(adapter, iavf_sess);
-	rte_mempool_put(rte_mempool_from_obj(iavf_sess), (void *)iavf_sess);
+	memset(iavf_sess, 0, sizeof(struct iavf_security_session));
 	return ret;
 }