patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Fan Zhang <roy.fan.zhang@intel.com>
To: dev@dpdk.org
Cc: pablo.de.lara.guarch@intel.com, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2] crypto/scheduler: fix session free
Date: Mon,  3 Apr 2017 17:37:29 +0100	[thread overview]
Message-ID: <1491237449-113572-1-git-send-email-roy.fan.zhang@intel.com> (raw)
In-Reply-To: <1491234435-112340-1-git-send-email-roy.fan.zhang@intel.com>

This patch fixes the incorrection slave session free operation.

Fixes: 57523e682bb7 ("crypto/scheduler: register operation functions")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---

v2:
- Remove unnecessary session set line.

 drivers/crypto/scheduler/scheduler_pmd_ops.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c
index f02506c..cd8c6a8 100644
--- a/drivers/crypto/scheduler/scheduler_pmd_ops.c
+++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c
@@ -433,9 +433,10 @@ config_slave_sess(struct scheduler_ctx *sched_ctx,
 			if (create)
 				continue;
 			/* !create */
-			(*dev->dev_ops->session_clear)(dev,
-					(void *)sess->sessions[i]);
-			sess->sessions[i] = NULL;
+			sess->sessions[i] = rte_cryptodev_sym_session_free(
+					slave->dev_id, sess->sessions[i]);
+			if (!sess->sessions[i])
+				return -1;
 		} else {
 			if (!create)
 				continue;
@@ -443,10 +444,6 @@ config_slave_sess(struct scheduler_ctx *sched_ctx,
 			sess->sessions[i] =
 					rte_cryptodev_sym_session_create(
 							slave->dev_id, xform);
-			if (!sess->sessions[i]) {
-				config_slave_sess(sched_ctx, NULL, sess, 0);
-				return -1;
-			}
 		}
 	}
 
-- 
2.7.4

       reply	other threads:[~2017-04-03 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1491234435-112340-1-git-send-email-roy.fan.zhang@intel.com>
2017-04-03 16:37 ` Fan Zhang [this message]
2017-04-04  9:31   ` [dpdk-stable] [PATCH v3] " Fan Zhang
2017-04-04 15:27     ` De Lara Guarch, Pablo

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=1491237449-113572-1-git-send-email-roy.fan.zhang@intel.com \
    --to=roy.fan.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@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).