[dpdk-dev] Client Server Application using DPDK API

2016-03-09 Thread Vivek Gupta
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.




[dpdk-dev] Client Server Application using DPDK API

2016-03-15 Thread Vivek Gupta
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.hor...@intel.com] 
Sent: Wednesday, March 09, 2016 10:14 PM
To: Vivek Gupta
Cc: dev at 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.





[dpdk-dev] Client Server Application using DPDK API

2016-03-15 Thread Vivek Gupta
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.richard...@intel.com] 
Sent: Tuesday, March 15, 2016 4:12 PM
To: Vivek Gupta
Cc: dev at 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 at intel.com]
> Sent: Wednesday, March 09, 2016 10:14 PM
> To: Vivek Gupta
> Cc: dev at 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.
> 
> --
> --
> 
> 


[dpdk-dev] L2 Forwarding Sample Applications

2016-03-18 Thread Vivek Gupta
Please let me know the purpose of writing these sample applications in DPDK-

* L2fwd-keepalive/main.c

* L2fwd-jobstats/main.c

* L2fwd-ivshmem/guest/guest.c

* L2fwd-ivshmem/host/host.c

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.




[dpdk-dev] Regarding DPDK installation

2016-03-22 Thread Vivek Gupta
Hi

>Do you just want to compile DPDK or really install it?Where do you want to 
>install DPDK?
I want to install DPDK into {$HOME}/dpdk   downloaded tar ball.

> The install directory is not specified in this command.
 After your suggestion i used as 
make config T=x86_64-ivshmem-linuxapp-gcc DESTDIR=install 

and it successfully creates a install directory and libraries into it.
Doing so would require any change for RTE_SDK and RTE_TARGET?

Thanks && Regards
Vivek Gupta

From: Thomas Monjalon [thomas.monja...@6wind.com]
Sent: Tuesday, March 22, 2016 7:06 PM
To: Vivek Gupta
Cc: dev at dpdk.org
Subject: Re: Regarding DPDK installation

2016-03-22 13:13, Vivek Gupta:
> I am trying to install DPDK 2.2 on Ubuntu 14.

Do you just want to compile DPDK or really install it?
Where do you want to install DPDK?

> After configuring all necessary variables in common_linuxapp
> file, I run following two commands
>
> make config T=x86_64-ivshmem-linuxapp-gcc

The "make config" command is useless if using "install T=" after.

> make install T=x86_64-ivshmem-linuxapp-gcc

The install directory is not specified in this command.

> After 'make install T=x86_64-ivshmem-linuxapp-gcc' , installation fails with 
> message as below
>
> **
> Build complete [x86_64-native-linuxapp-gcc]
> Installation cannot run with T defined and DESTDIR undefined
> **

Why don't you use DESTDIR as suggested?

Or instead of using the old all-in-one "install T=", you can use
the more standard syntax in 3 commands:
make config T=

make
make install [DESTDIR=] [prefix=]

> I have gone through following patches:
> http://dpdk.org/dev/patchwork/patch/9270/
> http://dpdk.org/dev/patchwork/patch/9272/
> More interestingly  I found that changes suggested in above patches
> were already in place except of below two-
> addition of 'prefix' in file .../doc/build-sdk-quick-txt  [ Applied in ]
> addition of  'make install T=X86_64-native-linuxapp-gcc'  in file 
> ../doc/guides/prog_guide/dev_kit_root_make_help.rst

These patches have been Superseded by newer (see the State field).

> In file doc/guides/prog_guide/dev_kit_root_make_help.rst , I had "make 
> install DESTDIR=myinstall" which i replaced with "make install 
> DESTDIR=myinstall prefix=/usr"and tried but no success
>  so change the content as suggested in patch#9270 as "make install 
> T=x86_64-native-linuxapp-gcc prefix=/usr" but no progress.
>
> Kindly suggest to solve this issue.

Please read the whole doc/guides/prog_guide/dev_kit_root_make_help.rst
and don't hesitate to suggest any change if something is not clear.
Thanks

> ::DISCLAIMER::
[...]

no disclaimer please


::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.





[dpdk-dev] Port 0 Link Down - L2fwd sample application

2016-04-07 Thread Vivek Gupta
Hi

I have binded eth0 and eth1 with DPDK and then tried to run the l2fwd example 
as below

./build/l2fwd -c f -n 4 -- -q 8 -p 0x11  but each time I get error
*
Checking link status..
Port 0 Link Down
Port 1 Link Down


I tried with test-pmd example but same result.Could you please help to up the 
link?

Port status is as below-
Network devices using DPDK-compatible driver

:01:00.0 'Ethernet Controller 10-Gigabit X540-AT2' drv=uio_pci_generic 
unused=igb_uio
:01:00.1 'Ethernet Controller 10-Gigabit X540-AT2' drv=uio_pci_generic 
unused=igb_uio
:06:00.0 'Ethernet Controller 10-Gigabit X540-AT2' drv=uio_pci_generic 
unused=igb_uio
:06:00.1 'Ethernet Controller 10-Gigabit X540-AT2' drv=uio_pci_generic 
unused=igb_uio

Network devices using kernel driver
===
:81:00.0 'Ethernet Controller 10-Gigabit X540-AT2' if=eth4 drv=ixgbe 
unused=igb_uio,uio_pci_generic 
:81:00.1 'Ethernet Controller 10-Gigabit X540-AT2' if=eth5 drv=ixgbe 
unused=igb_uio,uio_pci_generic 

Other network devices
=



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.





[dpdk-dev] Port 0 Link Down - L2fwd sample application

2016-04-07 Thread Vivek Gupta
I have installed DPDK 2.2 version and didn?t build source coe.

From: Marc Sune [mailto:marcde...@gmail.com]
Sent: Thursday, April 07, 2016 6:27 PM
To: Vivek Gupta 
Cc: dev at dpdk.org
Subject: Re: [dpdk-dev] Port 0 Link Down - L2fwd sample application



2016-04-07 14:50 GMT+02:00 Vivek Gupta mailto:vivek-g at 
hcl.com>>:
Hi

I have binded eth0 and eth1 with DPDK and then tried to run the l2fwd example 
as below

./build/l2fwd -c f -n 4 -- -q 8 -p 0x11  but each time I get error
*
Checking link status..
Port 0 Link Down
Port 1 Link Down


I tried with test-pmd example but same result.Could you please help to up the 
link?

Port status is as below-
Network devices using DPDK-compatible driver

:01:00.0 'Ethernet Controller 10-Gigabit X540-AT2' drv=uio_pci_generic 
unused=igb_uio
:01:00.1 'Ethernet Controller 10-Gigabit X540-AT2' drv=uio_pci_generic 
unused=igb_uio
:06:00.0 'Ethernet Controller 10-Gigabit X540-AT2' drv=uio_pci_generic 
unused=igb_uio
:06:00.1 'Ethernet Controller 10-Gigabit X540-AT2' drv=uio_pci_generic 
unused=igb_uio

Network devices using kernel driver
===
:81:00.0 'Ethernet Controller 10-Gigabit X540-AT2' if=eth4 drv=ixgbe 
unused=igb_uio,uio_pci_generic
:81:00.1 'Ethernet Controller 10-Gigabit X540-AT2' if=eth5 drv=ixgbe 
unused=igb_uio,uio_pci_generic

Other network devices
=



Thanks & Regards
Vivek Gupta

In which commit or version are you?

Marc



::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.





[dpdk-dev] How to bind VM's NIC to OVS

2016-04-27 Thread Vivek Gupta
Hi All

I am testing a scenario where I will receive the traffic on DPDK binded port on 
host machine and will forward that traffic to DPDK binded port of VM machine. 
For this I have done the followings-
1.  Binded eth0 and eth1 of host machine to DPDK
2.  Created the OVS bridge in host machine as below
$OVS_DIR/utilities/ovs-vsctl  add-br ovsbr0 -- set Bridge ovsbr0 
datapath_type=netdev 
$OVS_DIR/utilities/ovs-vsctl  add-port ovsbr0 dpdk0 -- set Interface dpdk0   
type=dpdk 
$OVS_DIR/utilities/ovs-vsctl  add-port ovsbr0 dpdk1 -- set Interface dpdk1   
type=dpdk 

3. Installed the VM and created virtual NIC(eth4, eth5)
4. Binded VM machine NIC to VM's DPDK 

Now I am not able to understand how to attach VM's NIC to OVS?

To solve this I tried below command on HOST MACHINE
$OVS_DIR/utilities/ovs-vsctl  add-port ovsbr0 dpdk4 -- set Interface dpdk4   
type=dpdk 
$OVS_DIR/utilities/ovs-vsctl  add-port ovsbr0 dpdk5 -- set Interface dpdk5   
type=dpdk 

but got error "Cannot get interface dpdk4". I believe this is due to OVS is 
looking in host machine for interface "dpdk4 & dpdk5" although these interface 
are available in VM machine.

Do I need QEMU, if yes then how it will help.

Please suggest.

Thanks & Regards
Vivek Gupta
9971514343


::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.