From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 882A4593A for ; Mon, 5 Jan 2015 13:03:21 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 05 Jan 2015 03:59:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="507539688" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.27]) by orsmga003.jf.intel.com with SMTP; 05 Jan 2015 03:57:30 -0800 Received: by (sSMTP sendmail emulation); Mon, 05 Jan 2015 12:03:03 +0025 Date: Mon, 5 Jan 2015 12:03:03 +0000 From: Bruce Richardson To: Tapio Tallgren Message-ID: <20150105120302.GD13152@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] Query on the modified rte_mbuf structure 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: Mon, 05 Jan 2015 12:03:22 -0000 On Tue, Dec 30, 2014 at 08:58:01AM +0200, Tapio Tallgren wrote: > Hi, > > I am not sure if I understand the question correctly, but there was a > change to the rte_mbuf structure with > patch ea672a8b1655bbb44876d2550ff56f384968a43b. It got rid of the pkt > member in rte_mbuf. Here is an example of how to fix it: > > - eth_hdr = (struct ether_hdr *) mb->pkt.data; > + eth_hdr = (struct ether_hdr *) mb->data; > > Another way of answering your question is that it is "data" in rte_mbuf: > > - struct rte_pktmbuf pkt; > + /* valid for any segment */ > + struct rte_mbuf *next; /**< Next segment of scattered packet. */ > + void* data; /**< Start address of data in segment > buffer. */ > + uint16_t data_len; /**< Amount of data in segment buffer. */ > > > > > On Thu, Dec 25, 2014 at 11:24 AM, Shankari Vaidyalingam < > shankari.v2k6@gmail.com> wrote: > > > Hi, > > > > > > I can see that in the recent releases of DPDK the rte_mbuf structure has > > undergone some changes. > > Would like to know which field in the rte_mbuf data structure holds the > > exact payload of the received packet in the modified structure. > > > > Regards > > Shankari > > > > Best way to get at the packet data is to use the rte_pktmbuf_mtod macro defined in rte_mbuf.h. This macro should be always kept up-to-date to refer to the packet data, irrespective of changes to the underlying data structure. /Bruce