[dpdk-dev] Query regarding multiple processes in DPDK

2013-11-25 Thread Prashant Upadhyaya
Hi Bruce,

One more question --

Suppose the first instance comes up as primary and creates the mbuf pool and 
rings etc. [ok]
Now, the second instance comes up as secondary and does the corresponding 
lookup functions [ok]
Now the primary exits -- at this point can the secondary still run with all the 
memory to which it had done the lookup intact, or does the fact that primary 
died will lead to all the memory also taken away with it so that the secondary 
can no longer function now ?

Regards
-Prashant


-Original Message-
From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Prashant Upadhyaya
Sent: Friday, November 22, 2013 7:16 PM
To: Richardson, Bruce; dev at dpdk.org
Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK

Thanks Bruce, I think your suggested example of multi_process answers my 
questions.

Regards
-Prashant


-Original Message-
From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Prashant Upadhyaya
Sent: Friday, November 22, 2013 7:10 PM
To: Richardson, Bruce; dev at dpdk.org
Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK

Hi Bruce,

Thanks.

Regarding your comment --
[BR] It will depend upon the application, but in most cases you probably want 
to have slightly different code paths for primary and secondary instances. For 
example, if a process is running as primary instance, it will probably call 
rte_mempool_create or rte_ring_create. A secondary instance which wants to use 
these should instead call rte_mempool_lookup and rte_ring_lookup instead.
For an example of how to write the one binary to be used as both primary and 
secondary process, I suggest looking at the symmetric_mp example application in 
the examples/multi_process/ directory.

I was really hoping that the --proc-type=auto, would make the DPDK libraries 
internally resolving all this stuff, is that not the case ? I have not started 
reading the code for all this yet.
I must launch the same executable twice in my usecase. Even if the executable 
code has to make different calls when it comes up as secondary, is there a way 
for the usercode to know that it has really come up as secondary when the 
--proc-type=auto is used ?

Regards
-Prashant

-Original Message-
From: Richardson, Bruce [mailto:bruce.richard...@intel.com]
Sent: Friday, November 22, 2013 7:02 PM
To: Prashant Upadhyaya; dev at dpdk.org
Subject: RE: Query regarding multiple processes in DPDK

Hi Prashant

> ===
> The EAL also supports an auto-detection mode (set by EAL
> --proc-type=auto flag), whereby an Intel(r) DPDK process is started as
> a secondary instance if a primary instance is already running.
> ===
>
> So does this mean that if I have a DPDK exe foo.out, then when I run
> the first instance of foo.out with -proc-type = auto, then foo.out
> will run as a primary process and when I spawn the second instance of
> foo.out (with first already running) again with -proc-type=auto, then
> this second instance automatically becomes secondary ?
[BR] Yes, that is the idea.

>
> Also is there any user code initialization change required or exactly
> the same code will work for both the processes ?
[BR] It will depend upon the application, but in most cases you probably want 
to have slightly different code paths for primary and secondary instances. For 
example, if a process is running as primary instance, it will probably call 
rte_mempool_create or rte_ring_create. A secondary instance which wants to use 
these should instead call rte_mempool_lookup and rte_ring_lookup instead.
For an example of how to write the one binary to be used as both primary and 
secondary process, I suggest looking at the symmetric_mp example application in 
the examples/multi_process/ directory.

Regards,
/Bruce





===
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===




===
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===




===
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===


[dpdk-dev] 82599 TX IP checksum offloading

2013-11-25 Thread chen_lp
Hi,
I want NIC to calculate ip checksum on dpdk-1.5.0,

I have set:
static const struct rte_eth_txconf tx_conf = {
.tx_thresh = {
.pthresh = TX_PTHRESH,
.hthresh = TX_HTHRESH,
.wthresh = TX_WTHRESH,
},
.tx_free_thresh = 0, 
.tx_rs_thresh = 0, 
.txq_flags = 0,
};
this struct is used by int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t 
tx_queue_id,
  uint16_t nb_tx_desc, unsigned int socket_id,
  const struct rte_eth_txconf **tx_conf*);

when constructing the pkt will been sending:

mbuf->ol_flags|=(PKT_TX_IP_CKSUM|PKT_RX_IPV4_HDR);  
  |~
mbuf->pkt.vlan_macip.f.l2_len = sizeof(struct ether_hdr);   
  |~
mbuf->pkt.vlan_macip.f.l3_len = sizeof(struct ipv4_hdr); 


but the NIC not calculate ip checksum,did anyone tell me what's wrong whith it?
by the way,I create multi-queue for tx and rx.


Thanks,
chen_lp

---
Confidentiality Notice: The information contained in this e-mail and any 
accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential 
and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of 
this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, 
disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this 
communication in error,please 
immediately notify the sender by return e-mail, and delete the original message 
and all copies from 
your system. Thank you. 
---


[dpdk-dev] 82599 TX IP checksum offloading

2013-11-25 Thread Daniel Kaminsky
chen_Ip,

You shoudln't use PKT_RX_IPV4_HDR, either just PKT_TX_IP_CKSUM or some
other combination of PKT_TX_* (e.g. PKT_TX_OFFLOAD_MASK)

Daniel


On Mon, Nov 25, 2013 at 8:23 AM, chen_lp  wrote:

> Hi,
> I want NIC to calculate ip checksum on dpdk-1.5.0,
>
> I have set:
> static const struct rte_eth_txconf tx_conf = {
> .tx_thresh = {
> .pthresh = TX_PTHRESH,
> .hthresh = TX_HTHRESH,
> .wthresh = TX_WTHRESH,
> },
> .tx_free_thresh = 0,
> .tx_rs_thresh = 0,
> .txq_flags = 0,
> };
> this struct is used by int rte_eth_tx_queue_setup(uint8_t port_id,
> uint16_t tx_queue_id,
>   uint16_t nb_tx_desc, unsigned int
> socket_id,
>   const struct rte_eth_txconf **tx_conf*);
>
> when constructing the pkt will been sending:
>
> mbuf->ol_flags|=(PKT_TX_IP_CKSUM|PKT_RX_IPV4_HDR);
>|~
> mbuf->pkt.vlan_macip.f.l2_len = sizeof(struct ether_hdr);
> |~
> mbuf->pkt.vlan_macip.f.l3_len = sizeof(struct ipv4_hdr);
>
>
> but the NIC not calculate ip checksum,did anyone tell me what's wrong
> whith it?
> by the way,I create multi-queue for tx and rx.
>
>
> Thanks,
> chen_lp
>
>
> ---
> Confidentiality Notice: The information contained in this e-mail and any
> accompanying attachment(s)
> is intended only for the use of the intended recipient and may be
> confidential and/or privileged of
> Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader
> of this communication is
> not the intended recipient, unauthorized use, forwarding, printing,
>  storing, disclosure or copying
> is strictly prohibited, and may be unlawful.If you have received this
> communication in error,please
> immediately notify the sender by return e-mail, and delete the original
> message and all copies from
> your system. Thank you.
>
> ---
>


[dpdk-dev] Query regarding multiple processes in DPDK

2013-11-25 Thread Richardson, Bruce
If the primary process dies:
a) The memory does not go away, so the second process can still use it
b) When restarting the primary process, you should restart it as a secondary 
one, to ensure it reattaches to memory properly instead of trying to 
re-initialize it.

Regards
/Bruce

> -Original Message-
> From: Prashant Upadhyaya [mailto:prashant.upadhyaya at aricent.com]
> Sent: Monday, November 25, 2013 4:08 AM
> To: Richardson, Bruce; dev at dpdk.org
> Subject: RE: Query regarding multiple processes in DPDK
> 
> Hi Bruce,
> 
> One more question --
> 
> Suppose the first instance comes up as primary and creates the mbuf pool
> and rings etc. [ok] Now, the second instance comes up as secondary and
> does the corresponding lookup functions [ok] Now the primary exits -- at
> this point can the secondary still run with all the memory to which it had
> done the lookup intact, or does the fact that primary died will lead to all 
> the
> memory also taken away with it so that the secondary can no longer
> function now ?
> 
> Regards
> -Prashant
> 
> 
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Prashant
> Upadhyaya
> Sent: Friday, November 22, 2013 7:16 PM
> To: Richardson, Bruce; dev at dpdk.org
> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
> 
> Thanks Bruce, I think your suggested example of multi_process answers my
> questions.
> 
> Regards
> -Prashant
> 
> 
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Prashant
> Upadhyaya
> Sent: Friday, November 22, 2013 7:10 PM
> To: Richardson, Bruce; dev at dpdk.org
> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
> 
> Hi Bruce,
> 
> Thanks.
> 
> Regarding your comment --
> [BR] It will depend upon the application, but in most cases you probably
> want to have slightly different code paths for primary and secondary
> instances. For example, if a process is running as primary instance, it will
> probably call rte_mempool_create or rte_ring_create. A secondary instance
> which wants to use these should instead call rte_mempool_lookup and
> rte_ring_lookup instead.
> For an example of how to write the one binary to be used as both primary
> and secondary process, I suggest looking at the symmetric_mp example
> application in the examples/multi_process/ directory.
> 
> I was really hoping that the --proc-type=auto, would make the DPDK
> libraries internally resolving all this stuff, is that not the case ? I have 
> not
> started reading the code for all this yet.
> I must launch the same executable twice in my usecase. Even if the
> executable code has to make different calls when it comes up as secondary,
> is there a way for the usercode to know that it has really come up as
> secondary when the --proc-type=auto is used ?
> 
> Regards
> -Prashant
> 
> -Original Message-
> From: Richardson, Bruce [mailto:bruce.richardson at intel.com]
> Sent: Friday, November 22, 2013 7:02 PM
> To: Prashant Upadhyaya; dev at dpdk.org
> Subject: RE: Query regarding multiple processes in DPDK
> 
> Hi Prashant
> 
> > ===
> > The EAL also supports an auto-detection mode (set by EAL
> > --proc-type=auto flag), whereby an Intel(r) DPDK process is started as
> > a secondary instance if a primary instance is already running.
> > ===
> >
> > So does this mean that if I have a DPDK exe foo.out, then when I run
> > the first instance of foo.out with -proc-type = auto, then foo.out
> > will run as a primary process and when I spawn the second instance of
> > foo.out (with first already running) again with -proc-type=auto, then
> > this second instance automatically becomes secondary ?
> [BR] Yes, that is the idea.
> 
> >
> > Also is there any user code initialization change required or exactly
> > the same code will work for both the processes ?
> [BR] It will depend upon the application, but in most cases you probably
> want to have slightly different code paths for primary and secondary
> instances. For example, if a process is running as primary instance, it will
> probably call rte_mempool_create or rte_ring_create. A secondary instance
> which wants to use these should instead call rte_mempool_lookup and
> rte_ring_lookup instead.
> For an example of how to write the one binary to be used as both primary
> and secondary process, I suggest looking at the symmetric_mp example
> application in the examples/multi_process/ directory.
> 
> Regards,
> /Bruce
> 
> 
> 
> 
> 
> ==
> =
> Please refer to http://www.aricent.com/legal/email_disclaimer.html
> for important disclosures regarding this electronic communication.
> ==
> =
> 
> 
> 
> 
> ==
> =
> Please refer to http://www.aricent.com/legal/email_disclaimer.html
> for important disclosure

[dpdk-dev] [dpdk-announce] DPDK 1.5.1r1 released

2013-11-25 Thread Thomas Monjalon
The new release can be downloaded here:
http://dpdk.org/browse/dpdk/tag/?id=v1.5.1r1

Since 1.5.0 releases, the most important changes are:
- new supported devices (i354 and 82599 bypass)
- e1000 base driver updated
- KNI fixed for X540
- MAC control frame forwarding
- various build fixes

This r1 drop is a maintenance release on top of 1.5.1r0.

Thank you to everyone,
-- 
Thomas


[dpdk-dev] Query regarding multiple processes in DPDK

2013-11-25 Thread Prashant Upadhyaya
Hi Bruce,

Thanks, this was very useful information.

Regards
-Prashant


-Original Message-
From: Richardson, Bruce [mailto:bruce.richard...@intel.com]
Sent: Monday, November 25, 2013 2:59 PM
To: Prashant Upadhyaya; dev at dpdk.org
Subject: RE: Query regarding multiple processes in DPDK

If the primary process dies:
a) The memory does not go away, so the second process can still use it
b) When restarting the primary process, you should restart it as a secondary 
one, to ensure it reattaches to memory properly instead of trying to 
re-initialize it.

Regards
/Bruce

> -Original Message-
> From: Prashant Upadhyaya [mailto:prashant.upadhyaya at aricent.com]
> Sent: Monday, November 25, 2013 4:08 AM
> To: Richardson, Bruce; dev at dpdk.org
> Subject: RE: Query regarding multiple processes in DPDK
>
> Hi Bruce,
>
> One more question --
>
> Suppose the first instance comes up as primary and creates the mbuf
> pool and rings etc. [ok] Now, the second instance comes up as
> secondary and does the corresponding lookup functions [ok] Now the
> primary exits -- at this point can the secondary still run with all
> the memory to which it had done the lookup intact, or does the fact
> that primary died will lead to all the memory also taken away with it
> so that the secondary can no longer function now ?
>
> Regards
> -Prashant
>
>
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Prashant
> Upadhyaya
> Sent: Friday, November 22, 2013 7:16 PM
> To: Richardson, Bruce; dev at dpdk.org
> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
>
> Thanks Bruce, I think your suggested example of multi_process answers
> my questions.
>
> Regards
> -Prashant
>
>
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Prashant
> Upadhyaya
> Sent: Friday, November 22, 2013 7:10 PM
> To: Richardson, Bruce; dev at dpdk.org
> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
>
> Hi Bruce,
>
> Thanks.
>
> Regarding your comment --
> [BR] It will depend upon the application, but in most cases you
> probably want to have slightly different code paths for primary and
> secondary instances. For example, if a process is running as primary
> instance, it will probably call rte_mempool_create or rte_ring_create.
> A secondary instance which wants to use these should instead call
> rte_mempool_lookup and rte_ring_lookup instead.
> For an example of how to write the one binary to be used as both
> primary and secondary process, I suggest looking at the symmetric_mp
> example application in the examples/multi_process/ directory.
>
> I was really hoping that the --proc-type=auto, would make the DPDK
> libraries internally resolving all this stuff, is that not the case ?
> I have not started reading the code for all this yet.
> I must launch the same executable twice in my usecase. Even if the
> executable code has to make different calls when it comes up as
> secondary, is there a way for the usercode to know that it has really
> come up as secondary when the --proc-type=auto is used ?
>
> Regards
> -Prashant
>
> -Original Message-
> From: Richardson, Bruce [mailto:bruce.richardson at intel.com]
> Sent: Friday, November 22, 2013 7:02 PM
> To: Prashant Upadhyaya; dev at dpdk.org
> Subject: RE: Query regarding multiple processes in DPDK
>
> Hi Prashant
>
> > ===
> > The EAL also supports an auto-detection mode (set by EAL
> > --proc-type=auto flag), whereby an Intel(r) DPDK process is started
> > as a secondary instance if a primary instance is already running.
> > ===
> >
> > So does this mean that if I have a DPDK exe foo.out, then when I run
> > the first instance of foo.out with -proc-type = auto, then foo.out
> > will run as a primary process and when I spawn the second instance
> > of foo.out (with first already running) again with -proc-type=auto,
> > then this second instance automatically becomes secondary ?
> [BR] Yes, that is the idea.
>
> >
> > Also is there any user code initialization change required or
> > exactly the same code will work for both the processes ?
> [BR] It will depend upon the application, but in most cases you
> probably want to have slightly different code paths for primary and
> secondary instances. For example, if a process is running as primary
> instance, it will probably call rte_mempool_create or rte_ring_create.
> A secondary instance which wants to use these should instead call
> rte_mempool_lookup and rte_ring_lookup instead.
> For an example of how to write the one binary to be used as both
> primary and secondary process, I suggest looking at the symmetric_mp
> example application in the examples/multi_process/ directory.
>
> Regards,
> /Bruce
>
>
>
>
>
> ==
> =
> Please refer to http://www.aricent.com/legal/email_disclaimer.html
> for important disclosures regarding this electronic communication.
> 

[dpdk-dev] Regarding VM live migration with SRIOV

2013-11-25 Thread Prashant Upadhyaya
Hi guys,

I have a VM on top of QEMU/KVM hypervisor. Guest and Host are both Fedora 18.
I am using 82599 NIC with SRIOV based VF's in the VM.
In VM I am running a DPDK based application which uses the VF.

Now I have to do a live migration of the running VM from one physical machine 
to the other.

Right, so has anybody tried it before in the above environment. If yes, would 
love to hear from you and learn from your experience of doing it instead of 
making the same mistakes and learning the hard way.

Regards
-Prashant





===
Please refer to http://www.aricent.com/legal/email_disclaimer.html
for important disclosures regarding this electronic communication.
===


[dpdk-dev] Query regarding multiple processes in DPDK

2013-11-25 Thread Jeff Venable, Sr.
The memory configuration will persist while the files describing them do.
By default, these are located in /var/run/.rte_config and
/var/run/.rte_hugepage_info.  Even if you terminate all processes, you can
still launch new secondary processes which will find those files and
attach, and unless something is messing with your huge pages the memory
state will be as it was left before.  The logic for these file locations
is in lib/librte_eal/linuxapp/eal/include/eal_filesystem.h if you want to
review the code.  You can search the rest of the code for calls to these
functions to locate the logic regarding what?s stored in the files.

Jeff

On 11/25/13, 5:57 AM, "Prashant Upadhyaya"
 wrote:

>Hi Bruce,
>
>Thanks, this was very useful information.
>
>Regards
>-Prashant
>
>
>-Original Message-
>From: Richardson, Bruce [mailto:bruce.richardson at intel.com]
>Sent: Monday, November 25, 2013 2:59 PM
>To: Prashant Upadhyaya; dev at dpdk.org
>Subject: RE: Query regarding multiple processes in DPDK
>
>If the primary process dies:
>a) The memory does not go away, so the second process can still use it
>b) When restarting the primary process, you should restart it as a
>secondary one, to ensure it reattaches to memory properly instead of
>trying to re-initialize it.
>
>Regards
>/Bruce
>
>> -Original Message-
>> From: Prashant Upadhyaya [mailto:prashant.upadhyaya at aricent.com]
>> Sent: Monday, November 25, 2013 4:08 AM
>> To: Richardson, Bruce; dev at dpdk.org
>> Subject: RE: Query regarding multiple processes in DPDK
>>
>> Hi Bruce,
>>
>> One more question --
>>
>> Suppose the first instance comes up as primary and creates the mbuf
>> pool and rings etc. [ok] Now, the second instance comes up as
>> secondary and does the corresponding lookup functions [ok] Now the
>> primary exits -- at this point can the secondary still run with all
>> the memory to which it had done the lookup intact, or does the fact
>> that primary died will lead to all the memory also taken away with it
>> so that the secondary can no longer function now ?
>>
>> Regards
>> -Prashant
>>
>>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Prashant
>> Upadhyaya
>> Sent: Friday, November 22, 2013 7:16 PM
>> To: Richardson, Bruce; dev at dpdk.org
>> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
>>
>> Thanks Bruce, I think your suggested example of multi_process answers
>> my questions.
>>
>> Regards
>> -Prashant
>>
>>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Prashant
>> Upadhyaya
>> Sent: Friday, November 22, 2013 7:10 PM
>> To: Richardson, Bruce; dev at dpdk.org
>> Subject: Re: [dpdk-dev] Query regarding multiple processes in DPDK
>>
>> Hi Bruce,
>>
>> Thanks.
>>
>> Regarding your comment --
>> [BR] It will depend upon the application, but in most cases you
>> probably want to have slightly different code paths for primary and
>> secondary instances. For example, if a process is running as primary
>> instance, it will probably call rte_mempool_create or rte_ring_create.
>> A secondary instance which wants to use these should instead call
>> rte_mempool_lookup and rte_ring_lookup instead.
>> For an example of how to write the one binary to be used as both
>> primary and secondary process, I suggest looking at the symmetric_mp
>> example application in the examples/multi_process/ directory.
>>
>> I was really hoping that the --proc-type=auto, would make the DPDK
>> libraries internally resolving all this stuff, is that not the case ?
>> I have not started reading the code for all this yet.
>> I must launch the same executable twice in my usecase. Even if the
>> executable code has to make different calls when it comes up as
>> secondary, is there a way for the usercode to know that it has really
>> come up as secondary when the --proc-type=auto is used ?
>>
>> Regards
>> -Prashant
>>
>> -Original Message-
>> From: Richardson, Bruce [mailto:bruce.richardson at intel.com]
>> Sent: Friday, November 22, 2013 7:02 PM
>> To: Prashant Upadhyaya; dev at dpdk.org
>> Subject: RE: Query regarding multiple processes in DPDK
>>
>> Hi Prashant
>>
>> > ===
>> > The EAL also supports an auto-detection mode (set by EAL
>> > --proc-type=auto flag), whereby an Intel(r) DPDK process is started
>> > as a secondary instance if a primary instance is already running.
>> > ===
>> >
>> > So does this mean that if I have a DPDK exe foo.out, then when I run
>> > the first instance of foo.out with -proc-type = auto, then foo.out
>> > will run as a primary process and when I spawn the second instance
>> > of foo.out (with first already running) again with -proc-type=auto,
>> > then this second instance automatically becomes secondary ?
>> [BR] Yes, that is the idea.
>>
>> >
>> > Also is there any user code initialization change required or
>> > exactly the same code will work for both the processes ?
>> [BR] It will depend upon the application, but in m

[dpdk-dev] Measuring latency

2013-11-25 Thread Jun Han
Hi,

Does anyone know if there is a DPDK provided tool to measure latency of a
packet traversal (i.e., when a packet is copied from the NIC to userspace)?
Also, we are using rdtsc to measure processing delay in the userspace
currently, but does anyone else have suggestions/experiences for other
tools? Additionally, we want to locate the latency bottleneck. Has anyone
looked into this? Would you share your experiences please?

Thank you very much.

Jun


[dpdk-dev] Running load balancer sample app

2013-11-25 Thread Pashupati Kumar
Hi,
I am trying to run the load balancer sample application included in the DPDK.  
I am looking at the relevant section in Sample Applications User Guide. There 
is mention of test report ( Please see the snippet below)

For examples of application command lines and traffic generator flows, please 
refer to
the Intel(r) DPDK Test Report.

How & Where do I get this document? Can someone also suggest what traffic 
generator tool should I use?

Thanks
Pash