From patchwork Thu Oct 22 10:57:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 1386151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH47j4xgSz9sVN for ; Thu, 22 Oct 2020 21:57:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BBD6D20778; Thu, 22 Oct 2020 10:57:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T-xrrOcMPBTS; Thu, 22 Oct 2020 10:57:18 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 21481203E7; Thu, 22 Oct 2020 10:57:18 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E4C18C0052; Thu, 22 Oct 2020 10:57:17 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0D434C0051 for ; Thu, 22 Oct 2020 10:57:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 08C6486E73 for ; Thu, 22 Oct 2020 10:57:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NZ+eqaVyoc9r for ; Thu, 22 Oct 2020 10:57:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by whitealder.osuosl.org (Postfix) with ESMTP id 900F8864DF for ; Thu, 22 Oct 2020 10:57:14 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from elibr@nvidia.com) with SMTP; 22 Oct 2020 13:57:12 +0300 Received: from nvidia.com (dev-r-vrt-214.mtr.labs.mlnx [10.212.214.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09MAvBpL019197; Thu, 22 Oct 2020 13:57:11 +0300 From: Eli Britstein To: dev@openvswitch.org, Ian Stokes Date: Thu, 22 Oct 2020 10:57:01 +0000 Message-Id: <20201022105701.29650-1-elibr@nvidia.com> X-Mailer: git-send-email 2.28.0.546.g385c171 MIME-Version: 1.0 Cc: Eli Britstein , David Marchand , Ilya Maximets Subject: [ovs-dev] [PATCH dpdk-latest V3 1/1] sparse: Fix __ATOMIC_* redefinition errors X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" In sparse commit [1], __ATOMIC_* defines were introduced, which cause redefinition errors. Commits [2],[3] introduced builtin __atomic_* functions that are defined in OVS. Wrap OVS defines with #ifndef to fix it. We assume using either a sparse version before all [1],[2],[3], or a version after them. [1] https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=cf8f104749f5 [2] https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=7cdf84691f33 [3] https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=f42e2afa9ed0 Tested-at: https://travis-ci.org/github/elibritstein/OVS/builds/737943898 Signed-off-by: Eli Britstein Acked-by: David Marchand --- include/sparse/rte_mbuf.h | 2 ++ include/sparse/rte_trace_point.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/sparse/rte_mbuf.h b/include/sparse/rte_mbuf.h index ee461f91e..981cdb441 100644 --- a/include/sparse/rte_mbuf.h +++ b/include/sparse/rte_mbuf.h @@ -18,10 +18,12 @@ #endif /* sparse doesn't know about gcc atomic builtins. */ +#ifndef __ATOMIC_ACQ_REL #define __ATOMIC_ACQ_REL 0 #define __ATOMIC_RELAXED 1 #define __atomic_add_fetch(p, val, memorder) (*(p) = *(p) + (val)) #define __atomic_store_n(p, val, memorder) (*(p) = (val)) +#endif /* Get actual definitions for us to annotate and build on. */ #include_next diff --git a/include/sparse/rte_trace_point.h b/include/sparse/rte_trace_point.h index c28f1c941..803923275 100644 --- a/include/sparse/rte_trace_point.h +++ b/include/sparse/rte_trace_point.h @@ -18,8 +18,10 @@ #endif /* sparse doesn't know about gcc atomic builtins. */ +#ifndef __ATOMIC_ACQUIRE #define __ATOMIC_ACQUIRE 0 #define __atomic_load_n(p, memorder) *(p) +#endif /* Get actual definitions for us to annotate and * build on. */