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 9CC5D43829 for ; Tue, 5 Mar 2024 16:36:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 978EE415D7; Tue, 5 Mar 2024 16:36:12 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id AFCB6410D3 for ; Tue, 5 Mar 2024 16:36:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709652969; 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=jYvlPHLqDTwut6BsvdNqYWrSxRssO/DCy8sa8nYIWag=; b=TqiiLoyV+NvsdUwHir52pVnUuTSEeJEqEpEUoN/7TUJa6XKSHpob72x4BZhAsh/rmFgi/3 7S/n3E0nsRfxdTFmmfi6q4Z2BxmY8KD9Ck70+2zAnaz1pcar40ozOQtXCiXNihVHZATpb/ eTiiVTnGRcWDTg64i+fNIodalJ1xeX8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-487-FdSKDWHNN2eKEMs3u5R2ww-1; Tue, 05 Mar 2024 10:36:07 -0500 X-MC-Unique: FdSKDWHNN2eKEMs3u5R2ww-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 DB548101CC6F; Tue, 5 Mar 2024 15:36:06 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.194.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 31C1C200AE7F; Tue, 5 Mar 2024 15:36:05 +0000 (UTC) From: Kevin Traynor 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 21.11.7 Date: Tue, 5 Mar 2024 15:34:27 +0000 Message-ID: <20240305153449.263666-54-ktraynor@redhat.com> In-Reply-To: <20240305153449.263666-1-ktraynor@redhat.com> References: <20240305153449.263666-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 21.11.7 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/11/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/82aea5d9b46d7bb62c4b18e9a91033a1583287ea Thanks. Kevin --- >From 82aea5d9b46d7bb62c4b18e9a91033a1583287ea 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 398eb8dbd2..74fcd06583 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -8,4 +8,6 @@ #define _SYS_EFX_H +#include + #include "efx_annote.h" #include "efsys.h" @@ -18,6 +20,12 @@ 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) \ @@ -25,5 +33,5 @@ extern "C" { #define EFX_FIELD_OFFSET(_type, _field) \ - ((size_t)&(((_type *)0)->_field)) + offsetof(_type, _field) /* The macro expands divider twice */ -- 2.43.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 14:08:55.932739434 +0000 +++ 0054-common-sfc_efx-base-use-C11-static-assert.patch 2024-03-05 14:08:54.695520884 +0000 @@ -1 +1 @@ -From 047d7032b76a226f2f1c36775688950933f9121b Mon Sep 17 00:00:00 2001 +From 82aea5d9b46d7bb62c4b18e9a91033a1583287ea 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 398eb8dbd2..74fcd06583 100644