[dpdk-dev] [PATCH] examples: add a new example for link reset

2016-06-12 Thread Lu, Wenzhuo
Hi Konstantin, Thomas,

> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Wednesday, June 8, 2016 5:00 PM
> To: Ananyev, Konstantin; Lu, Wenzhuo
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] examples: add a new example for link reset
> 
> 2016-06-08 08:37, Ananyev, Konstantin:
> > > From: Ananyev, Konstantin
> > > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wenzhuo Lu
> > > > > Add a new example to show when the PF is down and up, VF port
> > > > > can be reset and recover.
> > > >
> > > > Do we really need a totally new example for it?
> > > > Can't we put it in one of already existing ones?
> > > > Let say we have l3fwd-vf... wouldn't that suit your needs?
> > > > Konstantin
> > > I thought about just modifying an existing example. But I choose to
> > > add a new one at last. The benefit of a totally new example is we can 
> > > make it
> simple enough and focus on the reset function.
> > > So it's easier for the users to find what we want to show. And it's
> > > also easier for us as we don't need to care about if our
> > > modification will break some function of the original example :)
> >
> > I still think that adding a new example for esch new feature/function in
> rte_ethdev API iw way too expensive.
> > If your change is not good enough and will break original example,
> > then you probably re-work your feature patch to make it stable enough.
> > After all people will use it in their existing apps, not write the new ones 
> > right?
> > BTW, why not make it work with testpmd?
> > After all it is a new PMD api, an that's for we have our testpmd here?
> 
> +1 for testpmd

I may not make myself clear. I said "function" but actually I mainly mean the 
performance impact but not the functionality. As we know l2fwd and l3fwd can be 
used to show the performance of DPDK, adding lock will break this function, 
showing the performance data. That's why I don't want to touch l2fwd and l3fwd.
Agree that testpmd can be a choice. I'll try to modify testpmd, maybe add a 
parameter, like "testpmd --lock". So by default we will not use lock mode.


[dpdk-dev] [PATCH] examples: add a new example for link reset

2016-06-08 Thread Thomas Monjalon
2016-06-08 08:37, Ananyev, Konstantin:
> > From: Ananyev, Konstantin
> > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wenzhuo Lu
> > > > Add a new example to show when the PF is down and up, VF port can be
> > > > reset and recover.
> > >
> > > Do we really need a totally new example for it?
> > > Can't we put it in one of already existing ones?
> > > Let say we have l3fwd-vf... wouldn't that suit your needs?
> > > Konstantin
> > I thought about just modifying an existing example. But I choose to add a 
> > new one at last. The benefit of a totally new example is we
> > can make it simple enough and focus on the reset function.
> > So it's easier for the users to find what we want to show. And it's also 
> > easier for us as we don't need to care about if our modification
> > will break some function of the original example :)
> 
> I still think that adding a new example for esch new feature/function in 
> rte_ethdev API iw way too expensive.
> If your change is not good enough and will break original example, then you 
> probably re-work your feature patch
> to make it stable enough.
> After all people will use it in their existing apps, not write the new ones 
> right?
> BTW, why not make it work with testpmd?
> After all it is a new PMD api, an that's for we have our testpmd here?

+1 for testpmd


[dpdk-dev] [PATCH] examples: add a new example for link reset

2016-06-08 Thread Ananyev, Konstantin
Hi Wenzhuo,


> Hi Konstantin,
> 
> > -Original Message-
> > From: Ananyev, Konstantin
> > Sent: Wednesday, June 8, 2016 8:25 AM
> > To: Lu, Wenzhuo; dev at dpdk.org
> > Cc: Lu, Wenzhuo
> > Subject: RE: [dpdk-dev] [PATCH] examples: add a new example for link reset
> >
> >
> >
> > > -Original Message-
> > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wenzhuo Lu
> > > Sent: Monday, June 06, 2016 6:48 AM
> > > To: dev at dpdk.org
> > > Cc: Lu, Wenzhuo
> > > Subject: [dpdk-dev] [PATCH] examples: add a new example for link reset
> > >
> > > Add a new example to show when the PF is down and up, VF port can be
> > > reset and recover.
> >
> > Do we really need a totally new example for it?
> > Can't we put it in one of already existing ones?
> > Let say we have l3fwd-vf... wouldn't that suit your needs?
> > Konstantin
> I thought about just modifying an existing example. But I choose to add a new 
> one at last. The benefit of a totally new example is we
> can make it simple enough and focus on the reset function.
> So it's easier for the users to find what we want to show. And it's also 
> easier for us as we don't need to care about if our modification
> will break some function of the original example :)

I still think that adding a new example for esch new feature/function in 
rte_ethdev API iw way too expensive.
If your change is not good enough and will break original example, then you 
probably re-work your feature patch
to make it stable enough.
After all people will use it in their existing apps, not write the new ones 
right?
BTW, why not make it work with testpmd?
After all it is a new PMD api, an that's for we have our testpmd here?
Konstantin 




[dpdk-dev] [PATCH] examples: add a new example for link reset

2016-06-08 Thread Lu, Wenzhuo
Hi Konstantin,

> -Original Message-
> From: Ananyev, Konstantin
> Sent: Wednesday, June 8, 2016 8:25 AM
> To: Lu, Wenzhuo; dev at dpdk.org
> Cc: Lu, Wenzhuo
> Subject: RE: [dpdk-dev] [PATCH] examples: add a new example for link reset
> 
> 
> 
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wenzhuo Lu
> > Sent: Monday, June 06, 2016 6:48 AM
> > To: dev at dpdk.org
> > Cc: Lu, Wenzhuo
> > Subject: [dpdk-dev] [PATCH] examples: add a new example for link reset
> >
> > Add a new example to show when the PF is down and up, VF port can be
> > reset and recover.
> 
> Do we really need a totally new example for it?
> Can't we put it in one of already existing ones?
> Let say we have l3fwd-vf... wouldn't that suit your needs?
> Konstantin
I thought about just modifying an existing example. But I choose to add a new 
one at last. The benefit of a totally new example is we can make it simple 
enough and focus on the reset function.
So it's easier for the users to find what we want to show. And it's also easier 
for us as we don't need to care about if our modification will break some 
function of the original example :)


[dpdk-dev] [PATCH] examples: add a new example for link reset

2016-06-08 Thread Ananyev, Konstantin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Monday, June 06, 2016 6:48 AM
> To: dev at dpdk.org
> Cc: Lu, Wenzhuo
> Subject: [dpdk-dev] [PATCH] examples: add a new example for link reset
> 
> Add a new example to show when the PF is down and up,
> VF port can be reset and recover.

Do we really need a totally new example for it?
Can't we put it in one of already existing ones?
Let say we have l3fwd-vf... wouldn't that suit your needs?
Konstantin

> 
> Signed-off-by: Wenzhuo Lu 
> ---
>  MAINTAINERS |   4 +
>  doc/guides/sample_app_ug/link_reset.rst | 177 
>  examples/link_reset/Makefile|  50 +++
>  examples/link_reset/main.c  | 769 
> 
>  4 files changed, 1000 insertions(+)
>  create mode 100644 doc/guides/sample_app_ug/link_reset.rst
>  create mode 100644 examples/link_reset/Makefile
>  create mode 100644 examples/link_reset/main.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 3e8558f..76879c3 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -650,3 +650,7 @@ F: examples/tep_termination/
>  F: examples/vmdq/
>  F: examples/vmdq_dcb/
>  F: doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst
> +
> +M: Wenzhuo Lu 
> +F: examples/link_reset/
> +F: doc/guides/sample_app_ug/link_reset.rst
> diff --git a/doc/guides/sample_app_ug/link_reset.rst 
> b/doc/guides/sample_app_ug/link_reset.rst
> new file mode 100644
> index 000..fecae6d
> --- /dev/null
> +++ b/doc/guides/sample_app_ug/link_reset.rst
> @@ -0,0 +1,177 @@
> +..  BSD LICENSE
> +Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
> +All rights reserved.
> +
> +Redistribution and use in source and binary forms, with or without
> +modification, are permitted provided that the following conditions
> +are met:
> +
> +* Redistributions of source code must retain the above copyright
> +notice, this list of conditions and the following disclaimer.
> +* Redistributions in binary form must reproduce the above copyright
> +notice, this list of conditions and the following disclaimer in
> +the documentation and/or other materials provided with the
> +distribution.
> +* Neither the name of Intel Corporation nor the names of its
> +contributors may be used to endorse or promote products derived
> +from this software without specific prior written permission.
> +
> +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +Link Reset Sample Application (in Virtualized Environments)
> +===
> +
> +The Link Reset sample application is a simple example of VF traffic recovery
> +using the Data Plane Development Kit (DPDK) which also takes advantage of 
> Single
> +Root I/O Virtualization (SR-IOV) features in a virtualized environment.
> +
> +Overview
> +
> +
> +The Link Reset sample application, which should operate in virtualized
> +environments, performs L2 forwarding for each packet that is received on an
> +RX_PORT.
> +This example is extended from the L2 forwarding example. Please reference the
> +example of L2 forwarding in virtualized environments for more details and
> +explanation about the behavior of forwarding and how to setup the test.
> +The purpose of this example is to show when the PF port is down and up, the 
> VF
> +port can recover and the traffic can recover too.
> +
> +Virtual Function Setup Instructions
> +~~~
> +
> +This application can use the virtual function available in the system and
> +therefore can be used in a virtual machine without passing through
> +the whole Network Device into a guest machine in a virtualized scenario.
> +The virtual functions can be enabled in the host machine or the hypervisor
> +with the respective physical function driver.
&

[dpdk-dev] [PATCH] examples: add a new example for link reset

2016-06-06 Thread Wenzhuo Lu
Add a new example to show when the PF is down and up,
VF port can be reset and recover.

Signed-off-by: Wenzhuo Lu 
---
 MAINTAINERS |   4 +
 doc/guides/sample_app_ug/link_reset.rst | 177 
 examples/link_reset/Makefile|  50 +++
 examples/link_reset/main.c  | 769 
 4 files changed, 1000 insertions(+)
 create mode 100644 doc/guides/sample_app_ug/link_reset.rst
 create mode 100644 examples/link_reset/Makefile
 create mode 100644 examples/link_reset/main.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 3e8558f..76879c3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -650,3 +650,7 @@ F: examples/tep_termination/
 F: examples/vmdq/
 F: examples/vmdq_dcb/
 F: doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst
+
+M: Wenzhuo Lu 
+F: examples/link_reset/
+F: doc/guides/sample_app_ug/link_reset.rst
diff --git a/doc/guides/sample_app_ug/link_reset.rst 
b/doc/guides/sample_app_ug/link_reset.rst
new file mode 100644
index 000..fecae6d
--- /dev/null
+++ b/doc/guides/sample_app_ug/link_reset.rst
@@ -0,0 +1,177 @@
+..  BSD LICENSE
+Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in
+the documentation and/or other materials provided with the
+distribution.
+* Neither the name of Intel Corporation nor the names of its
+contributors may be used to endorse or promote products derived
+from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Link Reset Sample Application (in Virtualized Environments)
+===
+
+The Link Reset sample application is a simple example of VF traffic recovery
+using the Data Plane Development Kit (DPDK) which also takes advantage of 
Single
+Root I/O Virtualization (SR-IOV) features in a virtualized environment.
+
+Overview
+
+
+The Link Reset sample application, which should operate in virtualized
+environments, performs L2 forwarding for each packet that is received on an
+RX_PORT.
+This example is extended from the L2 forwarding example. Please reference the
+example of L2 forwarding in virtualized environments for more details and
+explanation about the behavior of forwarding and how to setup the test.
+The purpose of this example is to show when the PF port is down and up, the VF
+port can recover and the traffic can recover too.
+
+Virtual Function Setup Instructions
+~~~
+
+This application can use the virtual function available in the system and
+therefore can be used in a virtual machine without passing through
+the whole Network Device into a guest machine in a virtualized scenario.
+The virtual functions can be enabled in the host machine or the hypervisor
+with the respective physical function driver.
+
+For example, in a Linux* host machine, it is possible to enable a virtual
+function using the following command:
+
+.. code-block:: console
+
+modprobe ixgbe max_vfs=2,2
+
+This command enables two Virtual Functions on each of Physical Function of the
+NIC, with two physical ports in the PCI configuration space.
+It is important to note that enabled Virtual Function 0 and 2 would belong to
+Physical Function 0 and Virtual Function 1 and 3 would belong to Physical
+Function 1, in this case enabling a total of four Virtual Functions.
+
+Compiling the Application
+-
+
+#.  Go to the example directory:
+
+.. code-block:: console
+
+export RTE_SDK=/path/to/rte_sdk
+cd ${RTE_SDK}/examples/link_reset
+
+#.  Set the target (a default target is used if not specified). For example:
+
+.. code-block:: console
+
+export RTE_TARGET=x86_64-native-linuxapp-gcc
+
+