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

Kevin Traynor ktraynor at redhat.com
Fri Aug 23 18:18:10 CEST 2024


Hi,

FYI, your patch has been queued to stable release 21.11.8

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/28/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/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
>From a27e346a93f826a8f340ac70e495785837e37651 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     | 13 +++++++++++++
 lib/cryptodev/rte_cryptodev.c | 14 ++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 0bd4517bf8..0dd0b4450a 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -7,4 +7,5 @@
 
 #include <rte_common.h>
+#include <rte_errno.h>
 #include <rte_hexdump.h>
 #include <rte_mbuf.h>
@@ -11831,4 +11832,10 @@ test_enq_callback_setup(void)
 	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",
@@ -11931,4 +11938,10 @@ test_deq_callback_setup(void)
 	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",
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 00fdd18630..f4eb6d7d04 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1270,4 +1270,8 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
 			       void *cb_arg)
 {
+#ifndef RTE_CRYPTO_CALLBACKS
+	rte_errno = ENOTSUP;
+	return NULL;
+#endif
 	struct rte_cryptodev *dev;
 	struct rte_cryptodev_cb_rcu *list;
@@ -1334,4 +1338,7 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_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;
@@ -1405,4 +1412,8 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
 			       void *cb_arg)
 {
+#ifndef RTE_CRYPTO_CALLBACKS
+	rte_errno = ENOTSUP;
+	return NULL;
+#endif
 	struct rte_cryptodev *dev;
 	struct rte_cryptodev_cb_rcu *list;
@@ -1469,4 +1480,7 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_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;
-- 
2.46.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-08-23 17:18:11.693815818 +0100
+++ 0062-cryptodev-fix-build-without-crypto-callbacks.patch	2024-08-23 17:18:09.734430154 +0100
@@ -1 +1 @@
-From cfa443351ef581b7189467842ca102ab710cb7d2 Mon Sep 17 00:00:00 2001
+From a27e346a93f826a8f340ac70e495785837e37651 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cfa443351ef581b7189467842ca102ab710cb7d2 ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
- app/test/test_cryptodev.c     | 12 ++++++++++++
+ app/test/test_cryptodev.c     | 13 +++++++++++++
@@ -25 +26 @@
- 2 files changed, 26 insertions(+)
+ 2 files changed, 27 insertions(+)
@@ -28 +29 @@
-index 75f98b6744..6042db36a4 100644
+index 0bd4517bf8..0dd0b4450a 100644
@@ -31 +32,7 @@
-@@ -14921,4 +14921,10 @@ test_enq_callback_setup(void)
+@@ -7,4 +7,5 @@
+ 
+ #include <rte_common.h>
++#include <rte_errno.h>
+ #include <rte_hexdump.h>
+ #include <rte_mbuf.h>
+@@ -11831,4 +11832,10 @@ test_enq_callback_setup(void)
@@ -42 +49 @@
-@@ -15036,4 +15042,10 @@ test_deq_callback_setup(void)
+@@ -11931,4 +11938,10 @@ test_deq_callback_setup(void)
@@ -54 +61 @@
-index 886eb7adc4..682c9f49d0 100644
+index 00fdd18630..f4eb6d7d04 100644
@@ -57 +64 @@
-@@ -1492,4 +1492,8 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
+@@ -1270,4 +1270,8 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
@@ -66 +73 @@
-@@ -1557,4 +1561,7 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
+@@ -1334,4 +1338,7 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
@@ -73,2 +80,2 @@
- 	RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb;
-@@ -1631,4 +1638,8 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
+ 	struct rte_cryptodev_cb **prev_cb, *curr_cb;
+@@ -1405,4 +1412,8 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
@@ -83 +90 @@
-@@ -1697,4 +1708,7 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
+@@ -1469,4 +1480,7 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
@@ -90 +97 @@
- 	RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb;
+ 	struct rte_cryptodev_cb **prev_cb, *curr_cb;



More information about the stable mailing list