From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8E69145804 for ; Fri, 23 Aug 2024 18:21:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8816C4337C; Fri, 23 Aug 2024 18:21:57 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B9FA5402BE for ; Fri, 23 Aug 2024 18:21:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724430116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=63E04DSwJq13GPxUhfJAvuOWvQpAm8tgznz/CA7mVDs=; b=OjRwKP9JB4Lb7NJz6G8EXH6SrF+wZzAw6QGRm2xkXE+F0VDh7eY0Vij5Tzky/mfPbal7u7 dKiNfvw1pmIMZimgToTnpHEzW92RN4AncPfR6mDyUvXQJ8xIDqMmr+KvhoadQzbMkmt8+V qC8dcnHPTWHjAGMlSOKULy4nWOYJ39I= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-32-FKESQ2SoO4Spugr0AuxhLw-1; Fri, 23 Aug 2024 12:21:52 -0400 X-MC-Unique: FKESQ2SoO4Spugr0AuxhLw-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CC41119560BF; Fri, 23 Aug 2024 16:21:51 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.193.224]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 54AAD1955F44; Fri, 23 Aug 2024 16:21:50 +0000 (UTC) From: Kevin Traynor To: Ganapati Kundapura Cc: Akhil Goyal , dpdk stable Subject: patch 'cryptodev: fix build without crypto callbacks' has been queued to stable release 21.11.8 Date: Fri, 23 Aug 2024 17:18:10 +0100 Message-ID: <20240823161929.1004778-62-ktraynor@redhat.com> In-Reply-To: <20240823161929.1004778-1-ktraynor@redhat.com> References: <20240823161929.1004778-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 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 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 Acked-by: Akhil Goyal --- 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 +#include #include #include @@ -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@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 ++#include + #include + #include +@@ -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;