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 9E884A0527 for ; Mon, 9 Nov 2020 19:42:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8DFE772E9; Mon, 9 Nov 2020 19:42:20 +0100 (CET) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by dpdk.org (Postfix) with ESMTP id 9C7C86883 for ; Mon, 9 Nov 2020 19:42:18 +0100 (CET) Received: by mail-wm1-f42.google.com with SMTP id h2so468050wmm.0 for ; Mon, 09 Nov 2020 10:42:18 -0800 (PST) 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=GxeBZYauPhTBTts3S3pLvD6RkV//MBwvcJ6kECfGGIg=; b=WLJsDDw3ylDy/ftvXGdNV5cBv6tP20q9LM8YzYyJdPJzqJZZwyOixy7DXloTr62EOo a54WA5igAjxF+OyQD+rvuGzdJgEc1pysqf0PtX0L1y1Xv8LMZvRoT56iJoakavu511h+ jUTXBbxZ98Pk6G7O993KMhYtM6MIZcbX0n6CDzZZXpaw0XLUpAPYrkt7Lk+zTCmetHlS p4R0goB7IZDVSsDo+chIYAKPEDBZk/QRfGuyDx5txG2TkHrTCxWnqDuBcjO2GjGNcz2Z JoVwsPZWu+G/vBK4NFSPG/doLY0vvAZe6p3SAF760bkirVzXA4INwxDURNvLBzGx26aO Yd+A== 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=GxeBZYauPhTBTts3S3pLvD6RkV//MBwvcJ6kECfGGIg=; b=PblLnx+1ecLySDfSCcDKIUA8B3X4oSIP/RxzybPouby6T2DZANmv497a5D9pfVgAeT mb8KPBQC6OuyQPx2TTFS9lwPyIQialJ5pta0to8ddhP6kUceGICSUaoIqo3pwuPap6Sy tTLZrXY4ZRQ7xRe5/uJ44JF2yaBgiC1Eg2YharChOIfcN1ihPl0C9KdD7PftfoMxb/R1 hfSNso4VCL8tbvRPoTIe5Ai/qAp/nw/t8+KuhCHdOP5RA28GYwRCpQ0n6+ayAa44dPhO VMapKptplh5o2PjvRk9CfePx97GKg4eI8TcJ4bjfFiwRjI3pExbDs+WUGb0/UJf/t6Fx MA9g== X-Gm-Message-State: AOAM5310wRYl1lalJGvjoANMlS/0b95zGFc4c4wuN1EnpthdkWBqsTjp 44ZUEyoozKI1TGUvikQ4Fsr2bcbt3DvC5w== X-Google-Smtp-Source: ABdhPJxiwxfRPf0kcZyu67RL7AyVFTcxh44Bdyz8XWDm38dCW2EQCJoMC/sYKysLCcv8q+FVM639wQ== X-Received: by 2002:a1c:bd0b:: with SMTP id n11mr531654wmf.111.1604947337393; Mon, 09 Nov 2020 10:42:17 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id t11sm296281wmf.35.2020.11.09.10.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 10:42:16 -0800 (PST) From: luca.boccassi@gmail.com To: Ankur Dwivedi Cc: Anoob Joseph , dpdk stable Date: Mon, 9 Nov 2020 18:40:06 +0000 Message-Id: <20201109184111.3463090-18-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201109184111.3463090-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-207-luca.boccassi@gmail.com> <20201109184111.3463090-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'crypto/octeontx2: fix multi-process' 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 11/11/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. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/3415ca530b2ea4acdbc15b3c6eb4c4f4177a09dc Thanks. Luca Boccassi --- >From 3415ca530b2ea4acdbc15b3c6eb4c4f4177a09dc Mon Sep 17 00:00:00 2001 From: Ankur Dwivedi Date: Thu, 22 Oct 2020 13:20:00 +0530 Subject: [PATCH] crypto/octeontx2: fix multi-process [ upstream commit 9fd11c1583c9b3249f49755b3216a79698e94700 ] During crypto device probe few functions should be called only for the primary process. This patch fixes this issue. Fixes: 818d138bcce9 ("crypto/octeontx2: add init sequence in probe") Signed-off-by: Ankur Dwivedi Reviewed-by: Anoob Joseph --- drivers/crypto/octeontx2/otx2_cryptodev.c | 49 +++++++++++-------- drivers/crypto/octeontx2/otx2_cryptodev.h | 2 + drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 13 +++-- 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.c b/drivers/crypto/octeontx2/otx2_cryptodev.c index 417eda6de6..2323de1f60 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev.c @@ -70,31 +70,34 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, otx2_dev = &vf->otx2_dev; - /* Initialize the base otx2_dev object */ - ret = otx2_dev_init(pci_dev, otx2_dev); - if (ret) { - CPT_LOG_ERR("Could not initialize otx2_dev"); - goto pmd_destroy; - } + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + /* Initialize the base otx2_dev object */ + ret = otx2_dev_init(pci_dev, otx2_dev); + if (ret) { + CPT_LOG_ERR("Could not initialize otx2_dev"); + goto pmd_destroy; + } - /* Get number of queues available on the device */ - ret = otx2_cpt_available_queues_get(dev, &nb_queues); - if (ret) { - CPT_LOG_ERR("Could not determine the number of queues available"); - goto otx2_dev_fini; - } + /* Get number of queues available on the device */ + ret = otx2_cpt_available_queues_get(dev, &nb_queues); + if (ret) { + CPT_LOG_ERR("Could not determine the number of queues available"); + goto otx2_dev_fini; + } - /* Don't exceed the limits set per VF */ - nb_queues = RTE_MIN(nb_queues, OTX2_CPT_MAX_QUEUES_PER_VF); + /* Don't exceed the limits set per VF */ + nb_queues = RTE_MIN(nb_queues, OTX2_CPT_MAX_QUEUES_PER_VF); - if (nb_queues == 0) { - CPT_LOG_ERR("No free queues available on the device"); - goto otx2_dev_fini; - } + if (nb_queues == 0) { + CPT_LOG_ERR("No free queues available on the device"); + goto otx2_dev_fini; + } - vf->max_queues = nb_queues; + vf->max_queues = nb_queues; - CPT_LOG_INFO("Max queues supported by device: %d", vf->max_queues); + CPT_LOG_INFO("Max queues supported by device: %d", + vf->max_queues); + } dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_HW_ACCELERATED | @@ -105,10 +108,14 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT; + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + otx2_cpt_set_enqdeq_fns(dev); + return 0; otx2_dev_fini: - otx2_dev_fini(pci_dev, otx2_dev); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + otx2_dev_fini(pci_dev, otx2_dev); pmd_destroy: rte_cryptodev_pmd_destroy(dev); exit: diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.h b/drivers/crypto/octeontx2/otx2_cryptodev.h index c0aa661b3b..17c0bee661 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev.h +++ b/drivers/crypto/octeontx2/otx2_cryptodev.h @@ -40,4 +40,6 @@ extern int otx2_cpt_logtype; */ extern uint8_t otx2_cryptodev_driver_id; +void otx2_cpt_set_enqdeq_fns(struct rte_cryptodev *dev); + #endif /* _OTX2_CRYPTODEV_H_ */ diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c index af4bbccd7d..292aff1928 100644 --- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c +++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c @@ -813,6 +813,15 @@ otx2_cpt_dequeue_burst(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops) return nb_completed; } +void +otx2_cpt_set_enqdeq_fns(struct rte_cryptodev *dev) +{ + dev->enqueue_burst = otx2_cpt_enqueue_burst; + dev->dequeue_burst = otx2_cpt_dequeue_burst; + + rte_mb(); +} + /* PMD ops */ static int @@ -862,10 +871,8 @@ otx2_cpt_dev_config(struct rte_cryptodev *dev, goto queues_detach; } - dev->enqueue_burst = otx2_cpt_enqueue_burst; - dev->dequeue_burst = otx2_cpt_dequeue_burst; + otx2_cpt_set_enqdeq_fns(dev); - rte_mb(); return 0; queues_detach: -- 2.27.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-09 18:40:11.932938032 +0000 +++ 0018-crypto-octeontx2-fix-multi-process.patch 2020-11-09 18:40:11.091310660 +0000 @@ -1 +1 @@ -From 9fd11c1583c9b3249f49755b3216a79698e94700 Mon Sep 17 00:00:00 2001 +From 3415ca530b2ea4acdbc15b3c6eb4c4f4177a09dc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9fd11c1583c9b3249f49755b3216a79698e94700 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -15 +16 @@ - drivers/crypto/octeontx2/otx2_cryptodev.c | 57 +++++++++++-------- + drivers/crypto/octeontx2/otx2_cryptodev.c | 49 +++++++++++-------- @@ -17,2 +18,2 @@ - drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 13 ++++- - 3 files changed, 44 insertions(+), 28 deletions(-) + drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 13 +++-- + 3 files changed, 40 insertions(+), 24 deletions(-) @@ -21 +22 @@ -index 02d2fd83bd..1de04f4a66 100644 +index 417eda6de6..2323de1f60 100644 @@ -24 +25 @@ -@@ -70,36 +70,39 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, +@@ -70,31 +70,34 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, @@ -74,0 +76 @@ ++ } @@ -76,15 +78,5 @@ -- ret = otx2_cpt_hardware_caps_get(dev, vf->hw_caps); -- if (ret) { -- CPT_LOG_ERR("Could not determine hardware capabilities"); -- goto otx2_dev_fini; -+ ret = otx2_cpt_hardware_caps_get(dev, vf->hw_caps); -+ if (ret) { -+ CPT_LOG_ERR("Could not determine hardware capabilities"); -+ goto otx2_dev_fini; -+ } - } - - otx2_crypto_capabilities_init(vf->hw_caps); -@@ -121,10 +124,14 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, - RTE_CRYPTODEV_FF_SYM_SESSIONLESS | - RTE_CRYPTODEV_FF_SECURITY; + dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | + RTE_CRYPTODEV_FF_HW_ACCELERATED | +@@ -105,10 +108,14 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, + RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO | + RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT; @@ -105 +97 @@ -index 7b1b648639..febb4ee74d 100644 +index c0aa661b3b..17c0bee661 100644 @@ -108 +100 @@ -@@ -51,4 +51,6 @@ extern int otx2_cpt_logtype; +@@ -40,4 +40,6 @@ extern int otx2_cpt_logtype; @@ -116 +108 @@ -index 790af02dc6..be37d3cac1 100644 +index af4bbccd7d..292aff1928 100644 @@ -119 +111 @@ -@@ -1019,6 +1019,15 @@ otx2_cpt_dequeue_burst(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops) +@@ -813,6 +813,15 @@ otx2_cpt_dequeue_burst(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops) @@ -135,2 +127,2 @@ -@@ -1081,10 +1090,8 @@ otx2_cpt_dev_config(struct rte_cryptodev *dev, - goto intr_unregister; +@@ -862,10 +871,8 @@ otx2_cpt_dev_config(struct rte_cryptodev *dev, + goto queues_detach; @@ -146 +138 @@ - intr_unregister: + queues_detach: