From patchwork Tue Feb 13 19:12:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 136676 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2487143B10; Tue, 13 Feb 2024 20:12:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B463142EBD; Tue, 13 Feb 2024 20:12:12 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 7F88842E60 for ; Tue, 13 Feb 2024 20:12:09 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id C027620B2000; Tue, 13 Feb 2024 11:12:04 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C027620B2000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707851524; bh=FofmWeAdpyWvU8Gi3NrtHrBMbCmS13jPE8YdrRPF+yM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sbJix0jHZowlguMZLZtFSicrVGYEFUbuvzVhND7ypDVBaPYST1nUxXy+n2FgmWgi1 t1U5gJRrKCxaxyuEROg9YNO6QxMbqLbUuw4AccKumAOVIO/2KOcfGagMYX9y0tYD77 Bgikj4WeR5RdeQxIyS5aYj0zGAReoD5LVK3IjYCo= From: Tyler Retzlaff To: dev@dpdk.org Cc: Kai Ji , Pablo de Lara , bruce.richardson@intel.com, david.marchand@redhat.com, Tyler Retzlaff Subject: [PATCH v3 1/3] eal: provide type to per lcore macro Date: Tue, 13 Feb 2024 11:12:01 -0800 Message-Id: <1707851523-27998-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707851523-27998-1-git-send-email-roretzla@linux.microsoft.com> References: <1703006864-27378-1-git-send-email-roretzla@linux.microsoft.com> <1707851523-27998-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Adjust the use of per lcore macro to provide type as the first argument as to not require __typeof__ during expansion. Signed-off-by: Tyler Retzlaff Acked-by: Bruce Richardson --- lib/eal/common/eal_common_errno.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c index b30e2f0..fff8c1f 100644 --- a/lib/eal/common/eal_common_errno.c +++ b/lib/eal/common/eal_common_errno.c @@ -28,7 +28,7 @@ static const char *sep = ""; #endif #define RETVAL_SZ 256 - static RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval); + static RTE_DEFINE_PER_LCORE(char, retval[RETVAL_SZ]); char *ret = RTE_PER_LCORE(retval); /* since some implementations of strerror_r throw an error From patchwork Tue Feb 13 19:12:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 136674 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E4DC643B10; Tue, 13 Feb 2024 20:12:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93B3342E58; Tue, 13 Feb 2024 20:12:10 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 5B81742E58 for ; Tue, 13 Feb 2024 20:12:09 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id CD73420B2001; Tue, 13 Feb 2024 11:12:04 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com CD73420B2001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707851524; bh=kyC4jqc2FhtlhdYHpBq5IbGm+wK6q0vnwJpWZG8hAJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IaiBo5YrrTqBpzOOyOApbqztePBZVvhkHa7Y8d5QyzNbBeswMBtHF38EzJSdlBDPW d5IcqHemb2FYbkJJU+lo2a10Evn5sfYjHY58+jazkwmrVAnn2oBbd5qKnGKSkTHgwo Iqp159bso4JRZRIxTvXeaV7VzCWHtYN9VpZvUKck= From: Tyler Retzlaff To: dev@dpdk.org Cc: Kai Ji , Pablo de Lara , bruce.richardson@intel.com, david.marchand@redhat.com, Tyler Retzlaff Subject: [PATCH v3 2/3] crypto/ipsec_mb: provide type to per lcore macro Date: Tue, 13 Feb 2024 11:12:02 -0800 Message-Id: <1707851523-27998-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707851523-27998-1-git-send-email-roretzla@linux.microsoft.com> References: <1703006864-27378-1-git-send-email-roretzla@linux.microsoft.com> <1707851523-27998-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Adjust the use of per lcore macro to provide type as the first argument as to not require __typeof__ during expansion. Signed-off-by: Tyler Retzlaff Acked-by: Bruce Richardson --- drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h index 55a0416..8a5a41f 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h +++ b/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h @@ -130,7 +130,7 @@ struct aesni_gcm_ops { aesni_gmac_finalize_t gmac_finalize; }; -RTE_DEFINE_PER_LCORE(struct aesni_gcm_ops[GCM_NUM_KEY_TYPES], gcm_ops); +RTE_DEFINE_PER_LCORE(struct aesni_gcm_ops, gcm_ops[GCM_NUM_KEY_TYPES]); struct aesni_gcm_qp_data { struct gcm_context_data gcm_ctx_data; From patchwork Tue Feb 13 19:12:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 136675 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6C5C343B10; Tue, 13 Feb 2024 20:12:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B74A742E6E; Tue, 13 Feb 2024 20:12:11 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 6781B42E5A for ; Tue, 13 Feb 2024 20:12:09 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id DA9B620B2002; Tue, 13 Feb 2024 11:12:04 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DA9B620B2002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707851524; bh=Iz5HRFyCTR3CEETW+aHgYtbhBrH0QX2kGZlsc2waMfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PlzNcAo6AmTFY1rwNzvg6es3KXEJVBMUSMWqlzo4TAVPYh/N3OVpjgATiGOjyLFNY rcjXA4EQZlOhwQwT9XmtnFIVrsNc45mtw/fhfqYJzn2KOJfezdNI5NjYRUVcONxGol aWf6rUoCVtssTRks6shqfi246bkkPugncaCsUETI= From: Tyler Retzlaff To: dev@dpdk.org Cc: Kai Ji , Pablo de Lara , bruce.richardson@intel.com, david.marchand@redhat.com, Tyler Retzlaff Subject: [PATCH v3 3/3] eal: remove typeof from per lcore macros Date: Tue, 13 Feb 2024 11:12:03 -0800 Message-Id: <1707851523-27998-4-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707851523-27998-1-git-send-email-roretzla@linux.microsoft.com> References: <1703006864-27378-1-git-send-email-roretzla@linux.microsoft.com> <1707851523-27998-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The design of the macros requires a type to be provided to the macro. By expanding the type parameter inside of typeof it also inadvertently allows an expression to be used which appears not to have been intended after evaluating the parameter name and existing macro use. Technically this is an API break but only for applications that were using these macros outside of the original design intent. Signed-off-by: Tyler Retzlaff Acked-by: Bruce Richardson --- doc/guides/rel_notes/release_24_03.rst | 5 +++++ lib/eal/include/rte_per_lcore.h | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst index 6741947..39088da 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -89,6 +89,11 @@ API Changes Also, make sure to start the actual text at the margin. ======================================================= +* eal: Removed ``typeof(type)`` from the expansion of ``RTE_DEFINE_PER_LCORE`` + and ``RTE_DECLARE_PER_LCORE`` macros aligning them with their intended design. + If use with an expression is desired applications can adapt by supplying + ``typeof(e)`` as an argument. + * gso: ``rte_gso_segment`` now returns -ENOTSUP for unknown protocols. diff --git a/lib/eal/include/rte_per_lcore.h b/lib/eal/include/rte_per_lcore.h index 41fe1f0..529995e 100644 --- a/lib/eal/include/rte_per_lcore.h +++ b/lib/eal/include/rte_per_lcore.h @@ -24,10 +24,10 @@ #ifdef RTE_TOOLCHAIN_MSVC #define RTE_DEFINE_PER_LCORE(type, name) \ - __declspec(thread) typeof(type) per_lcore_##name + __declspec(thread) type per_lcore_##name #define RTE_DECLARE_PER_LCORE(type, name) \ - extern __declspec(thread) typeof(type) per_lcore_##name + extern __declspec(thread) type per_lcore_##name #else /** * Macro to define a per lcore variable "var" of type "type", don't @@ -35,13 +35,13 @@ * whole macro. */ #define RTE_DEFINE_PER_LCORE(type, name) \ - __thread __typeof__(type) per_lcore_##name + __thread type per_lcore_##name /** * Macro to declare an extern per lcore variable "var" of type "type" */ #define RTE_DECLARE_PER_LCORE(type, name) \ - extern __thread __typeof__(type) per_lcore_##name + extern __thread type per_lcore_##name #endif /**