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 8AA2043F76; Fri, 3 May 2024 15:32:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E79EB402D0; Fri, 3 May 2024 15:32:58 +0200 (CEST) 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 44159402C5 for ; Fri, 3 May 2024 15:32:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714743176; 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=MNyEMTB8AubX5Rmv0eACGf+yCwx01BP5wx154Xzdmig=; b=HGpjB9b8MN3J7jpvVXQpb7GUSH1imRKPgP/+1laETROdLkF4XfjC9lykgMsYdGH+FZbGBl jAD5vOOiu28AgOiV26oiENF5Qytb84xxLxMD2jBzeYmX09keyoeu3jHbhaWQ83lTt2Hjf6 MWnBtaiEXHQXOQx27o2fASEz4xgTUAw= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-HvPuJ10OOqKhUFwhVbUonA-1; Fri, 03 May 2024 09:32:54 -0400 X-MC-Unique: HvPuJ10OOqKhUFwhVbUonA-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-416e58bdc1eso46015115e9.3 for ; Fri, 03 May 2024 06:32:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714743173; x=1715347973; 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=MNyEMTB8AubX5Rmv0eACGf+yCwx01BP5wx154Xzdmig=; b=TaHWm2uPrmC1kxLBz1yIMvsEaPzzuFCyAcxZ+UDl71Wra535XLmaSiEQoqMndSrzlx 5YKaYZcJFntNj9gMncFe8ZzgKcQlVRMlaI8s88WhgZb6CnotHGbHhmrDWag2WTp4+iUc xa9EajS6WMQmdHetHCi495aoipcoO7qLsflQ+K+stc66tAvytQJpNq/2zGAGImWWxntp 7W60wOPDdKbxDC4+JEE1CBctwZmwPqlwyGorHJ7JRtYOe9arp3Y+GwYRQ20TD7SalwYr S8p/uGEGFA2U2uKtnOwBnBw4EdrwrHMLoXBcc/R0CEVghZVPso79EwNxAjuRLG/Mfu5o 92nA== X-Forwarded-Encrypted: i=1; AJvYcCUBMsDYcax+oq80kVPoQ7sclcjX5RdX+f4KorHMuW4DjEMFIgS8zB7grFuW5n9LyX+18U9kYqzmR3MNpYQ= X-Gm-Message-State: AOJu0YyxS3XgTj0v4PoW0bJnHjIUKDxePPUvUw2riM+HtgacjLqz/33f SRxPmOqwxyalYj0qtTZIYlFsxSOi0c+LBwu0Az7+dFl1eZVt7Ql+ZZ1KE+gLlrx7E305kI+wgh7 nvk2e3zb7+J4hVhyVu/w3kG9auLXr5xZLTZxVND2+1Fon+cZC1tAnU3qRdRNlXnbLOvurL7smql 9stDYAUhwDEsuSO92zeIi6mTutTRql X-Received: by 2002:a05:600c:45ce:b0:415:6afd:9ba6 with SMTP id s14-20020a05600c45ce00b004156afd9ba6mr2186881wmo.1.1714743173056; Fri, 03 May 2024 06:32:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxtmCPfZJv2vDNSz4G6zs7D4kKMvKnv6zz/7hZzcBhsVD6DQjF7Wt66KcWK98oQMhgfri1+ADdns8YnJMss4A= X-Received: by 2002:ac2:53b3:0:b0:51c:1cdb:566f with SMTP id j19-20020ac253b3000000b0051c1cdb566fmr1805001lfh.11.1714743152422; Fri, 03 May 2024 06:32:32 -0700 (PDT) MIME-Version: 1.0 References: <20240502142116.63760-1-daniel.gregory@bytedance.com> In-Reply-To: <20240502142116.63760-1-daniel.gregory@bytedance.com> From: David Marchand Date: Fri, 3 May 2024 15:32:20 +0200 Message-ID: Subject: Re: [PATCH] eal/arm: replace RTE_BUILD_BUG on non-constant To: Daniel Gregory Cc: Ruifeng Wang , dev@dpdk.org, Punit Agrawal , Liang Ma 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 Thu, May 2, 2024 at 4:22=E2=80=AFPM Daniel Gregory wrote: > > The ARM implementation of rte_pause uses RTE_BUILD_BUG_ON to check > memorder, which is not constant. This causes compile errors when it is > enabled with RTE_ARM_USE_WFE. eg. > > ../lib/eal/arm/include/rte_pause_64.h: In function =E2=80=98rte_wait_unti= l_equal_16=E2=80=99: > ../lib/eal/include/rte_common.h:530:56: error: expression in static asser= tion is not constant > 530 | #define RTE_BUILD_BUG_ON(condition) do { static_assert(!(conditio= n), #condition); } while (0) > | ^~~~~~~~~~= ~~ > ../lib/eal/arm/include/rte_pause_64.h:156:9: note: in expansion of macro = =E2=80=98RTE_BUILD_BUG_ON=E2=80=99 > 156 | RTE_BUILD_BUG_ON(memorder !=3D rte_memory_order_acquire &= & > | ^~~~~~~~~~~~~~~~ > > This has been the case since the switch to C11 assert (537caad2). Fix > the compile errors by replacing the check with an RTE_ASSERT. > > Signed-off-by: Daniel Gregory - RTE_BUILD_BUG_ON() should not be used indeed. IIRC, this issue was introduced with 875f350924b8 ("eal: add a new helper for wait until scheme"). Please add a corresponding Fixes: tag in next revision. Rather than use RTE_ASSERT(), you can simply revert to a assert() call, like what was done before this change (and this is what is done for the non WFE/generic implementation too, see lib/eal/include/generic/rte_pause.h). - This ARM specific implementation should take a rte_memory_order type instead of a int type for the memorder input variable. This was missed in 1ec6a845b5cb ("eal: use stdatomic API in public headers"= ). Could you send a fix for this small issue too? Thanks! --=20 David Marchand