[2/3] net/ixgbe: fix security session destroy

Message ID 20221013121913.3543260-2-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/ixgbe/ixgbe_ipsec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Akhil Goyal Oct. 13, 2022, 12:24 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:18 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>; Yang, Qiming
> <qiming.yang@intel.com>; Wu, Wenjun1 <wenjun1.wu@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [EXT] [PATCH 2/3] net/ixgbe: 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/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index 8a96a9f11a..0c75fd36da 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -429,7 +429,6 @@  ixgbe_crypto_remove_session(void *device,
 {
 	struct rte_eth_dev *eth_dev = device;
 	struct ixgbe_crypto_session *ic_session = SECURITY_GET_SESS_PRIV(session);
-	struct rte_mempool *mempool = rte_mempool_from_obj(ic_session);
 
 	if (eth_dev != ic_session->dev) {
 		PMD_DRV_LOG(ERR, "Session not bound to this device\n");
@@ -441,8 +440,7 @@  ixgbe_crypto_remove_session(void *device,
 		return -EFAULT;
 	}
 
-	rte_mempool_put(mempool, (void *)ic_session);
-
+	memset(ic_session, 0, sizeof(struct ixgbe_crypto_session));
 	return 0;
 }