From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id A70348E69 for ; Wed, 30 Sep 2015 21:41:20 +0200 (CEST) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 2B94B341AD4; Wed, 30 Sep 2015 19:41:20 +0000 (UTC) Received: from aconole.bos.csb (dhcp-25-96.bos.redhat.com [10.18.25.96]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8UJfJdf015438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 30 Sep 2015 15:41:19 -0400 From: Aaron Conole To: Ravi Kerur References: <1443640706-3984-1-git-send-email-rkerur@gmail.com> Date: Wed, 30 Sep 2015 15:41:18 -0400 In-Reply-To: <1443640706-3984-1-git-send-email-rkerur@gmail.com> (Ravi Kerur's message of "Wed, 30 Sep 2015 12:18:26 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] Move rte_mbuf macros to common header file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2015 19:41:21 -0000 Ravi Kerur writes: > Macros RTE_MBUF_DATA_DMA_ADDR and RTE_MBUF_DATA_DMA_ADDR_DEFAULT > are defined in each PMD driver file. Move those macros into common > lib/librte_mbuf/rte_mbuf.h file. PMD drivers include rte_mbuf.h > file directly/indirectly hence no additionl header file inclusion > is necessary. I think this should also mention that they are no longer macros, as well. <> > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -843,6 +843,16 @@ struct rte_mbuf { > uint16_t timesync; > } __rte_cache_aligned; > > +static inline uint64_t RTE_MBUF_DATA_DMA_ADDR(struct rte_mbuf* mb) > +{ > + return ((uint64_t)((mb)->buf_physaddr + (mb)->data_off)); > +} > + > +static inline uint64_t RTE_MBUF_DATA_DMA_ADDR_DEFAULT(struct rte_mbuf *mb) > +{ > + return ((uint64_t)((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM)); > +} > + I think these names should be made lower case as well.