[dpdk-stable] patch 'crypto/octeontx2: fix session-less mode' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:45:00 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/20. 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.

Thanks.

Luca Boccassi

---
>From 17beb6dbfeeb09d75749950ac8b48ca550c95ed0 Mon Sep 17 00:00:00 2001
From: Ankur Dwivedi <adwivedi at marvell.com>
Date: Fri, 18 Sep 2020 19:15:45 +0530
Subject: [PATCH] crypto/octeontx2: fix session-less mode

[ upstream commit 4a35a46409eb59bb55102120946503920d41f7de ]

A temporary session is created for sessionless crypto operations.
rte_cryptodev_sym_session_create() should be used for creating the
temporary session as it initializes the session structure in the
correct way. Also the session should be set to 0 before freeing it.

Fixes: 17ac2a72191b ("crypto/octeontx2: add enqueue/dequeue ops")

Signed-off-by: Ankur Dwivedi <adwivedi at marvell.com>
Acked-by: Anoob Joseph <anoobj at marvell.com>
---
 drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index 65101b0d2f..af4bbccd7d 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -518,8 +518,8 @@ otx2_cpt_enqueue_sym_sessless(struct otx2_cpt_qp *qp, struct rte_crypto_op *op,
 	int ret;
 
 	/* Create temporary session */
-
-	if (rte_mempool_get(qp->sess_mp, (void **)&sess))
+	sess = rte_cryptodev_sym_session_create(qp->sess_mp);
+	if (sess == NULL)
 		return -ENOMEM;
 
 	ret = sym_session_configure(driver_id, sym_op->xform, sess,
@@ -671,6 +671,8 @@ static inline void
 otx2_cpt_dequeue_post_process(struct otx2_cpt_qp *qp, struct rte_crypto_op *cop,
 			      uintptr_t *rsp, uint8_t cc)
 {
+	unsigned int sz;
+
 	if (cop->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC) {
 		if (likely(cc == NO_ERR)) {
 			/* Verify authentication data if required */
@@ -689,6 +691,9 @@ otx2_cpt_dequeue_post_process(struct otx2_cpt_qp *qp, struct rte_crypto_op *cop,
 		if (unlikely(cop->sess_type == RTE_CRYPTO_OP_SESSIONLESS)) {
 			sym_session_clear(otx2_cryptodev_driver_id,
 					  cop->sym->session);
+			sz = rte_cryptodev_sym_get_existing_header_session_size(
+					cop->sym->session);
+			memset(cop->sym->session, 0, sz);
 			rte_mempool_put(qp->sess_mp, cop->sym->session);
 			cop->sym->session = NULL;
 		}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:16.113402491 +0000
+++ 0141-crypto-octeontx2-fix-session-less-mode.patch	2020-10-28 10:35:11.712833086 +0000
@@ -1,15 +1,16 @@
-From 4a35a46409eb59bb55102120946503920d41f7de Mon Sep 17 00:00:00 2001
+From 17beb6dbfeeb09d75749950ac8b48ca550c95ed0 Mon Sep 17 00:00:00 2001
 From: Ankur Dwivedi <adwivedi at marvell.com>
 Date: Fri, 18 Sep 2020 19:15:45 +0530
 Subject: [PATCH] crypto/octeontx2: fix session-less mode
 
+[ upstream commit 4a35a46409eb59bb55102120946503920d41f7de ]
+
 A temporary session is created for sessionless crypto operations.
 rte_cryptodev_sym_session_create() should be used for creating the
 temporary session as it initializes the session structure in the
 correct way. Also the session should be set to 0 before freeing it.
 
 Fixes: 17ac2a72191b ("crypto/octeontx2: add enqueue/dequeue ops")
-Cc: stable at dpdk.org
 
 Signed-off-by: Ankur Dwivedi <adwivedi at marvell.com>
 Acked-by: Anoob Joseph <anoobj at marvell.com>
@@ -18,10 +19,10 @@
  1 file changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
-index df39cde957..d38365a331 100644
+index 65101b0d2f..af4bbccd7d 100644
 --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
 +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
-@@ -648,8 +648,8 @@ otx2_cpt_enqueue_sym_sessless(struct otx2_cpt_qp *qp, struct rte_crypto_op *op,
+@@ -518,8 +518,8 @@ otx2_cpt_enqueue_sym_sessless(struct otx2_cpt_qp *qp, struct rte_crypto_op *op,
  	int ret;
  
  	/* Create temporary session */
@@ -32,16 +33,16 @@
  		return -ENOMEM;
  
  	ret = sym_session_configure(driver_id, sym_op->xform, sess,
-@@ -866,6 +866,8 @@ static inline void
+@@ -671,6 +671,8 @@ static inline void
  otx2_cpt_dequeue_post_process(struct otx2_cpt_qp *qp, struct rte_crypto_op *cop,
  			      uintptr_t *rsp, uint8_t cc)
  {
 +	unsigned int sz;
 +
  	if (cop->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC) {
- 		if (cop->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) {
- 			if (likely(cc == OTX2_IPSEC_PO_CC_SUCCESS)) {
-@@ -894,6 +896,9 @@ otx2_cpt_dequeue_post_process(struct otx2_cpt_qp *qp, struct rte_crypto_op *cop,
+ 		if (likely(cc == NO_ERR)) {
+ 			/* Verify authentication data if required */
+@@ -689,6 +691,9 @@ otx2_cpt_dequeue_post_process(struct otx2_cpt_qp *qp, struct rte_crypto_op *cop,
  		if (unlikely(cop->sess_type == RTE_CRYPTO_OP_SESSIONLESS)) {
  			sym_session_clear(otx2_cryptodev_driver_id,
  					  cop->sym->session);


More information about the stable mailing list