From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 92D6AA04DD for ; Wed, 28 Oct 2020 11:53:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C7A9C96E; Wed, 28 Oct 2020 11:53:44 +0100 (CET) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 5B04A49E0 for ; Wed, 28 Oct 2020 11:53:43 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id s9so5162633wro.8 for ; Wed, 28 Oct 2020 03:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=82LU15NYA1uJH5533Nv+NnHTrvYfbsrsIWRr1qk8OTQ=; b=C5LyihYU/TH7urBT4iapIKBVOoOBvZZ6U75w6BNxKFE5EeeiP1tR3831z2VR+xy5Tb N1ncbeYIKDGQL1NL39Dx3VSSiJEIrT/LCcZ4lbLb0DWfZqJfabpxfXpga6iY5/k4dRQo snnqgx88UKgy3/UzSPl8w8LYom6lTbW5uDFDa/VI/BlqywdgoH33NwcC8xCrw7St0W6J MM9Qv2BL9dcxmYErNzdYUOGabIduGDvebKLs35PVragi60LNJ4nxFQ3ajmgiDFR9iXO5 N0q/VNeOHosKY6/gfKffuFLzIJzG25ACYl+ReGFs3cJ5g0rBVQYnVngK7cMDmIN5mRXB prYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=82LU15NYA1uJH5533Nv+NnHTrvYfbsrsIWRr1qk8OTQ=; b=bYRw5H8JBRedRF9CcWGAdAFFAfs84utSU2sxy5Lp/LLm2yMlNxm/XMRk0qK/iAiLMT k/Cmy4AnPDh4gduVXLPEI2Zy+gieAf4i1wHMwzICX5nY4ZGcs7g/PbEUbZZnerihFAKC a4Qgtx0fWPdfbQXO+A7+wuD8PpRvzI9HtK3vgSBHo3KaJEE/5yB49dmRK9gGH5+jM89V 23BTaM4UXP366tKlcR8gNGemuFhTV1haH367pz2y9jdMH4WCeLZIIQEVbIM6Q0Im9Q6/ UTG2AQazCKlbIqG4gRMwB0Gl/mdkQSiYRYxfySkHmLKRgUau+pufOwZba16pfstCr0ag hXyQ== X-Gm-Message-State: AOAM5309gJaFxmbjCNPR+gKA+fKhzeoyIg0q++5xwUJYhJ3B0Op2phMK FOS+zijN3us6bIYdl6/VjCs= X-Google-Smtp-Source: ABdhPJz4fTZYI1qJ1C2oq4nNO2u9Okcak3rUHUiLHGl3solDXyuBz5vl7EdC8B3OzBQuatFwatwFTQ== X-Received: by 2002:a5d:4cd1:: with SMTP id c17mr8207868wrt.109.1603882422091; Wed, 28 Oct 2020 03:53:42 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id u3sm6473872wrq.19.2020.10.28.03.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:53:41 -0700 (PDT) From: luca.boccassi@gmail.com To: Ankur Dwivedi Cc: Anoob Joseph , dpdk stable Date: Wed, 28 Oct 2020 10:45:00 +0000 Message-Id: <20201028104606.3504127-141-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'crypto/octeontx2: fix session-less mode' has been queued to stable release 19.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 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 Acked-by: Anoob Joseph --- 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 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@dpdk.org Signed-off-by: Ankur Dwivedi Acked-by: Anoob Joseph @@ -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);