patch 'cryptodev: fix build without crypto callbacks' has been queued to stable release 22.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 15 17:25:52 CEST 2024


Hi,

FYI, your patch has been queued to stable release 22.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 07/17/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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ff0ffd5338b388ba7f4a362a16872a6ec2c1c2e7

Thanks.

Luca Boccassi

---
>From ff0ffd5338b388ba7f4a362a16872a6ec2c1c2e7 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

[ 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 96cd9ef7dc..68c82771a1 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -12730,6 +12730,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);
@@ -12845,6 +12851,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 d2b7e1c4cb..6c11881ab8 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1407,6 +1407,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;
@@ -1472,6 +1476,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;
 	struct rte_cryptodev_cb **prev_cb, *curr_cb;
 	struct rte_cryptodev_cb_rcu *list;
@@ -1545,6 +1552,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;
@@ -1611,6 +1622,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;
 	struct rte_cryptodev_cb **prev_cb, *curr_cb;
 	struct rte_cryptodev_cb_rcu *list;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:35.512563961 +0100
+++ 0014-cryptodev-fix-build-without-crypto-callbacks.patch	2024-07-15 16:19:34.472204413 +0100
@@ -1 +1 @@
-From cfa443351ef581b7189467842ca102ab710cb7d2 Mon Sep 17 00:00:00 2001
+From ff0ffd5338b388ba7f4a362a16872a6ec2c1c2e7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cfa443351ef581b7189467842ca102ab710cb7d2 ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index 75f98b6744..6042db36a4 100644
+index 96cd9ef7dc..68c82771a1 100644
@@ -31 +32 @@
-@@ -14920,6 +14920,12 @@ test_enq_callback_setup(void)
+@@ -12730,6 +12730,12 @@ test_enq_callback_setup(void)
@@ -44 +45 @@
-@@ -15035,6 +15041,12 @@ test_deq_callback_setup(void)
+@@ -12845,6 +12851,12 @@ test_deq_callback_setup(void)
@@ -58 +59 @@
-index 886eb7adc4..682c9f49d0 100644
+index d2b7e1c4cb..6c11881ab8 100644
@@ -61 +62 @@
-@@ -1491,6 +1491,10 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
+@@ -1407,6 +1407,10 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
@@ -72 +73 @@
-@@ -1556,6 +1560,9 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
+@@ -1472,6 +1476,9 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
@@ -80,3 +81,3 @@
- 	RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb;
- 	struct rte_cryptodev_cb *curr_cb;
-@@ -1630,6 +1637,10 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
+ 	struct rte_cryptodev_cb **prev_cb, *curr_cb;
+ 	struct rte_cryptodev_cb_rcu *list;
+@@ -1545,6 +1552,10 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
@@ -93 +94 @@
-@@ -1696,6 +1707,9 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
+@@ -1611,6 +1622,9 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
@@ -101,2 +102,2 @@
- 	RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb;
- 	struct rte_cryptodev_cb *curr_cb;
+ 	struct rte_cryptodev_cb **prev_cb, *curr_cb;
+ 	struct rte_cryptodev_cb_rcu *list;


More information about the stable mailing list