From: "Burakov, Anatoly" Subject: Re: [PATCH 1/4] mbuf: add accessor function for private data area Date: Fri, 8 Jun 2018 09:30:17 +0100 Message-ID: <8f40b27d-50b7-4601-ee92-0c04c7230b26@intel.com> References: <20180607235454.27832-1-dg@adax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Olivier Matz To: Dan Gora , dev@dpdk.org Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 4D254D158 for ; Fri, 8 Jun 2018 10:30:20 +0200 (CEST) In-Reply-To: <20180607235454.27832-1-dg@adax.com> Content-Language: en-US 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 08-Jun-18 12:54 AM, Dan Gora wrote: > Add an inline accessor function to return the starting address of > the private data area in the supplied mbuf. > > If the user did not allocate space for a private data area in the > mbuf's memory pool, then return NULL. > > This allows applications to easily access the private data area > between the struct rte_mbuf and the data buffer in the specified mbuf > without creating private macros or accessor functions. > > Signed-off-by: Dan Gora > --- <...> > +static inline void * > +rte_mbuf_to_priv(struct rte_mbuf *md) > +{ > + if (md->priv_size == 0) > + return NULL; > + > + return RTE_PTR_ADD(md, sizeof(struct rte_mbuf)); > +} Hi Dan, New API's should be marked as __rte_experimental for at least one release. > + > /** > * Returns TRUE if given mbuf is cloned by mbuf indirection, or FALSE > * otherwise. > -- Thanks, Anatoly