patch 'cryptodev: fix build without crypto callbacks' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Mon Aug 12 14:48:19 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/14/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=578ee207209f1b321f12d59104fc9c273374ccee
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 578ee207209f1b321f12d59104fc9c273374ccee Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura at intel.com>
Date: Thu, 27 Jun 2024 05:06:25 -0500
Subject: [PATCH] cryptodev: fix build without crypto callbacks
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit cfa443351ef581b7189467842ca102ab710cb7d2 ]
Crypto callbacks APIs are available in header files but when
the macro RTE_CRYPTO_CALLBACKS unset, test application need to
put #ifdef in its code.
The test application should be able to build and run, regardless
DPDK library is built with RTE_CRYPTO_CALLBACKS defined or not.
Added ENOTSUP from the beginning of the APIs implementation
if RTE_CRYPTO_CALLBACKS macro is unset/undefined.
Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks")
Fixes: 5523a75af539 ("test/crypto: add case for enqueue/dequeue callbacks")
Signed-off-by: Ganapati Kundapura <ganapati.kundapura at intel.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
app/test/test_cryptodev.c | 12 ++++++++++++
lib/cryptodev/rte_cryptodev.c | 14 ++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 3464df22a1..c3e4737bf9 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -13663,6 +13663,12 @@ test_enq_callback_setup(void)
/* Test with invalid crypto device */
cb = rte_cryptodev_add_enq_callback(RTE_CRYPTO_MAX_DEVS,
qp_id, test_enq_callback, NULL);
+ if (rte_errno == ENOTSUP) {
+ RTE_LOG(ERR, USER1, "%s line %d: "
+ "rte_cryptodev_add_enq_callback() "
+ "Not supported, skipped\n", __func__, __LINE__);
+ return TEST_SKIPPED;
+ }
TEST_ASSERT_NULL(cb, "Add callback on qp %u on "
"cryptodev %u did not fail",
qp_id, RTE_CRYPTO_MAX_DEVS);
@@ -13778,6 +13784,12 @@ test_deq_callback_setup(void)
/* Test with invalid crypto device */
cb = rte_cryptodev_add_deq_callback(RTE_CRYPTO_MAX_DEVS,
qp_id, test_deq_callback, NULL);
+ if (rte_errno == ENOTSUP) {
+ RTE_LOG(ERR, USER1, "%s line %d: "
+ "rte_cryptodev_add_deq_callback() "
+ "Not supported, skipped\n", __func__, __LINE__);
+ return TEST_SKIPPED;
+ }
TEST_ASSERT_NULL(cb, "Add callback on qp %u on "
"cryptodev %u did not fail",
qp_id, RTE_CRYPTO_MAX_DEVS);
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index a3a8fc9c07..c5eb4ecb01 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1489,6 +1489,10 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
rte_cryptodev_callback_fn cb_fn,
void *cb_arg)
{
+#ifndef RTE_CRYPTO_CALLBACKS
+ rte_errno = ENOTSUP;
+ return NULL;
+#endif
struct rte_cryptodev *dev;
struct rte_cryptodev_cb_rcu *list;
struct rte_cryptodev_cb *cb, *tail;
@@ -1554,6 +1558,9 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
uint16_t qp_id,
struct rte_cryptodev_cb *cb)
{
+#ifndef RTE_CRYPTO_CALLBACKS
+ return -ENOTSUP;
+#endif
struct rte_cryptodev *dev;
RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb;
struct rte_cryptodev_cb *curr_cb;
@@ -1628,6 +1635,10 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
rte_cryptodev_callback_fn cb_fn,
void *cb_arg)
{
+#ifndef RTE_CRYPTO_CALLBACKS
+ rte_errno = ENOTSUP;
+ return NULL;
+#endif
struct rte_cryptodev *dev;
struct rte_cryptodev_cb_rcu *list;
struct rte_cryptodev_cb *cb, *tail;
@@ -1694,6 +1705,9 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
uint16_t qp_id,
struct rte_cryptodev_cb *cb)
{
+#ifndef RTE_CRYPTO_CALLBACKS
+ return -ENOTSUP;
+#endif
struct rte_cryptodev *dev;
RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb;
struct rte_cryptodev_cb *curr_cb;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-08-12 20:44:03.304583637 +0800
+++ 0022-cryptodev-fix-build-without-crypto-callbacks.patch 2024-08-12 20:44:01.945069265 +0800
@@ -1 +1 @@
-From cfa443351ef581b7189467842ca102ab710cb7d2 Mon Sep 17 00:00:00 2001
+From 578ee207209f1b321f12d59104fc9c273374ccee Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit cfa443351ef581b7189467842ca102ab710cb7d2 ]
@@ -18 +20,0 @@
-Cc: stable at dpdk.org
@@ -28 +30 @@
-index 75f98b6744..6042db36a4 100644
+index 3464df22a1..c3e4737bf9 100644
@@ -31 +33 @@
-@@ -14920,6 +14920,12 @@ test_enq_callback_setup(void)
+@@ -13663,6 +13663,12 @@ test_enq_callback_setup(void)
@@ -44 +46 @@
-@@ -15035,6 +15041,12 @@ test_deq_callback_setup(void)
+@@ -13778,6 +13784,12 @@ test_deq_callback_setup(void)
@@ -58 +60 @@
-index 886eb7adc4..682c9f49d0 100644
+index a3a8fc9c07..c5eb4ecb01 100644
@@ -61 +63 @@
-@@ -1491,6 +1491,10 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
+@@ -1489,6 +1489,10 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
@@ -72 +74 @@
-@@ -1556,6 +1560,9 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
+@@ -1554,6 +1558,9 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
@@ -82 +84 @@
-@@ -1630,6 +1637,10 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
+@@ -1628,6 +1635,10 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
@@ -93 +95 @@
-@@ -1696,6 +1707,9 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
+@@ -1694,6 +1705,9 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
More information about the stable
mailing list