From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: mbuf: how to set data to NULL? Date: Wed, 17 Dec 2014 16:49:35 +0000 Message-ID: <20141217164934.GA6980@bricha3-MOBL3> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "dev-VfR2kkLFssw@public.gmane.org" To: "Kavanagh, Mark B" Return-path: Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On Wed, Dec 17, 2014 at 04:44:15PM +0000, Kavanagh, Mark B wrote: > Hi, > > DPDK 1.8.0 removes the data pointer from the mbuf structure, such that the start of the data in the segment buffer must be calculated (i.e. buf_addr + data_off = 'data'). > > Given this, what is the best approach to set the mbuf data to NULL (previously mbuf.data = NULL)? > > As I see it, given an initialized mbuf, such that buf_addr is non-null, and data_off =RTE_PKTMBUF_HEADROOM, is it fair to say that the best solution is to memset to 0 from location (buf_addr + data_off) for a length of (data_len - data_off)? > > Thanks in advance, > Mark Why not just set data_len = 0 to indicate an empty mbuf?