patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>
Cc: Gagandeep Singh <g.singh@nxp.com>, dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'crypto/dpaa2_sec: fix close and uninit functions' has been queued to stable release 19.11.9
Date: Mon, 17 May 2021 18:21:23 +0200	[thread overview]
Message-ID: <20210517162125.3178901-19-christian.ehrhardt@canonical.com> (raw)
In-Reply-To: <20210517162125.3178901-1-christian.ehrhardt@canonical.com>

Hi,

FYI, your patch has been queued to stable release 19.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/19/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a9c927d25419188b8d4f989dcc187ac6c0c0b215

Thanks.

Christian Ehrhardt <christian.ehrhardt@canonical.com>

---
From a9c927d25419188b8d4f989dcc187ac6c0c0b215 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal@nxp.com>
Date: Wed, 5 May 2021 17:46:52 +0530
Subject: [PATCH] crypto/dpaa2_sec: fix close and uninit functions

[ upstream commit 394b4e118e503e80ba86388d5f59f89331cf53c5 ]

The init function was calling the dpseci_open
while dpseci_close was called by the open function.
This is a mismatch un-init shall clean the init configurations and
close shall clear the configure function settings.

This was causing issue with recent changes in test framework, where
the close was being called and causing DPAA2 SEC to fail in configure

Fixes: e5cbdfc53765 ("crypto/dpaa2_sec: add basic operations")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 50 ++++++++++-----------
 1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 8df915e610..f0fa9f0fad 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3423,32 +3423,10 @@ dpaa2_sec_dev_stop(struct rte_cryptodev *dev)
 }
 
 static int
-dpaa2_sec_dev_close(struct rte_cryptodev *dev)
+dpaa2_sec_dev_close(struct rte_cryptodev *dev __rte_unused)
 {
-	struct dpaa2_sec_dev_private *priv = dev->data->dev_private;
-	struct fsl_mc_io *dpseci = (struct fsl_mc_io *)priv->hw;
-	int ret;
-
 	PMD_INIT_FUNC_TRACE();
 
-	/* Function is reverse of dpaa2_sec_dev_init.
-	 * It does the following:
-	 * 1. Detach a DPSECI from attached resources i.e. buffer pools, dpbp_id
-	 * 2. Close the DPSECI device
-	 * 3. Free the allocated resources.
-	 */
-
-	/*Close the device at underlying layer*/
-	ret = dpseci_close(dpseci, CMD_PRI_LOW, priv->token);
-	if (ret) {
-		DPAA2_SEC_ERR("Failure closing dpseci device: err(%d)", ret);
-		return -1;
-	}
-
-	/*Free the allocated memory for ethernet private data and dpseci*/
-	priv->hw = NULL;
-	rte_free(dpseci);
-
 	return 0;
 }
 
@@ -3704,11 +3682,31 @@ static const struct rte_security_ops dpaa2_sec_security_ops = {
 static int
 dpaa2_sec_uninit(const struct rte_cryptodev *dev)
 {
-	struct dpaa2_sec_dev_private *internals = dev->data->dev_private;
+	struct dpaa2_sec_dev_private *priv = dev->data->dev_private;
+	struct fsl_mc_io *dpseci = (struct fsl_mc_io *)priv->hw;
+	int ret;
 
-	rte_free(dev->security_ctx);
+	PMD_INIT_FUNC_TRACE();
+
+	/* Function is reverse of dpaa2_sec_dev_init.
+	 * It does the following:
+	 * 1. Detach a DPSECI from attached resources i.e. buffer pools, dpbp_id
+	 * 2. Close the DPSECI device
+	 * 3. Free the allocated resources.
+	 */
 
-	rte_mempool_free(internals->fle_pool);
+	/*Close the device at underlying layer*/
+	ret = dpseci_close(dpseci, CMD_PRI_LOW, priv->token);
+	if (ret) {
+		DPAA2_SEC_ERR("Failure closing dpseci device: err(%d)", ret);
+		return -1;
+	}
+
+	/*Free the allocated memory for ethernet private data and dpseci*/
+	priv->hw = NULL;
+	rte_free(dpseci);
+	rte_free(dev->security_ctx);
+	rte_mempool_free(priv->fle_pool);
 
 	DPAA2_SEC_INFO("Closing DPAA2_SEC device %s on numa socket %u",
 		       dev->data->name, rte_socket_id());
-- 
2.31.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-17 17:40:37.497919538 +0200
+++ 0208-crypto-dpaa2_sec-fix-close-and-uninit-functions.patch	2021-05-17 17:40:29.599812846 +0200
@@ -1 +1 @@
-From 394b4e118e503e80ba86388d5f59f89331cf53c5 Mon Sep 17 00:00:00 2001
+From a9c927d25419188b8d4f989dcc187ac6c0c0b215 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 394b4e118e503e80ba86388d5f59f89331cf53c5 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +25 @@
-index 05b194ccff..1ccead3641 100644
+index 8df915e610..f0fa9f0fad 100644
@@ -27 +28 @@
-@@ -3564,32 +3564,10 @@ dpaa2_sec_dev_stop(struct rte_cryptodev *dev)
+@@ -3423,32 +3423,10 @@ dpaa2_sec_dev_stop(struct rte_cryptodev *dev)
@@ -61 +62 @@
-@@ -3849,11 +3827,31 @@ static const struct rte_security_ops dpaa2_sec_security_ops = {
+@@ -3704,11 +3682,31 @@ static const struct rte_security_ops dpaa2_sec_security_ops = {

  parent reply	other threads:[~2021-05-17 16:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 16:21 [dpdk-stable] patch 'test/distributor: fix burst flush on worker quit' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'net/virtio: fix vectorized Rx queue rearm' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'net/bnxt: refactor multi-queue Rx configuration' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'net/bnxt: fix Rx timestamp when FIFO pending bit is set' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'net/bnxt: fix dynamic VNIC count' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'net/bnxt: fix single PF per port check' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'net/bnxt: fix mismatched type comparison in MAC restore' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'net/bnxt: check PCI config read' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'net/bnxt: prevent device access in error state' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'raw/ntb: check SPAD user index' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'raw/ntb: check memory allocations' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'ipc: check malloc sync reply result' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'eal: fix service core list parsing' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'app/bbdev: fix HARQ error messages' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'common/qat: increase IM buffer size for GEN3' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'compress/qat: enable compression on " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'test/crypto: fix auth-cipher compare length in OOP' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'crypto/dpaa_sec: affine the thread portal affinity' " Christian Ehrhardt
2021-05-17 16:21 ` Christian Ehrhardt [this message]
2021-05-17 16:21 ` [dpdk-stable] patch 'test/crypto: copy offset data to OOP destination buffer' " Christian Ehrhardt
2021-05-17 16:21 ` [dpdk-stable] patch 'doc: fix build with Sphinx 4' " Christian Ehrhardt

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=20210517162125.3178901-19-christian.ehrhardt@canonical.com \
    --to=christian.ehrhardt@canonical.com \
    --cc=g.singh@nxp.com \
    --cc=hemant.agrawal@nxp.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).