From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from GWS05.hcl.com (gws05.avitas.hcl.com [203.105.185.23]) by dpdk.org (Postfix) with ESMTP id 2A9772BA9 for ; Tue, 15 Mar 2016 12:00:54 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.24,338,1454956200"; d="scan'208";a="154404614" Received: from unknown (HELO NDA-CORP-HT03.CORP.HCL.IN) ([10.248.64.35]) by GWS05.hcl.com with ESMTP/TLS/AES128-SHA; 15 Mar 2016 16:26:59 +0530 Received: from NDA-HCLT-CSHT05.HCLT.CORP.HCL.IN (10.98.132.30) by NDA-CORP-HT03.CORP.HCL.IN (10.248.64.35) with Microsoft SMTP Server (TLS) id 14.3.235.1; Tue, 15 Mar 2016 16:30:52 +0530 Received: from NDA-HCLT-MBS03.HCLT.CORP.HCL.IN ([10.98.132.18]) by NDA-HCLT-CSHT05.HCLT.CORP.HCL.IN ([10.98.132.30]) with mapi id 14.03.0235.001; Tue, 15 Mar 2016 16:30:52 +0530 From: Vivek Gupta To: Bruce Richardson , "dev@dpdk.org" Thread-Topic: [dpdk-dev] Client Server Application using DPDK API Thread-Index: AdF54A5PaJOwzDWBRneQpBafKUz2OAAFL9cAASjo+MD//8FkgP//n7oQ Date: Tue, 15 Mar 2016 11:00:51 +0000 Message-ID: <488FF59D9020184C9DCF4B4A0DA478142554073B@NDA-HCLT-MBS03.hclt.corp.hcl.in> References: <488FF59D9020184C9DCF4B4A0DA4781425535B44@NDA-HCLT-MBS03.hclt.corp.hcl.in> <56E052DA.8000901@intel.com> <488FF59D9020184C9DCF4B4A0DA47814255404B2@NDA-HCLT-MBS03.hclt.corp.hcl.in> <20160315104133.GA24724@bricha3-MOBL3> In-Reply-To: <20160315104133.GA24724@bricha3-MOBL3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.98.134.12] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 15 Mar 2016 12:05:01 +0100 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 11:00:56 -0000 Hi Thanks for your prompt reply. As per my understanding rte_mbuf structure contains information of many hea= der and their corresponding values. Like Ethernet, IP and UDP Headers. I would like to know what are the other headers information is available an= d how to extract those information from packet. Thanks & Regards Vivek Gupta -----Original Message----- From: Bruce Richardson [mailto:bruce.richardson@intel.com]=20 Sent: Tuesday, March 15, 2016 4:12 PM To: Vivek Gupta Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Client Server Application using DPDK API On Tue, Mar 15, 2016 at 09:06:12AM +0000, Vivek Gupta wrote: > Hi >=20 > I am developing a network program using DPDK API. I want to extract the d= ata which is there is rte_mbuf structure. >=20 > Referred to rte_mbuf structure manual but confused with fields >=20 > uint16_t buf_len; /**< Length of segment buffer. */ > uint16_t data_len; /**< Amount of data in segment buffer. */ >=20 >=20 > 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 >=20 > Thanks & regards > Vivek Gupta >=20 > -----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 >=20 > 'noon, >=20 > On 09/03/2016 08:45, Vivek Gupta wrote: > > Hi > > > > I want to write a Client Server application using DPDK API on a=20 > > single machine. What are the basic building block for that. How can=20 > > we write such application? >=20 > examples/l2fwd/main.c and examples/ethtool/ethtool-app/main.c are probabl= y the easier examples to follow. In terms of function calls, it is pretty m= uch: >=20 > 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 */ } >=20 > 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 applicatio= n protocols. >=20 >=20 > > ::DISCLAIMER:: >=20 > Avoid using confidentality disclaimers on mailing list emails. It=20 > tends to "annoy" people.. :) >=20 > Regards, >=20 > ..Remy >=20 >=20 > ::DISCLAIMER:: > ---------------------------------------------------------------------- > ---------------------------------------------------------------------- > -------- >=20 > The contents of this e-mail and any attachment(s) are confidential and in= tended for the named recipient(s) only. > E-mail transmission is not guaranteed to be secure or error-free as=20 > information could be intercepted, corrupted, lost, destroyed, arrive=20 > late or incomplete, or may contain viruses in transmission. The e mail an= d 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=20 > the author and may not necessarily reflect the views or opinions of=20 > HCL or its affiliates. Any form of reproduction, dissemination,=20 > copying, disclosure, modification, distribution and / or publication of t= his message without the prior written consent of authorized representative = of HCL is strictly prohibited. If you have received this email in error ple= ase delete it and notify the sender immediately. > Before opening any email and/or attachments, please check them for viruse= s and other defects. >=20 > ---------------------------------------------------------------------- > ---------------------------------------------------------------------- > -------- >=20