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 91BEA43C60 for ; Thu, 7 Mar 2024 02:36:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8BE7A42F01; Thu, 7 Mar 2024 02:36:56 +0100 (CET) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mails.dpdk.org (Postfix) with ESMTP id F369842E64 for ; Thu, 7 Mar 2024 02:36:54 +0100 (CET) Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-33e122c8598so150715f8f.1 for ; Wed, 06 Mar 2024 17:36:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709775414; x=1710380214; 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=XhQ6HN8Dc5OXzrglTAsQZfNkbAaGvgz9d8EqcjNYLkk=; b=Y0RSmrTJPbteHQdhZVuzM8Xm1EVdTa8gaTm+L3vPk1KNv150vqL9beg/YSCnFiLdod N/rwnLU+eUcLLWGVicZ/52fF6u6+5j/rahrW1anJRIBMIuKsUSCvIglpyPZHxgL3oXJq lfAzhGxZbDxNqzk9PnaSUUep5o6neA+C/0t0PbQCR1UKRFlFbQUSel1F90SqSWk9Pbi0 VkK2shlgmwIhptWR7ubh3UqYx7TcHbZ/s1rLzL7FEPZZoW5Y0eUI4rF9Mgqcf5V6zUEU K3o1Zkp8ZXrJCun5M8NMM7QQhaqRdrjXkyvedMdpQCEYWV+jGK0MYNbu67zk0+RIwYMg snjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775414; x=1710380214; 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=XhQ6HN8Dc5OXzrglTAsQZfNkbAaGvgz9d8EqcjNYLkk=; b=UbOIbyrdD7cihNBZaRdf7QAHQJUqLqFcqOpiUqheptEoxXHYFlBX3REnyzZRcrP7KN HE2jcfB6rY988Il11VP3krp49vuXgNoeps8dNjM5T89wODu65DYvvdBECNj1sXGTwNDa j2xeIu6a3xJn/6ErKwQHadXomUOAwugmFlHm2Og+Dg8IBmtEjKRK9kzkPADF1aVQHW8O 2ySAs2L23Zl86y8sjmwFaitrs7wWAuAAsaxG7oFVy/KOydirpEsbCQk2LYCPAKFh+Pr8 Injk/NImbuBc3NJMxqPQ07C0Mey3H2sNz5GiUbN4vFuWzIHVerxTTTNnO6N05b5WkdG1 z7rQ== X-Forwarded-Encrypted: i=1; AJvYcCWzbXINj5II5/lHc3Rry7kKLT/D/cPsETSkCSWbztVoJmU93RVvcCk/kADzVnSjs7fdvOhZNcfQ4LfQ9XwK5Oc= X-Gm-Message-State: AOJu0YymqMw4Nfh+B0zPJXbQjZsyWjrjGDSa53fpXnsMsP/7o29IHHOB FxJupjozBK3XAOMCT4n3Q1A0Ip7QWoWCP+Szz/93nrH2KZ//Vt/0 X-Google-Smtp-Source: AGHT+IHLNrKMMGXTibKGZBHyret9vHU3bpZVmw7MrrWK6pQnO3rzgbssB12hwTrHGphy3btUmW0Igw== X-Received: by 2002:a5d:658a:0:b0:33c:dd02:f652 with SMTP id q10-20020a5d658a000000b0033cdd02f652mr11769430wru.10.1709775414436; Wed, 06 Mar 2024 17:36:54 -0800 (PST) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id dp14-20020a0560000c8e00b0033d8ce120f2sm18857069wrb.95.2024.03.06.17.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:36:54 -0800 (PST) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= , Andrew Rybchenko , dpdk stable Subject: patch 'common/sfc_efx/base: use C11 static assert' has been queued to stable release 22.11.5 Date: Thu, 7 Mar 2024 01:31:38 +0000 Message-Id: <20240307013159.1735343-81-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307013159.1735343-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/09/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/f90918d9f4499d978068367106b55f01e829ee03 Thanks. Luca Boccassi --- >From f90918d9f4499d978068367106b55f01e829ee03 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sun, 11 Feb 2024 21:48:59 -0800 Subject: [PATCH] common/sfc_efx/base: use C11 static assert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 047d7032b76a226f2f1c36775688950933f9121b ] The sfc base code had its own definition of static assertions using the out of bound array access hack. Replace it with a static_assert like rte_common.h. The use of null pointer to compute offset is not always a constant in older versions of clang. Use standard offsetof() instead. Fixes: f67e4719147d ("net/sfc/base: fix coding style") Signed-off-by: Stephen Hemminger Reviewed-by: Morten Brørup Acked-by: Andrew Rybchenko --- drivers/common/sfc_efx/base/efx.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index 49e29dcc1c..6f9cbe7311 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -7,6 +7,8 @@ #ifndef _SYS_EFX_H #define _SYS_EFX_H +#include + #include "efx_annote.h" #include "efsys.h" #include "efx_types.h" @@ -17,14 +19,20 @@ extern "C" { #endif -#define EFX_STATIC_ASSERT(_cond) \ - ((void)sizeof (char[(_cond) ? 1 : -1])) +/* + * Triggers an error at compilation time if the condition is false. + * + * The { } exists to workaround a bug in clang (#55821) + * where it would not handle _Static_assert in a switch case. + */ +#define EFX_STATIC_ASSERT(_cond) \ + { static_assert((_cond), #_cond); } #define EFX_ARRAY_SIZE(_array) \ (sizeof (_array) / sizeof ((_array)[0])) #define EFX_FIELD_OFFSET(_type, _field) \ - ((size_t)&(((_type *)0)->_field)) + offsetof(_type, _field) /* The macro expands divider twice */ #define EFX_DIV_ROUND_UP(_n, _d) (((_n) + (_d) - 1) / (_d)) -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-07 01:05:41.637947505 +0000 +++ 0081-common-sfc_efx-base-use-C11-static-assert.patch 2024-03-07 01:05:34.938942988 +0000 @@ -1 +1 @@ -From 047d7032b76a226f2f1c36775688950933f9121b Mon Sep 17 00:00:00 2001 +From f90918d9f4499d978068367106b55f01e829ee03 Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit 047d7032b76a226f2f1c36775688950933f9121b ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index 3312c2fa8f..5773cb00b3 100644 +index 49e29dcc1c..6f9cbe7311 100644