From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 27779A0559; Mon, 16 Mar 2020 12:02:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E18E02BF9; Mon, 16 Mar 2020 12:02:38 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id CD0023B5 for ; Mon, 16 Mar 2020 12:02:37 +0100 (CET) IronPort-SDR: UB4XUVBk+F96BnUe5HmhoEftpaAivzpCohbaaN56bRgCgfoCqGxNHRe3XAHilgvP1VSEGp0DFm gUkgoHcfjRRQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2020 04:02:36 -0700 IronPort-SDR: VbzU9qDrMqtMHtwm5QQeMFUaHunogYSWRyxKClqH0r6bnxfd6I17rPml8mKmVv5LBUVTyBi/dh idGQYBSgIlVw== X-IronPort-AV: E=Sophos;i="5.70,560,1574150400"; d="scan'208";a="417102882" Received: from bricha3-mobl.ger.corp.intel.com ([10.249.41.70]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 16 Mar 2020 04:02:35 -0700 Date: Mon, 16 Mar 2020 11:02:31 +0000 From: Bruce Richardson To: Thomas Monjalon Cc: Dmitry Kozlyuk , dev@dpdk.org, Olivier Matz Message-ID: <20200316110231.GB1953@bricha3-MOBL.ger.corp.intel.com> References: <20200218000229.86621-1-dmitry.kozliuk@gmail.com> <3094952.KgjxqYA5nG@xps> <20200314023826.699ab6c0@Sovereign> <15686856.Ash8RoxBsO@xps> <20200316105409.GA1953@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200316105409.GA1953@bricha3-MOBL.ger.corp.intel.com> Subject: Re: [dpdk-dev] [PATCH v4 1/7] eal: introduce portable format attribute X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Mar 16, 2020 at 10:54:09AM +0000, Bruce Richardson wrote: > On Sun, Mar 15, 2020 at 09:36:11AM +0100, Thomas Monjalon wrote: > > 14/03/2020 00:38, Dmitry Kozlyuk: > > > > I suggest this change (I can send a patch fixing the issue in other .h files): > > > > > > > > +/* > > > > + * RTE_TOOLCHAIN_GCC is true if the target is built with GCC, > > > > + * while a host application (like pmdinfogen) may have another compiler. > > > > + * RTE_CC_IS_GNU is true if the file is compiled with GCC, > > > > + * no matter it is a target or host application. > > > > + */ > > > > +#if defined __GNUC__ && !defined __clang__ && !defined __INTEL_COMPILER > > > > +#define RTE_CC_IS_GNU > > > > +#endif > > > > + > > > > +#ifdef RTE_CC_IS_GNU > > > > -/** Define GCC_VERSION **/ > > > > -#ifdef RTE_TOOLCHAIN_GCC > > > > #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + \ > > > > __GNUC_PATCHLEVEL__) > > > > #endif > > > > @@ -96,7 +105,7 @@ typedef uint16_t unaligned_uint16_t; > > > > * even if the underlying stdio implementation is ANSI-compliant, > > > > * so this must be overridden. > > > > */ > > > > -#if defined(RTE_TOOLCHAIN_GCC) > > > > +#ifdef RTE_CC_IS_GNU > > > > #define __rte_format_printf(format_index, first_arg) \ > > > > __attribute__((format(gnu_printf, format_index, first_arg))) > > > > #else > > > > > > The code you propose LGTM itself. If you think it's a better solution than > > > the one proposed below, I see no problem going with it. > > > > > > What I wonder is whether pmdinfogen should include the problematic code in the > > > first place. The errors come from declarations in rte_debug.h, but pmdinfogen > > > really can't use them, because definitions are compiled for different > > > machine. Pmdinfogen pulls rte_debug.h via rte_pci.h, which is only needed for > > > struct rte_pci_id. Shouldn't we instead break this bogus dependency chain by > > > moving struct rte_pci_id to a separate header? > > > > Splitting headers to avoid EAL dependency looks to be a bad precedent to me. > > > > Rather than splitting, we can still fix this by breaking the dependency by > just not having rte_debug.h included in rte_pci.h. From what I see, there > is no need for that include to be there, and DPDK pretty much compiles fine > with it removed - the only other change I had to make was add an extra > include into mlx5_common.h to compensate for it not getting pulled in via > rte_pci.h. > And by adding rte_interrupts.h to drivers/bus/ifpga/rte_bus_ifpga.h we can remove the following headers from rte_pci.h also: stdio.h errno.h stdint.h rte_interrupts.h This means that we go from 9 includes in the file (including rte_debug.h) to just 4. Regards, /Bruce