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 E8B244326F for ; Thu, 2 Nov 2023 14:14:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2B3542DCE; Thu, 2 Nov 2023 14:14:06 +0100 (CET) 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 B794F42D80 for ; Thu, 2 Nov 2023 14:14:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698930845; 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=hMeJUAhNH+kLt1Uc7l6FO0h/MVrcdQGs7dH3E06tn7g=; b=G9NCXNGoIUXjYADKXyAoUjH5wBe/ClCsZxh9DOSo9swi6ztcpwl7xa1sGwbGqTGYYW3Ugy 7z9l45G7TdQd8AUTgIGkCd3wNgTo0zDt4NBEf+STpD/nxufZ2pGRgbvK9DS8dRyzgQv6yP 3RwXnyfUsv1DooYCZnfszlDOL0kysyg= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-oQMexN6pOO-tHz0QILD2RA-1; Thu, 02 Nov 2023 09:14:01 -0400 X-MC-Unique: oQMexN6pOO-tHz0QILD2RA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34ABC2806053; Thu, 2 Nov 2023 13:14:01 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 272DE492BFA; Thu, 2 Nov 2023 13:13:59 +0000 (UTC) From: Kevin Traynor To: Aakash Sasidharan Cc: Anoob Joseph , dpdk stable Subject: patch 'event/cnxk: fix return values for capability API' has been queued to stable release 21.11.6 Date: Thu, 2 Nov 2023 13:11:42 +0000 Message-ID: <20231102131254.315947-36-ktraynor@redhat.com> In-Reply-To: <20231102131254.315947-1-ktraynor@redhat.com> References: <20231102131254.315947-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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.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 11/08/23. 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/107d68ad4d5247be953193394b0d670b3bfbdc46 Thanks. Kevin --- >From 107d68ad4d5247be953193394b0d670b3bfbdc46 Mon Sep 17 00:00:00 2001 From: Aakash Sasidharan Date: Tue, 22 Aug 2023 18:46:47 +0530 Subject: [PATCH] event/cnxk: fix return values for capability API [ upstream commit bccb1d4f10e12c396058c06c3ba9e3565633390e ] When event_cnxk or crypto_cnxk PMDs are not available, return -ENOTSUP instead of -EINVAL. This would allow unit test to be skipped when the devices are not available. Fixes: 19f81cb59cb4 ("event/cnxk: add crypto adapter operations") Signed-off-by: Aakash Sasidharan Acked-by: Anoob Joseph --- drivers/event/cnxk/cn10k_eventdev.c | 12 ++++++------ drivers/event/cnxk/cn9k_eventdev.c | 16 ++++++++-------- drivers/event/cnxk/cnxk_eventdev.h | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c index 9e51fa2385..5fce6a22ac 100644 --- a/drivers/event/cnxk/cn10k_eventdev.c +++ b/drivers/event/cnxk/cn10k_eventdev.c @@ -749,6 +749,6 @@ cn10k_crypto_adapter_caps_get(const struct rte_eventdev *event_dev, const struct rte_cryptodev *cdev, uint32_t *caps) { - CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k"); - CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k"); + CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k", ENOTSUP); + CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k", ENOTSUP); *caps = RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD | @@ -768,6 +768,6 @@ cn10k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev, RTE_SET_USED(event); - CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k"); - CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k"); + CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k", EINVAL); + CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k", EINVAL); dev->is_ca_internal_port = 1; @@ -782,6 +782,6 @@ cn10k_crypto_adapter_qp_del(const struct rte_eventdev *event_dev, int32_t queue_pair_id) { - CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k"); - CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k"); + CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k", EINVAL); + CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k", EINVAL); return cnxk_crypto_adapter_qp_del(cdev, queue_pair_id); diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c index 73cf61670a..16075aab86 100644 --- a/drivers/event/cnxk/cn9k_eventdev.c +++ b/drivers/event/cnxk/cn9k_eventdev.c @@ -997,9 +997,9 @@ cn9k_sso_tx_adapter_queue_del(uint8_t id, const struct rte_eventdev *event_dev, static int -cn9k_crypto_adapter_caps_get(const struct rte_eventdev *event_dev, - const struct rte_cryptodev *cdev, uint32_t *caps) +cn9k_crypto_adapter_caps_get(const struct rte_eventdev *event_dev, const struct rte_cryptodev *cdev, + uint32_t *caps) { - CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k"); - CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k"); + CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k", ENOTSUP); + CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k", ENOTSUP); *caps = RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD | @@ -1018,6 +1018,6 @@ cn9k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev, RTE_SET_USED(event); - CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k"); - CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k"); + CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k", EINVAL); + CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k", EINVAL); dev->is_ca_internal_port = 1; @@ -1032,6 +1032,6 @@ cn9k_crypto_adapter_qp_del(const struct rte_eventdev *event_dev, int32_t queue_pair_id) { - CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k"); - CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k"); + CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k", EINVAL); + CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k", EINVAL); return cnxk_crypto_adapter_qp_del(cdev, queue_pair_id); diff --git a/drivers/event/cnxk/cnxk_eventdev.h b/drivers/event/cnxk/cnxk_eventdev.h index 981a2efc5f..9cd1d37010 100644 --- a/drivers/event/cnxk/cnxk_eventdev.h +++ b/drivers/event/cnxk/cnxk_eventdev.h @@ -55,8 +55,8 @@ #define CN10K_GW_MODE_PREF_WFE 2 -#define CNXK_VALID_DEV_OR_ERR_RET(dev, drv_name) \ +#define CNXK_VALID_DEV_OR_ERR_RET(dev, drv_name, err_val) \ do { \ if (strncmp(dev->driver->name, drv_name, strlen(drv_name))) \ - return -EINVAL; \ + return -err_val; \ } while (0) -- 2.41.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-02 13:09:41.743304416 +0000 +++ 0036-event-cnxk-fix-return-values-for-capability-API.patch 2023-11-02 13:09:40.836163409 +0000 @@ -1 +1 @@ -From bccb1d4f10e12c396058c06c3ba9e3565633390e Mon Sep 17 00:00:00 2001 +From 107d68ad4d5247be953193394b0d670b3bfbdc46 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit bccb1d4f10e12c396058c06c3ba9e3565633390e ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -17 +18 @@ - drivers/event/cnxk/cn10k_eventdev.c | 16 ++++++++-------- + drivers/event/cnxk/cn10k_eventdev.c | 12 ++++++------ @@ -20 +21 @@ - 3 files changed, 18 insertions(+), 18 deletions(-) + 3 files changed, 16 insertions(+), 16 deletions(-) @@ -23 +24 @@ -index 499a3aace7..c5d4be0474 100644 +index 9e51fa2385..5fce6a22ac 100644 @@ -26 +27 @@ -@@ -912,6 +912,6 @@ cn10k_crypto_adapter_caps_get(const struct rte_eventdev *event_dev, +@@ -749,6 +749,6 @@ cn10k_crypto_adapter_caps_get(const struct rte_eventdev *event_dev, @@ -35,2 +36,2 @@ -@@ -930,6 +930,6 @@ cn10k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev, - int ret; +@@ -768,6 +768,6 @@ cn10k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev, + RTE_SET_USED(event); @@ -43,2 +44,2 @@ - cn10k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev); -@@ -945,6 +945,6 @@ cn10k_crypto_adapter_qp_del(const struct rte_eventdev *event_dev, const struct r + dev->is_ca_internal_port = 1; +@@ -782,6 +782,6 @@ cn10k_crypto_adapter_qp_del(const struct rte_eventdev *event_dev, @@ -53,9 +53,0 @@ -@@ -964,6 +964,6 @@ cn10k_crypto_adapter_vec_limits(const struct rte_eventdev *event_dev, - struct rte_event_crypto_adapter_vector_limits *limits) - { -- CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k"); -- CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k"); -+ CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k", EINVAL); -+ CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k", EINVAL); - - limits->log2_sz = false; @@ -63 +55 @@ -index 6cce5477f0..f77a9d7085 100644 +index 73cf61670a..16075aab86 100644 @@ -66 +58 @@ -@@ -943,9 +943,9 @@ cn9k_sso_tx_adapter_queue_del(uint8_t id, const struct rte_eventdev *event_dev, +@@ -997,9 +997,9 @@ cn9k_sso_tx_adapter_queue_del(uint8_t id, const struct rte_eventdev *event_dev, @@ -80,2 +72,2 @@ -@@ -963,6 +963,6 @@ cn9k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev, - int ret; +@@ -1018,6 +1018,6 @@ cn9k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev, + RTE_SET_USED(event); @@ -88,2 +80,2 @@ - cn9k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev); -@@ -978,6 +978,6 @@ cn9k_crypto_adapter_qp_del(const struct rte_eventdev *event_dev, const struct rt + dev->is_ca_internal_port = 1; +@@ -1032,6 +1032,6 @@ cn9k_crypto_adapter_qp_del(const struct rte_eventdev *event_dev, @@ -99 +91 @@ -index 9d95092669..bd50de87c0 100644 +index 981a2efc5f..9cd1d37010 100644 @@ -102,2 +94,2 @@ -@@ -49,8 +49,8 @@ - #define CNXK_SSO_FLUSH_RETRY_MAX 0xfff +@@ -55,8 +55,8 @@ + #define CN10K_GW_MODE_PREF_WFE 2