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 3890042671; Fri, 29 Sep 2023 11:02:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C8642402DE; Fri, 29 Sep 2023 11:02:57 +0200 (CEST) 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 458FC402DE for ; Fri, 29 Sep 2023 11:02:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695978175; 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=OBb1ppJHiqR9cbXYe4nSn/dJEDu2agIvrhQraVgDz5w=; b=C0XRyXJ2xxvEF9lcYvAzEHHknBu1DBhfleTLW7CRDFuzZ1ZaV8t4xcNR/vaIN/EhPONFgL VVmlJq6G1XYhUaAYxqUDdWko/ahn/ljaaGaVZmTpvArt8CsezWAywPUEtpMj1vE7ytmDz1 BkvrjQoQcVVqhV4wNFECjNW3Jmj6IN4= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-218-tsbPnqgvMUS98lr0i-gsDA-1; Fri, 29 Sep 2023 05:02:52 -0400 X-MC-Unique: tsbPnqgvMUS98lr0i-gsDA-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2b710c5677eso207544721fa.0 for ; Fri, 29 Sep 2023 02:02:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695978170; x=1696582970; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OBb1ppJHiqR9cbXYe4nSn/dJEDu2agIvrhQraVgDz5w=; b=siwOQ70/7TzukXLN2lzRAmb8Y3Wu0Gh+upTDSA/z4dMJhFr4qpBAZ2NNYSU5uyqO7v 7WHbKr9yD45nmnoBsX5P+nr532tyqCgR9HFBJ+fq1KJSGM9WhrR69MJ3eLjQer6RybeM oFLcR2NB5dzJ3aGu+MwwLvokOom0aBo8rRTgPLi2E1YOkbB97II7t7EkzlImOYz712yF kXf6x2Ap5QUmX8in2NBPg0Pl5B0c8MflMJ9E0aF2IKgeSbpS573wVgz+mEUGb4IYzuA0 Dg/w63AmCtsZu2WfT87R4ChQStlUO7XghuBfSE7zWu9+DVtk7TP4XLpKotBWbOMC16GM WP6g== X-Gm-Message-State: AOJu0YzpN0Ab2PXrs7p9kIiUuGJHF4vZrOnWFDnEGkKfAWOzq6NyYgNn Yxo/oGaQPHF6ZKOy0BhmDNbsjN/lt1gm6hGFYB1cFbKT7XRfDNTjLo703WHKOFStnkIBDrZtB79 NZKYIN4089GpA0HdYSXI= X-Received: by 2002:a2e:b16c:0:b0:2bf:fb49:6619 with SMTP id a12-20020a2eb16c000000b002bffb496619mr3032289ljm.23.1695978170765; Fri, 29 Sep 2023 02:02:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLclm+HlGHBZhT1fvBqcWAVWO9xl6YUVX8Bxl5Zp11hweL3RbtDt5YwyujWU7OuI3g7b5lIse+S7jY+ueSwRc= X-Received: by 2002:a2e:b16c:0:b0:2bf:fb49:6619 with SMTP id a12-20020a2eb16c000000b002bffb496619mr3032270ljm.23.1695978170386; Fri, 29 Sep 2023 02:02:50 -0700 (PDT) MIME-Version: 1.0 References: <1691717521-1025-1-git-send-email-roretzla@linux.microsoft.com> <1692738045-32363-1-git-send-email-roretzla@linux.microsoft.com> <1692738045-32363-2-git-send-email-roretzla@linux.microsoft.com> <5908573.LM0AJKV5NW@thomas> <98CBD80474FA8B44BF855DF32C47DC35D87C1F@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87C1F@smartserver.smartshare.dk> From: David Marchand Date: Fri, 29 Sep 2023 11:02:38 +0200 Message-ID: Subject: Re: [PATCH v6 1/6] eal: provide rte stdatomics optional atomics API To: =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: Thomas Monjalon , Tyler Retzlaff , dev@dpdk.org, techboard@dpdk.org, Bruce Richardson , Honnappa Nagarahalli , Ruifeng Wang , Jerin Jacob , Sunil Kumar Kori , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , Joyce Kong , David Christensen , Konstantin Ananyev , David Hunt X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Fri, Sep 29, 2023 at 10:54=E2=80=AFAM Morten Br=C3=B8rup wrote: > In my opinion, our move to C11 thus makes RTE_BUILD_BUG_ON obsolete. That's my thought too. > > We should mark RTE_BUILD_BUG_ON as deprecated, and disallow RTE_BUILD_BUG= _ON in new code. Perhaps checkpatches could catch this? For a clear deprecation of a part of DPDK API, I don't see a need to add something in checkpatch. Putting a RTE_DEPRECATED in RTE_BUILD_BUG_ON directly triggers a build warning (caught by CI since we run with Werror). diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index 771c70f2c8..40542629c1 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -495,7 +495,7 @@ rte_is_aligned(const void * const __rte_restrict ptr, const unsigned int align) /** * Triggers an error at compilation time if the condition is true. */ -#define RTE_BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)= ])) +#define RTE_BUILD_BUG_ON(condition) RTE_DEPRECATED(RTE_BUILD_BUG_ON) ((void)sizeof(char[1 - 2*!!(condition)])) /*********** Cache line related macros ********/ $ ninja -C build-mini ... [18/333] Compiling C object lib/librte_eal.a.p/eal_common_eal_common_trace.= c.o ../lib/eal/common/eal_common_trace.c: In function =E2=80=98eal_trace_init= =E2=80=99: ../lib/eal/common/eal_common_trace.c:44:20: warning: "RTE_BUILD_BUG_ON" is deprecated 44 | RTE_BUILD_BUG_ON((offsetof(struct __rte_trace_header, mem) % 8) !=3D 0); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [38/333] Compiling C object lib/librte_eal.a.p/eal_common_malloc_heap.c.o ../lib/eal/common/malloc_heap.c: In function =E2=80=98malloc_heap_destroy= =E2=80=99: ../lib/eal/common/malloc_heap.c:1398:20: warning: "RTE_BUILD_BUG_ON" is deprecated 1398 | RTE_BUILD_BUG_ON(offsetof(struct malloc_heap, lock) !=3D 0)= ; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [50/333] Compiling C object lib/librte_eal.a.p/eal_unix_rte_thread.c.o ../lib/eal/unix/rte_thread.c: In function =E2=80=98rte_thread_self=E2=80=99= : ../lib/eal/unix/rte_thread.c:239:20: warning: "RTE_BUILD_BUG_ON" is depreca= ted 239 | RTE_BUILD_BUG_ON(sizeof(pthread_t) > sizeof(uintptr_t)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --=20 David Marchand