From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2018 01:30:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,490,1520924400"; d="scan'208";a="62355370" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.237.220.101]) ([10.237.220.101]) by fmsmga001.fm.intel.com with ESMTP; 08 Jun 2018 01:30:18 -0700 To: Dan Gora , dev@dpdk.org Cc: Olivier Matz References: <20180607235454.27832-1-dg@adax.com> From: "Burakov, Anatoly" Message-ID: <8f40b27d-50b7-4601-ee92-0c04c7230b26@intel.com> Date: Fri, 8 Jun 2018 09:30:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180607235454.27832-1-dg@adax.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/4] mbuf: add accessor function for private data area 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: , X-List-Received-Date: Fri, 08 Jun 2018 08:30:21 -0000 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