From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v3] Move rte_mbuf macros to common header file Date: Wed, 30 Sep 2015 15:13:08 -0700 Message-ID: <20150930151308.2bfa209a@urahara> References: <1443650103-26768-1-git-send-email-rkerur@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Ravi Kerur Return-path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id ACC0D282 for ; Thu, 1 Oct 2015 00:12:59 +0200 (CEST) Received: by pablk4 with SMTP id lk4so51973101pab.3 for ; Wed, 30 Sep 2015 15:12:59 -0700 (PDT) In-Reply-To: <1443650103-26768-1-git-send-email-rkerur@gmail.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 30 Sep 2015 14:55:03 -0700 Ravi Kerur wrote: > +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)); > +} > + Some nits: * extra () on return is an unnecessary BSDism * cast to (uint64_t) is probably not needed since C does that anyway. * functions should take "const struct rte_mbuf *" since they don't modify it.