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 2EB16455AD for ; Mon, 15 Jul 2024 17:27:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 29C3140A75; Mon, 15 Jul 2024 17:27:49 +0200 (CEST) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mails.dpdk.org (Postfix) with ESMTP id 2857C40A80 for ; Mon, 15 Jul 2024 17:27:48 +0200 (CEST) Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-52ea7bdde68so4799512e87.0 for ; Mon, 15 Jul 2024 08:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721057267; x=1721662067; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AxekdHbK9MH7denAthO39U8EkoOVeXJVzm07RVzXTl4=; b=iZ2laMD2orCTTCASI2y49RowtjsdG8wlAAMylvBVCzozKliIEY7Y0pDuLkI/kbVqtw jUFzztB8uZL8bnUPWJRQK1Tr6ML0PWcjBODbuEi4Qs2KvWs/gpUXPX0DDhZgNHsKh7xu ySZblzxPmZJY8rOd/orOyF43Dq6kzt7/2082M7xR4GBpop2L/417BhRxqJdI+be+QLdt d5iZ4s4jYnh0Sw5SBMA+olpmxCfhUtjJr+VhzMXvzzo5n65BD3A+WYXWu+rxy6rmadIB eYJq/n92EBEvzophI4fgvmScliE9qln3AiFZnvK7hJ3PEC1/Z92rthxp0xQgm3Z2zEHf fGDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721057267; x=1721662067; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AxekdHbK9MH7denAthO39U8EkoOVeXJVzm07RVzXTl4=; b=VsaZ+jEsTrK+l14D0vcCXP3cK2czAs2R9vxdxXO3rBSfcagNDcidGDTQK0egiTf+IP Pj9yXORFG4nDp2jZ0aTYwbzVq8oTogn+INb0iRoPPvgpRN9yGOEihmrYUtKJ8IMw2Qx8 zO3+cr5JMtpXdMrlAqpA38GtGs5yBZVJ1nG7CK6v0JERettC+tcOEhY1itdZr7Dsk+GG 6JFdbXCPFdVvqgTdjD6on07qwiaO2PXFpOTgvDpg/90zL6I6c+lDffN/uM1JHYw5HXHK qnhaoCyJ81Ph+GOCfPoQsKUeaCTEN5zcJQ8Cu9GxvRAuWcr1ZwLxpwRyQmsK8164ADNy ZtDQ== X-Forwarded-Encrypted: i=1; AJvYcCX+eTEhdmgacK4BWkSs9R1gCDqIuleJ0wmDrp7NvSGy5oEdKazcDtRYJANqNfiJLQwT4uiid8KFQp2Jv7fEao4= X-Gm-Message-State: AOJu0YzNw5Mv+qu0Pj/ycRq9x1Eh7MMIcJIHDWAPEffgWlzIbGfU/hBe gdx32kBCWuYYbXCaHV/gshODOlOlSr7kYNK7Uk8Bq18ITrtZycFm X-Google-Smtp-Source: AGHT+IEEgfDN0ByFcvy6/+ZQBiJvZcLDM39H0Zd1wwRjI/eDukwVjzirgMb0IAycWYxTim8AXi7nrQ== X-Received: by 2002:a05:6512:2208:b0:52c:9e25:978d with SMTP id 2adb3069b0e04-52eb99d169fmr14043938e87.45.1721057267548; Mon, 15 Jul 2024 08:27:47 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4279f25a957sm124876815e9.13.2024.07.15.08.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 08:27:46 -0700 (PDT) From: luca.boccassi@gmail.com To: Ganapati Kundapura Cc: Akhil Goyal , dpdk stable Subject: patch 'cryptodev: fix build without crypto callbacks' has been queued to stable release 22.11.6 Date: Mon, 15 Jul 2024 16:25:52 +0100 Message-Id: <20240715152704.2229503-14-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240715152704.2229503-1-luca.boccassi@gmail.com> References: <20240624235907.885628-81-luca.boccassi@gmail.com> <20240715152704.2229503-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 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 | 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@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;