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 368C85583 for ; Tue, 15 Mar 2016 11:41:37 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 15 Mar 2016 03:41:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,338,1455004800"; d="scan'208";a="937420479" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.31]) by fmsmga002.fm.intel.com with SMTP; 15 Mar 2016 03:41:34 -0700 Received: by (sSMTP sendmail emulation); Tue, 15 Mar 2016 10:41:33 +0025 Date: Tue, 15 Mar 2016 10:41:33 +0000 From: Bruce Richardson To: Vivek Gupta Cc: "dev@dpdk.org" Message-ID: <20160315104133.GA24724@bricha3-MOBL3> References: <488FF59D9020184C9DCF4B4A0DA4781425535B44@NDA-HCLT-MBS03.hclt.corp.hcl.in> <56E052DA.8000901@intel.com> <488FF59D9020184C9DCF4B4A0DA47814255404B2@NDA-HCLT-MBS03.hclt.corp.hcl.in> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <488FF59D9020184C9DCF4B4A0DA47814255404B2@NDA-HCLT-MBS03.hclt.corp.hcl.in> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] Client Server Application using DPDK API 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: Tue, 15 Mar 2016 10:41:38 -0000 On Tue, Mar 15, 2016 at 09:06:12AM +0000, Vivek Gupta wrote: > Hi > > I am developing a network program using DPDK API. I want to extract the data which is there is rte_mbuf structure. > > Referred to rte_mbuf structure manual but confused with fields > > uint16_t buf_len; /**< Length of segment buffer. */ > uint16_t data_len; /**< Amount of data in segment buffer. */ > > > Can someone help me to understand how to extract data from buffer? The first value is the size of the buffer, the second is the amount of data in the buffer. When working with a packet in an mbuf, the data_len is the value you want. /Bruce > > Thanks & regards > Vivek Gupta > > -----Original Message----- > From: Remy Horton [mailto:remy.horton@intel.com] > Sent: Wednesday, March 09, 2016 10:14 PM > To: Vivek Gupta > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] Client Server Application using DPDK API > > 'noon, > > On 09/03/2016 08:45, Vivek Gupta wrote: > > Hi > > > > I want to write a Client Server application using DPDK API on a single > > machine. What are the basic building block for that. How can we write > > such application? > > examples/l2fwd/main.c and examples/ethtool/ethtool-app/main.c are probably the easier examples to follow. In terms of function calls, it is pretty much: > > rte_eal_init(..); > for (each port) { > rte_pktmbuf_pool_create(..); > rte_eth_dev_configure(..); > rte_eth_dev_rx_queue_setup(..); > rte_eth_dev_tx_queue_setup(..); > rte_eth_dev_start(..); > } > while(1) { > rte_eth_rx_burst(..); /* incoming frames */ > rte_eth_tx_burst(..); /* outgoing frames */ } > > Bear in mind that DPDK deals with MAC frames rather than higher level IP packets, which may be an issue if you intend to use TCP/IP based application protocols. > > > > ::DISCLAIMER:: > > Avoid using confidentality disclaimers on mailing list emails. It tends to "annoy" people.. :) > > Regards, > > ..Remy > > > ::DISCLAIMER:: > ---------------------------------------------------------------------------------------------------------------------------------------------------- > > The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. > E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, > lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents > (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. > Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the > views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, > distribution and / or publication of this message without the prior written consent of authorized representative of > HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. > Before opening any email and/or attachments, please check them for viruses and other defects. > > ---------------------------------------------------------------------------------------------------------------------------------------------------- >