Re: [ovs-dev] [PATCH v2] tests: Add system-dpdk-testsuite

2018-02-12 Thread Rybka, MarcinX
Hi Ian,

Thank you for your comments. See my comments inline below.

> -Original Message-
> From: Stokes, Ian
> Sent: Wednesday, January 31, 2018 11:40 AM
> To: Rybka, MarcinX <marcinx.ry...@intel.com>; d...@openvswitch.org
> Cc: Rybka, MarcinX <marcinx.ry...@intel.com>
> Subject: RE: [ovs-dev] [PATCH v2] tests: Add system-dpdk-testsuite
> 
> > -Original Message-
> > From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
> > boun...@openvswitch.org] On Behalf Of Marcin Rybka
> > Sent: Tuesday, January 2, 2018 2:36 PM
> > To: d...@openvswitch.org
> > Cc: Rybka, MarcinX <marcinx.ry...@intel.com>
> > Subject: [ovs-dev] [PATCH v2] tests: Add system-dpdk-testsuite
> >
> > New OVS-DPDK testsuite, which can be launched via `make check-dpdk`,
> > tests OVS using a DPDK datapath. The testsuite contains already initial
> tests:
> >  1. EAL init
> >  2. Add standard DPDK PHY port
> >  3. Add vhost-user-client port
> >
> > Signed-off-by: Marcin Rybka <marcinx.ry...@intel.com>
> > ---
> >  Documentation/topics/testing.rst | 19 
> >  tests/automake.mk| 17 +++
> >  tests/system-dpdk-macros.at  | 54
> +
> >  tests/system-dpdk-testsuite.at   | 25 
> >  tests/system-dpdk.at | 65
> > 
> >  5 files changed, 180 insertions(+)
> >  create mode 100644 tests/system-dpdk-macros.at  create mode 100644
> > tests/system-dpdk-testsuite.at  create mode 100644
> > tests/system-dpdk.at
> >
> > diff --git a/Documentation/topics/testing.rst
> > b/Documentation/topics/testing.rst
> > index a49336b..74e0d3f 100644
> > --- a/Documentation/topics/testing.rst
> > +++ b/Documentation/topics/testing.rst
> > @@ -297,6 +297,25 @@ To invoke the datapath testsuite with the
> > userspace datapath, run::
> >
> >  The results of the testsuite are in ``tests/system-userspace-
> > testsuite.dir``.
> >
> > +DPDK datapath
> > +'
> > +
> > +To test :doc:`/intro/install/dpdk` (i.e., the build was configured
> > +with ``--with-dpdk``,the ``DPDK`` is installed), run the testsuite
> > +and generate a report by using the ``check-dpdk`` target::
> > +
> > +$ make check-dpdk
> > +
> > +To see a list of all the available tests, run::
> > +
> > +$ make check-dpdk TESTSUITEFLAGS=--list
> > +
> > +These tests require a `DPDK supported NIC`_ and proper DPDK variables
> > +(``DPDK_DIR`` and ``DPDK_BUILD``). Moreover you need to load the
> > +required modules and bind the NIC to the DPDK-compatible driver.
> > +
> > +.. _DPDK supported NIC: http://dpdk.org/doc/nics
> > +
> 
> Hi Marcin,
> 
> Thanks for working on this, a few comments inline below.
> 
> These tests will require elevated privileges (root or sudo) on systems to be
> run, otherwise they will fail as memory will not be allocated etc. by 
> ovs-dpdk.
> 
> I'd like to see this called out explicitly in the documentation along with a 
> short
> explanation (it's obvious to those familiar with DPDK but we must assume a
> user may not be, also existing ovs unit test can be run without these
> privileges so someone might work from that assumption).

Such information is covered in a parent paragraphs (one level above and two 
levels above). However, I will add such information to the documentation 
explicitly.

> 
> In testing I also see the following error although it does not stop the test
> from running.
> 
> set /bin/sh './tests/system-dpdk-testsuite' -C tests
> AUTOTEST_PATH='utilities:vswitchd:ovsdb:vtep:tests::ovn/controller-
> vtep:ovn/northd:ovn/utilities:ovn/controller'  -j1; \ "$@" || (test X'' = Xyes
> && "$@" --recheck) Traceback (most recent call last):
>   File "", line 3, in 
>   File "/usr/lib64/python2.7/socket.py", line 228, in meth
> return getattr(self._sock,name)(*args)
> socket.error: [Errno 99] Cannot assign requested address
> 

I also see such error when running any other unit tests of OVS. 
So it's not related with my changes.

> >  Kernel datapath
> >  '''
> >
> > diff --git a/tests/automake.mk b/tests/automake.mk index
> > 8157641..7be5712
> > 100644
> > --- a/tests/automake.mk
> > +++ b/tests/automake.mk
> > @@ -5,10 +5,12 @@ EXTRA_DIST += \
> > $(SYSTEM_KMOD_TESTSUITE_AT) \
> > $(SYSTEM_USERSPACE_TESTSUITE_AT) \
> > $(SYSTEM_OFFLOADS_TESTSUITE_AT) \
> > +   $(SYSTEM_DPDK_TESTSUITE_A

Re: [ovs-dev] [PATCH v2] tests: Add system-dpdk-testsuite

2018-01-31 Thread Stokes, Ian
> -Original Message-
> From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
> boun...@openvswitch.org] On Behalf Of Marcin Rybka
> Sent: Tuesday, January 2, 2018 2:36 PM
> To: d...@openvswitch.org
> Cc: Rybka, MarcinX 
> Subject: [ovs-dev] [PATCH v2] tests: Add system-dpdk-testsuite
> 
> New OVS-DPDK testsuite, which can be launched via `make check-dpdk`, tests
> OVS using a DPDK datapath. The testsuite contains already initial tests:
>  1. EAL init
>  2. Add standard DPDK PHY port
>  3. Add vhost-user-client port
> 
> Signed-off-by: Marcin Rybka 
> ---
>  Documentation/topics/testing.rst | 19 
>  tests/automake.mk| 17 +++
>  tests/system-dpdk-macros.at  | 54 +
>  tests/system-dpdk-testsuite.at   | 25 
>  tests/system-dpdk.at | 65
> 
>  5 files changed, 180 insertions(+)
>  create mode 100644 tests/system-dpdk-macros.at  create mode 100644
> tests/system-dpdk-testsuite.at  create mode 100644 tests/system-dpdk.at
> 
> diff --git a/Documentation/topics/testing.rst
> b/Documentation/topics/testing.rst
> index a49336b..74e0d3f 100644
> --- a/Documentation/topics/testing.rst
> +++ b/Documentation/topics/testing.rst
> @@ -297,6 +297,25 @@ To invoke the datapath testsuite with the userspace
> datapath, run::
> 
>  The results of the testsuite are in ``tests/system-userspace-
> testsuite.dir``.
> 
> +DPDK datapath
> +'
> +
> +To test :doc:`/intro/install/dpdk` (i.e., the build was configured with
> +``--with-dpdk``,the ``DPDK`` is installed), run the testsuite and
> +generate a report by using the ``check-dpdk`` target::
> +
> +$ make check-dpdk
> +
> +To see a list of all the available tests, run::
> +
> +$ make check-dpdk TESTSUITEFLAGS=--list
> +
> +These tests require a `DPDK supported NIC`_ and proper DPDK variables
> +(``DPDK_DIR`` and ``DPDK_BUILD``). Moreover you need to load the
> +required modules and bind the NIC to the DPDK-compatible driver.
> +
> +.. _DPDK supported NIC: http://dpdk.org/doc/nics
> +

Hi Marcin,

Thanks for working on this, a few comments inline below.

These tests will require elevated privileges (root or sudo) on systems to be 
run, otherwise they will fail as memory will not be allocated etc. by ovs-dpdk.

I'd like to see this called out explicitly in the documentation along with a 
short explanation (it's obvious to those familiar with DPDK but we must assume 
a user may not be, also existing ovs unit test can be run without these 
privileges so someone might work from that assumption).

In testing I also see the following error although it does not stop the test 
from running.

set /bin/sh './tests/system-dpdk-testsuite' -C tests  
AUTOTEST_PATH='utilities:vswitchd:ovsdb:vtep:tests::ovn/controller-vtep:ovn/northd:ovn/utilities:ovn/controller'
  -j1; \
"$@" || (test X'' = Xyes && "$@" --recheck)
Traceback (most recent call last):
  File "", line 3, in 
  File "/usr/lib64/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address

>  Kernel datapath
>  '''
> 
> diff --git a/tests/automake.mk b/tests/automake.mk index 8157641..7be5712
> 100644
> --- a/tests/automake.mk
> +++ b/tests/automake.mk
> @@ -5,10 +5,12 @@ EXTRA_DIST += \
>   $(SYSTEM_KMOD_TESTSUITE_AT) \
>   $(SYSTEM_USERSPACE_TESTSUITE_AT) \
>   $(SYSTEM_OFFLOADS_TESTSUITE_AT) \
> + $(SYSTEM_DPDK_TESTSUITE_AT) \
>   $(TESTSUITE) \
>   $(SYSTEM_KMOD_TESTSUITE) \
>   $(SYSTEM_USERSPACE_TESTSUITE) \
>   $(SYSTEM_OFFLOADS_TESTSUITE) \
> + $(SYSTEM_DPDK_TESTSUITE) \
>   tests/atlocal.in \
>   $(srcdir)/package.m4 \
>   $(srcdir)/tests/testsuite \
> @@ -126,6 +128,12 @@ SYSTEM_OFFLOADS_TESTSUITE_AT = \
>   tests/system-offloads-traffic.at \
>   tests/system-offloads-testsuite.at
> 
> +SYSTEM_DPDK_TESTSUITE_AT = \
> + tests/system-common-macros.at \
> + tests/system-dpdk-macros.at \
> + tests/system-dpdk-testsuite.at \
> + tests/system-dpdk.at
> +
>  check_SCRIPTS += tests/atlocal
> 
>  TESTSUITE = $(srcdir)/tests/testsuite
> @@ -133,6 +141,7 @@ TESTSUITE_PATCH = $(srcdir)/tests/testsuite.patch
> SYSTEM_KMOD_TESTSUITE = $(srcdir)/tests/system-kmod-testsuite
>  SYSTEM_USERSPACE_TESTSUITE = $(srcdir)/tests/system-userspace-testsuite
>  SYSTEM_OFFLOADS_TESTSUITE = $(srcdir)/tests/system-offloads-testsuite
> +SYSTEM_DPDK_TESTSUITE = $(srcdir)/tests/system-dpdk-testsuite
>  DISTCLEANFILES += tests/atconfig tests/atlocal
> 
>  AUTOTEST_PATH =
> utilities:vswitchd:ovsdb:vtep:tests:$(PTHREAD_WIN32_DIR_DLL):ovn/controlle
> r-vtep:ovn/northd:ovn/utilities:ovn/controller
> @@ -256,6 +265,10 @@ check-offloads: all
>   set $(SHELL) '$(SYSTEM_OFFLOADS_TESTSUITE)' -C tests
> AUTOTEST_PATH='$(AUTOTEST_PATH)' $(TESTSUITEFLAGS) -j1; \
>   "$$@" || (test 

Re: [ovs-dev] [PATCH v2] tests: Add system-dpdk-testsuite

2018-01-10 Thread Ferriter, Cian
Hi Marcin,

Thanks for the v2 of this patch and thank you for addressing my comments. I 
have tested again with the latest master and can confirm that this works like 
in the v1 with ixgbe and i40e devices. I can also confirm that the 3rd test 
(Add vhost-user-client port) is no longer skipped when no devices are bound to 
DPDK.
The patch has passed all my tests and passes checkpatch.

Tested-by: Cian Ferriter 


> -Original Message-
> From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
> boun...@openvswitch.org] On Behalf Of Marcin Rybka
> Sent: 02 January 2018 14:36
> To: d...@openvswitch.org
> Cc: Rybka, MarcinX 
> Subject: [ovs-dev] [PATCH v2] tests: Add system-dpdk-testsuite
> 
> New OVS-DPDK testsuite, which can be launched via `make check-dpdk`,
> tests OVS using a DPDK datapath. The testsuite contains already initial tests:
>  1. EAL init
>  2. Add standard DPDK PHY port
>  3. Add vhost-user-client port
> 
> Signed-off-by: Marcin Rybka 
> ---
>  Documentation/topics/testing.rst | 19 
>  tests/automake.mk| 17 +++
>  tests/system-dpdk-macros.at  | 54
> +
>  tests/system-dpdk-testsuite.at   | 25 
>  tests/system-dpdk.at | 65
> 
>  5 files changed, 180 insertions(+)
>  create mode 100644 tests/system-dpdk-macros.at  create mode 100644
> tests/system-dpdk-testsuite.at  create mode 100644 tests/system-dpdk.at
> 
> diff --git a/Documentation/topics/testing.rst
> b/Documentation/topics/testing.rst
> index a49336b..74e0d3f 100644
> --- a/Documentation/topics/testing.rst
> +++ b/Documentation/topics/testing.rst
> @@ -297,6 +297,25 @@ To invoke the datapath testsuite with the userspace
> datapath, run::
> 
>  The results of the testsuite are in ``tests/system-userspace-testsuite.dir``.
> 
> +DPDK datapath
> +'
> +
> +To test :doc:`/intro/install/dpdk` (i.e., the build was configured with
> +``--with-dpdk``,the ``DPDK`` is installed), run the testsuite and
> +generate a report by using the ``check-dpdk`` target::
> +
> +$ make check-dpdk
> +
> +To see a list of all the available tests, run::
> +
> +$ make check-dpdk TESTSUITEFLAGS=--list
> +
> +These tests require a `DPDK supported NIC`_ and proper DPDK variables
> +(``DPDK_DIR`` and ``DPDK_BUILD``). Moreover you need to load the
> +required modules and bind the NIC to the DPDK-compatible driver.
> +
> +.. _DPDK supported NIC: http://dpdk.org/doc/nics
> +
>  Kernel datapath
>  '''
> 
> diff --git a/tests/automake.mk b/tests/automake.mk index
> 8157641..7be5712 100644
> --- a/tests/automake.mk
> +++ b/tests/automake.mk
> @@ -5,10 +5,12 @@ EXTRA_DIST += \
>   $(SYSTEM_KMOD_TESTSUITE_AT) \
>   $(SYSTEM_USERSPACE_TESTSUITE_AT) \
>   $(SYSTEM_OFFLOADS_TESTSUITE_AT) \
> + $(SYSTEM_DPDK_TESTSUITE_AT) \
>   $(TESTSUITE) \
>   $(SYSTEM_KMOD_TESTSUITE) \
>   $(SYSTEM_USERSPACE_TESTSUITE) \
>   $(SYSTEM_OFFLOADS_TESTSUITE) \
> + $(SYSTEM_DPDK_TESTSUITE) \
>   tests/atlocal.in \
>   $(srcdir)/package.m4 \
>   $(srcdir)/tests/testsuite \
> @@ -126,6 +128,12 @@ SYSTEM_OFFLOADS_TESTSUITE_AT = \
>   tests/system-offloads-traffic.at \
>   tests/system-offloads-testsuite.at
> 
> +SYSTEM_DPDK_TESTSUITE_AT = \
> + tests/system-common-macros.at \
> + tests/system-dpdk-macros.at \
> + tests/system-dpdk-testsuite.at \
> + tests/system-dpdk.at
> +
>  check_SCRIPTS += tests/atlocal
> 
>  TESTSUITE = $(srcdir)/tests/testsuite
> @@ -133,6 +141,7 @@ TESTSUITE_PATCH = $(srcdir)/tests/testsuite.patch
> SYSTEM_KMOD_TESTSUITE = $(srcdir)/tests/system-kmod-testsuite
>  SYSTEM_USERSPACE_TESTSUITE = $(srcdir)/tests/system-userspace-
> testsuite
>  SYSTEM_OFFLOADS_TESTSUITE = $(srcdir)/tests/system-offloads-testsuite
> +SYSTEM_DPDK_TESTSUITE = $(srcdir)/tests/system-dpdk-testsuite
>  DISTCLEANFILES += tests/atconfig tests/atlocal
> 
>  AUTOTEST_PATH =
> utilities:vswitchd:ovsdb:vtep:tests:$(PTHREAD_WIN32_DIR_DLL):ovn/control
> ler-vtep:ovn/northd:ovn/utilities:ovn/controller
> @@ -256,6 +265,10 @@ check-offloads: all
>   set $(SHELL) '$(SYSTEM_OFFLOADS_TESTSUITE)' -C tests
> AUTOTEST_PATH='$(AUTOTEST_PATH)' $(TESTSUITEFLAGS) -j1; \
>   "$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
> 
> +check-dpdk: all
> + set $(SHELL) '$(SYSTEM_DPDK_TESTSUITE)' -C tests
> AUTOTEST_PATH='$(AUTOTEST_PATH)' $(TESTSUITEFLAGS) -j1; \
> + "$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
> +
>  clean-local:
>   test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
> 
> @@ -284,6 +297,10 @@ $(SYSTEM_OFFLOADS_TESTSUITE): package.m4
> $(SYSTEM_TESTSUITE_AT) $(SYSTEM_OFFLOAD
>   $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
>   $(AM_V_at)mv $@.tmp $@
> 
> +$(SYSTEM_DPDK_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT)
>