patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/iavf: fix device stop
@ 2022-05-06  9:45 Radu Nicolau
  2022-05-23 12:04 ` [PATCH v2] " Radu Nicolau
  0 siblings, 1 reply; 3+ messages in thread
From: Radu Nicolau @ 2022-05-06  9:45 UTC (permalink / raw)
  To: Jingjing Wu, Beilei Xing
  Cc: dev, daniel.m.buckley, qi.z.zhang, Radu Nicolau, stable

Move security context destroy from device stop to device close function.
Deleting the context on device stop can prevent the application from
properly cleaning and releasing resources.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c       | 6 +++---
 drivers/net/iavf/iavf_ipsec_crypto.c | 2 --
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 7d093bdc24..839831882d 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1035,9 +1035,6 @@ iavf_dev_stop(struct rte_eth_dev *dev)
 	iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num,
 				  false);
 
-	/* free iAVF security device context all related resources */
-	iavf_security_ctx_destroy(adapter);
-
 	adapter->stopped = 1;
 	dev->data->dev_started = 0;
 
@@ -2625,6 +2622,9 @@ iavf_dev_close(struct rte_eth_dev *dev)
 
 	ret = iavf_dev_stop(dev);
 
+	/* free iAVF security device context all related resources */
+	iavf_security_ctx_destroy(adapter);
+
 	iavf_flow_flush(dev, NULL);
 	iavf_flow_uninit(adapter);
 
diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c
index b1949cee91..6faebf3270 100644
--- a/drivers/net/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/iavf/iavf_ipsec_crypto.c
@@ -1551,8 +1551,6 @@ iavf_security_ctx_destroy(struct iavf_adapter *adapter)
 	if (iavf_sctx == NULL)
 		return -ENODEV;
 
-	/* TODO: Add resources cleanup */
-
 	/* free and reset security data structures */
 	rte_free(iavf_sctx);
 	rte_free(sctx);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] net/iavf: fix device stop
  2022-05-06  9:45 [PATCH] net/iavf: fix device stop Radu Nicolau
@ 2022-05-23 12:04 ` Radu Nicolau
  2022-05-25  8:52   ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Radu Nicolau @ 2022-05-23 12:04 UTC (permalink / raw)
  To: Jingjing Wu, Beilei Xing
  Cc: dev, daniel.m.buckley, qi.z.zhang, Radu Nicolau, stable

Move security context destroy from device stop to device close function.
Deleting the context on device stop can prevent the application from
properly cleaning and releasing resources.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
v2: rebased to next-net-intel

 drivers/net/iavf/iavf_ethdev.c       | 6 +++---
 drivers/net/iavf/iavf_ipsec_crypto.c | 2 --
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 7a3b37d5e3..e85ae0ed0e 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1088,9 +1088,6 @@ iavf_dev_stop(struct rte_eth_dev *dev)
 	iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num,
 				  false);
 
-	/* free iAVF security device context all related resources */
-	iavf_security_ctx_destroy(adapter);
-
 	adapter->stopped = 1;
 	dev->data->dev_started = 0;
 
@@ -2713,6 +2710,9 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	ret = iavf_dev_stop(dev);
 	adapter->closed = true;
 
+	/* free iAVF security device context all related resources */
+	iavf_security_ctx_destroy(adapter);
+
 	iavf_flow_flush(dev, NULL);
 	iavf_flow_uninit(adapter);
 
diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c
index 72ce39a052..fa1cecc1e1 100644
--- a/drivers/net/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/iavf/iavf_ipsec_crypto.c
@@ -1551,8 +1551,6 @@ iavf_security_ctx_destroy(struct iavf_adapter *adapter)
 	if (iavf_sctx == NULL)
 		return -ENODEV;
 
-	/* TODO: Add resources cleanup */
-
 	/* free and reset security data structures */
 	rte_free(iavf_sctx);
 	rte_free(sctx);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH v2] net/iavf: fix device stop
  2022-05-23 12:04 ` [PATCH v2] " Radu Nicolau
@ 2022-05-25  8:52   ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2022-05-25  8:52 UTC (permalink / raw)
  To: Nicolau, Radu, Wu, Jingjing, Xing, Beilei; +Cc: dev, Buckley, Daniel M, stable



> -----Original Message-----
> From: Nicolau, Radu <radu.nicolau@intel.com>
> Sent: Monday, May 23, 2022 8:05 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Buckley, Daniel M <daniel.m.buckley@intel.com>; Zhang,
> Qi Z <qi.z.zhang@intel.com>; Nicolau, Radu <radu.nicolau@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v2] net/iavf: fix device stop
> 
> Move security context destroy from device stop to device close function.
> Deleting the context on device stop can prevent the application from
> properly cleaning and releasing resources.
> 
> Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-25  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06  9:45 [PATCH] net/iavf: fix device stop Radu Nicolau
2022-05-23 12:04 ` [PATCH v2] " Radu Nicolau
2022-05-25  8:52   ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).