* [dpdk-dev] Client Server Application using DPDK API @ 2016-03-09 8:45 Vivek Gupta 2016-03-09 16:44 ` Remy Horton 0 siblings, 1 reply; 5+ messages in thread From: Vivek Gupta @ 2016-03-09 8:45 UTC (permalink / raw) To: dev 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? I have installed the DPDK and able to run sample program. Any help is highly appreciated on this. Thanks & Regards Vivek Gupta ::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. ---------------------------------------------------------------------------------------------------------------------------------------------------- ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] Client Server Application using DPDK API 2016-03-09 8:45 [dpdk-dev] Client Server Application using DPDK API Vivek Gupta @ 2016-03-09 16:44 ` Remy Horton 2016-03-15 9:06 ` Vivek Gupta 0 siblings, 1 reply; 5+ messages in thread From: Remy Horton @ 2016-03-09 16:44 UTC (permalink / raw) To: Vivek Gupta; +Cc: dev '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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] Client Server Application using DPDK API 2016-03-09 16:44 ` Remy Horton @ 2016-03-15 9:06 ` Vivek Gupta 2016-03-15 10:41 ` Bruce Richardson 0 siblings, 1 reply; 5+ messages in thread From: Vivek Gupta @ 2016-03-15 9:06 UTC (permalink / raw) To: dev 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? 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. ---------------------------------------------------------------------------------------------------------------------------------------------------- ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] Client Server Application using DPDK API 2016-03-15 9:06 ` Vivek Gupta @ 2016-03-15 10:41 ` Bruce Richardson 2016-03-15 11:00 ` Vivek Gupta 0 siblings, 1 reply; 5+ messages in thread From: Bruce Richardson @ 2016-03-15 10:41 UTC (permalink / raw) To: Vivek Gupta; +Cc: dev 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. > > ---------------------------------------------------------------------------------------------------------------------------------------------------- > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] Client Server Application using DPDK API 2016-03-15 10:41 ` Bruce Richardson @ 2016-03-15 11:00 ` Vivek Gupta 0 siblings, 0 replies; 5+ messages in thread From: Vivek Gupta @ 2016-03-15 11:00 UTC (permalink / raw) To: Bruce Richardson, dev Hi Thanks for your prompt reply. As per my understanding rte_mbuf structure contains information of many header and their corresponding values. Like Ethernet, IP and UDP Headers. I would like to know what are the other headers information is available and how to extract those information from packet. Thanks & Regards Vivek Gupta -----Original Message----- From: Bruce Richardson [mailto:bruce.richardson@intel.com] 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 > > 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. > > ---------------------------------------------------------------------- > ---------------------------------------------------------------------- > -------- > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-15 11:00 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-03-09 8:45 [dpdk-dev] Client Server Application using DPDK API Vivek Gupta 2016-03-09 16:44 ` Remy Horton 2016-03-15 9:06 ` Vivek Gupta 2016-03-15 10:41 ` Bruce Richardson 2016-03-15 11:00 ` Vivek Gupta
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).