From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6FC7A7E6A for ; Wed, 17 Dec 2014 17:49:53 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 17 Dec 2014 08:49:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,594,1413270000"; d="scan'208";a="649222132" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.28]) by fmsmga002.fm.intel.com with SMTP; 17 Dec 2014 08:49:36 -0800 Received: by (sSMTP sendmail emulation); Wed, 17 Dec 2014 16:49:35 +0025 Date: Wed, 17 Dec 2014 16:49:35 +0000 From: Bruce Richardson To: "Kavanagh, Mark B" Message-ID: <20141217164934.GA6980@bricha3-MOBL3> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] mbuf: how to set data to NULL? 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, 17 Dec 2014 16:49:54 -0000 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?