From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E809C35280 for ; Wed, 2 Oct 2019 13:42:16 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 38E6821783 for ; Wed, 2 Oct 2019 13:42:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=digirati.com.br header.i=@digirati.com.br header.b="TBXSYzm0"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=k8.com.br header.i=@k8.com.br header.b="AeWRfRCw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38E6821783 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=digirati.com.br Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F3F301BF0F; Wed, 2 Oct 2019 15:42:08 +0200 (CEST) Received: from mta123.f1.k8.com.br (mta123.f1.k8.com.br [187.73.32.199]) by dpdk.org (Postfix) with ESMTP id 3ED3C1BE8A for ; Mon, 30 Sep 2019 21:34:38 +0200 (CEST) Received: from [192.168.86.43] (pool-108-20-205-122.bstnma.fios.verizon.net [108.20.205.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtpz.f1.k8.com.br (Postfix) with ESMTPSA id 6389960098; Mon, 30 Sep 2019 19:34:32 +0000 (UTC) X-DKIM: OpenDKIM Filter v2.6.8 smtpz.f1.k8.com.br 6389960098 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digirati.com.br; s=default; t=1569872075; bh=1eFNR5eTdEN+AKSHahvxYl4GF1++JJoh1sUEAvP028A=; h=Subject:To:From:Date:Feedback-ID; b=TBXSYzm05r0AT1RCzXyHNGDqTzUVTKsjpUojz2TGNVNmRqA/9RANv4xGMh/3aY/0P HUDm7Uy/+iVzCxtVf5ggs/HT2kXlRHXTM2kr5d2hOcUhtHXYc2V0IgoYbjxm3qcZv0 C3bfTPfCkfA58RjzIVXymOjY5oMkJ7xdtAO8nYvY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=k8.com.br; s=default; t=1569872075; bh=1eFNR5eTdEN+AKSHahvxYl4GF1++JJoh1sUEAvP028A=; h=Subject:To:From:Date:Feedback-ID; b=AeWRfRCw7Bahtb+hPAMTr1aafEN7aVMFbl3adyUK0o9FShe/d+rzYiNKhslVekCWJ MP/HO/uHxff8Yo31jUivhtM2aGBbwqDQhleb/srKoWYq2RS3OOZXPQBzBiv047TSwa 7u+8u1/a3xPD7BZujzq7OqxU/6ObTrAUMcn1kAoE= To: Konstantin Ananyev , dev@dpdk.org Cc: olivier.matz@6wind.com, anatoly.burakov@intel.com, vipin.varghese@intel.com References: <20190816125304.29719-1-konstantin.ananyev@intel.com> <20190927135054.20845-1-konstantin.ananyev@intel.com> <20190927135054.20845-2-konstantin.ananyev@intel.com> From: Michel Machado Organization: Digirati Internet LTDA. Message-ID: Date: Mon, 30 Sep 2019 15:34:30 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190927135054.20845-2-konstantin.ananyev@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: pt-BR Content-Transfer-Encoding: 7bit X-HN-S: bWljaGVsQGRpZ2lyYXRpLmNvbS5icg== X-HN-R: ZGV2QGRwZGsub3Jn a29uc3RhbnRpbi5hbmFueWV2QGludGVsLmNvbQ== Feedback-ID: MjAxOTA5MzA=:bWljaGVsQGRpZ2lyYXRpLmNvbS5icg==:ZGlnaXJhdGkuY29tLmJy:k8networks X-Mailman-Approved-At: Wed, 02 Oct 2019 15:42:06 +0200 Subject: Re: [dpdk-dev] [PATCH v2 1/3] eal: move CACHE and IOVA related definitions 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" Acked-by: Michel Machado [ ]'s Michel Machado On 9/27/19 9:50 AM, Konstantin Ananyev wrote: > Right now RTE_CACHE_ and IOVA definitions are located inside rte_memory.h > That might cause an unwanted inclusions of arch/os specific header files. > See [1] for particular problem example. > Probably the simplest way to deal with such problems - > move these definitions into rte_commmon.h > > Note that this move doesn't introduce any change in functionality. > > [1] https://bugs.dpdk.org/show_bug.cgi?id=321 > > Suggested-by: Vipin Varghese > Signed-off-by: Konstantin Ananyev > --- > lib/librte_eal/common/include/rte_common.h | 44 ++++++++++++++++++++++ > lib/librte_eal/common/include/rte_memory.h | 38 ------------------- > 2 files changed, 44 insertions(+), 38 deletions(-) > > diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h > index 05a3a6401..c275093d7 100644 > --- a/lib/librte_eal/common/include/rte_common.h > +++ b/lib/librte_eal/common/include/rte_common.h > @@ -291,6 +291,50 @@ rte_is_aligned(void *ptr, unsigned align) > */ > #define RTE_BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) > > +/*********** RTE_CACHE related macros ********/ > + > +#define RTE_CACHE_LINE_MASK (RTE_CACHE_LINE_SIZE-1) /**< Cache line mask. */ > + > +#define RTE_CACHE_LINE_ROUNDUP(size) \ > + (RTE_CACHE_LINE_SIZE * ((size + RTE_CACHE_LINE_SIZE - 1) / \ > + RTE_CACHE_LINE_SIZE)) > +/**< Return the first cache-aligned value greater or equal to size. */ > + > +/**< Cache line size in terms of log2 */ > +#if RTE_CACHE_LINE_SIZE == 64 > +#define RTE_CACHE_LINE_SIZE_LOG2 6 > +#elif RTE_CACHE_LINE_SIZE == 128 > +#define RTE_CACHE_LINE_SIZE_LOG2 7 > +#else > +#error "Unsupported cache line size" > +#endif > + > +#define RTE_CACHE_LINE_MIN_SIZE 64 /**< Minimum Cache line size. */ > + > +/** > + * Force alignment to cache line. > + */ > +#define __rte_cache_aligned __rte_aligned(RTE_CACHE_LINE_SIZE) > + > +/** > + * Force minimum cache line alignment. > + */ > +#define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE) > + > +/*********** PA/IOVA type definitions ********/ > + > +typedef uint64_t phys_addr_t; /**< Physical address. */ > +#define RTE_BAD_PHYS_ADDR ((phys_addr_t)-1) > +/** > + * IO virtual address type. > + * When the physical addressing mode (IOVA as PA) is in use, > + * the translation from an IO virtual address (IOVA) to a physical address > + * is a direct mapping, i.e. the same value. > + * Otherwise, in virtual mode (IOVA as VA), an IOMMU may do the translation. > + */ > +typedef uint64_t rte_iova_t; > +#define RTE_BAD_IOVA ((rte_iova_t)-1) > + > /** > * Combines 32b inputs most significant set bits into the least > * significant bits to construct a value with the same MSBs as x > diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h > index 4717dcb43..38e00e382 100644 > --- a/lib/librte_eal/common/include/rte_memory.h > +++ b/lib/librte_eal/common/include/rte_memory.h > @@ -39,44 +39,6 @@ enum rte_page_sizes { > }; > > #define SOCKET_ID_ANY -1 /**< Any NUMA socket. */ > -#define RTE_CACHE_LINE_MASK (RTE_CACHE_LINE_SIZE-1) /**< Cache line mask. */ > - > -#define RTE_CACHE_LINE_ROUNDUP(size) \ > - (RTE_CACHE_LINE_SIZE * ((size + RTE_CACHE_LINE_SIZE - 1) / RTE_CACHE_LINE_SIZE)) > -/**< Return the first cache-aligned value greater or equal to size. */ > - > -/**< Cache line size in terms of log2 */ > -#if RTE_CACHE_LINE_SIZE == 64 > -#define RTE_CACHE_LINE_SIZE_LOG2 6 > -#elif RTE_CACHE_LINE_SIZE == 128 > -#define RTE_CACHE_LINE_SIZE_LOG2 7 > -#else > -#error "Unsupported cache line size" > -#endif > - > -#define RTE_CACHE_LINE_MIN_SIZE 64 /**< Minimum Cache line size. */ > - > -/** > - * Force alignment to cache line. > - */ > -#define __rte_cache_aligned __rte_aligned(RTE_CACHE_LINE_SIZE) > - > -/** > - * Force minimum cache line alignment. > - */ > -#define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE) > - > -typedef uint64_t phys_addr_t; /**< Physical address. */ > -#define RTE_BAD_PHYS_ADDR ((phys_addr_t)-1) > -/** > - * IO virtual address type. > - * When the physical addressing mode (IOVA as PA) is in use, > - * the translation from an IO virtual address (IOVA) to a physical address > - * is a direct mapping, i.e. the same value. > - * Otherwise, in virtual mode (IOVA as VA), an IOMMU may do the translation. > - */ > -typedef uint64_t rte_iova_t; > -#define RTE_BAD_IOVA ((rte_iova_t)-1) > > /** > * Physical memory segment descriptor. >