From patchwork Tue Sep 8 11:12:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pai G, Sunil" X-Patchwork-Id: 1359673 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bm2Yn5FvDz9sSP for ; Tue, 8 Sep 2020 21:12:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 487DE8690E; Tue, 8 Sep 2020 11:12:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PvmjSoEF-kRe; Tue, 8 Sep 2020 11:12:42 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id A67E1868F3; Tue, 8 Sep 2020 11:12:42 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8573DC0859; Tue, 8 Sep 2020 11:12:42 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3D717C0051 for ; Tue, 8 Sep 2020 11:12:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2C764868F3 for ; Tue, 8 Sep 2020 11:12:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X9erKbQ5JOLP for ; Tue, 8 Sep 2020 11:12:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 690A485650 for ; Tue, 8 Sep 2020 11:12:40 +0000 (UTC) IronPort-SDR: frFFm6/6tUPh3+NEE8pmMTSWDaQoxHodctnj153rmpUP8EYSQH0fAiIZpOgDav3hpa0KQpDvqu dJpNBbw6964A== X-IronPort-AV: E=McAfee;i="6000,8403,9737"; a="242925944" X-IronPort-AV: E=Sophos;i="5.76,405,1592895600"; d="scan'208";a="242925944" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2020 04:12:39 -0700 IronPort-SDR: XcOAf5VcDSR0LC3mF8+/KGa7jp2x0DO5TTdLiKElkqMc/u61+Gs3MaDIUp2scvNvJ6TszK7pDh IGMXKuKzQjew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,405,1592895600"; d="scan'208";a="284479399" Received: from sie-lab-213-229.ir.intel.com (HELO silpixa00399415.ger.corp.intel.com) ([10.237.213.229]) by fmsmga007.fm.intel.com with ESMTP; 08 Sep 2020 04:12:38 -0700 From: Sunil Pai G To: dev@openvswitch.org Date: Tue, 8 Sep 2020 12:12:28 +0100 Message-Id: <20200908111228.8673-1-sunil.pai.g@intel.com> X-Mailer: git-send-email 2.17.1 Cc: david.marchand@redhat.com, i.maximets@ovn.org Subject: [ovs-dev] [PATCH dpdk-latest v2] sparse: Fix build with DPDK 20.08. 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Introduction of C11 atomic instructions in rte_mbuf.h causes the build to fail with Sparse reporting following errors. error: undefined identifier '__atomic_add_fetch' error: undefined identifier '__atomic_store_n' This patch adds the Sparse header for rte_mbuf.h. Tested-at: https://travis-ci.org/github/Sunil-Pai-G/ovs-copy/builds/724038561 Signed-off-by: Sunil Pai G Acked-by: David Marchand --- v1->v2: - address all comments from Dave. --- include/sparse/automake.mk | 1 + include/sparse/rte_mbuf.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 include/sparse/rte_mbuf.h diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk index c6ced9387..e96637119 100644 --- a/include/sparse/automake.mk +++ b/include/sparse/automake.mk @@ -11,6 +11,7 @@ noinst_HEADERS += \ include/sparse/netpacket/packet.h \ include/sparse/pthread.h \ include/sparse/rte_atomic.h \ + include/sparse/rte_mbuf.h \ include/sparse/rte_memcpy.h \ include/sparse/rte_trace_point.h \ include/sparse/sys/socket.h \ diff --git a/include/sparse/rte_mbuf.h b/include/sparse/rte_mbuf.h new file mode 100644 index 000000000..ee461f91e --- /dev/null +++ b/include/sparse/rte_mbuf.h @@ -0,0 +1,27 @@ +/* Copyright (c) 2020 Intel, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +/* sparse doesn't know about gcc atomic builtins. */ +#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)) + +/* Get actual definitions for us to annotate and build on. */ +#include_next