From: Radu Nicolau <radu.nicolau@intel.com>
To: Jingjing Wu <jingjing.wu@intel.com>, Beilei Xing <beilei.xing@intel.com>
Cc: dev@dpdk.org, daniel.m.buckley@intel.com, qi.z.zhang@intel.com,
Radu Nicolau <radu.nicolau@intel.com>,
stable@dpdk.org
Subject: [PATCH v2] net/iavf: fix device stop
Date: Mon, 23 May 2022 13:04:36 +0100 [thread overview]
Message-ID: <20220523120436.4042421-1-radu.nicolau@intel.com> (raw)
In-Reply-To: <20220506094531.3485109-1-radu.nicolau@intel.com>
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
next prev parent reply other threads:[~2022-05-23 12:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-06 9:45 [PATCH] " Radu Nicolau
2022-05-23 12:04 ` Radu Nicolau [this message]
2022-05-25 8:52 ` [PATCH v2] " Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220523120436.4042421-1-radu.nicolau@intel.com \
--to=radu.nicolau@intel.com \
--cc=beilei.xing@intel.com \
--cc=daniel.m.buckley@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).