[ovs-dev] [PATCH 0/2] DPDK v17.11 Support

2017-11-16 Thread Mark Kavanagh
This patchset adds support for DPDK v17.11:
- the first patch introduces minor code updates to accomodate DPDK API
  changes, and also updates Documentation and travis scripts.
- the second patch adds a new vhost-user port option,
  vhost-iommu-support; this is required in order to take advantage of
  the vHost IOMMU feature introduced in DPDK v17.11.

Note that the previous RFC version of this patch (Acked x2) is here:
https://mail.openvswitch.org/pipermail/ovs-dev/2017-November/340731.html.

Mark Kavanagh (2):
  netdev-dpdk: DPDK v17.11 upgrade
  netdev-dpdk: add support for vhost IOMMU feature

 .travis/linux-build.sh   |  2 +-
 Documentation/faq/releases.rst   |  1 +
 Documentation/intro/install/dpdk.rst | 10 -
 Documentation/topics/dpdk/ring.rst   |  2 +-
 Documentation/topics/dpdk/vhost-user.rst | 29 +
 NEWS |  3 +++
 lib/netdev-dpdk.c| 36 ++--
 vswitchd/vswitch.xml | 10 +
 8 files changed, 76 insertions(+), 17 deletions(-)

-- 
1.9.3

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 1/2] netdev-dpdk: DPDK v17.11 upgrade

2017-11-16 Thread Mark Kavanagh
This commit adds support for DPDK v17.11:
- minor updates to accomodate DPDK API changes
- update references to DPDK version in Documentation
- update DPDK version in travis' linux-build script

Signed-off-by: Mark Kavanagh 
Acked-by: Maxime Coquelin 
Acked-by: Ciara Loftus 
---
 .travis/linux-build.sh   |  2 +-
 Documentation/faq/releases.rst   |  1 +
 Documentation/intro/install/dpdk.rst | 10 +-
 Documentation/topics/dpdk/ring.rst   |  2 +-
 Documentation/topics/dpdk/vhost-user.rst |  8 
 NEWS |  2 ++
 lib/netdev-dpdk.c|  7 ---
 7 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 4d6459f..ed28ee4 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -81,7 +81,7 @@ fi
 
 if [ "$DPDK" ]; then
 if [ -z "$DPDK_VER" ]; then
-DPDK_VER="17.05.2"
+DPDK_VER="17.11"
 fi
 install_dpdk $DPDK_VER
 if [ "$CC" = "clang" ]; then
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index d903b06..62a1957 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -164,6 +164,7 @@ Q: What DPDK version does each Open vSwitch release work 
with?
 2.6.x16.07.2
 2.7.x16.11.3
 2.8.x17.05.2
+2.9.x17.11
  ===
 
 Q: I get an error like this when I configure Open vSwitch:
diff --git a/Documentation/intro/install/dpdk.rst 
b/Documentation/intro/install/dpdk.rst
index bb69ae5..3fecb5c 100644
--- a/Documentation/intro/install/dpdk.rst
+++ b/Documentation/intro/install/dpdk.rst
@@ -40,7 +40,7 @@ Build requirements
 In addition to the requirements described in :doc:`general`, building Open
 vSwitch with DPDK will require the following:
 
-- DPDK 17.05.2
+- DPDK 17.11
 
 - A `DPDK supported NIC`_
 
@@ -69,9 +69,9 @@ Install DPDK
 #. Download the `DPDK sources`_, extract the file and set ``DPDK_DIR``::
 
$ cd /usr/src/
-   $ wget http://fast.dpdk.org/rel/dpdk-17.05.2.tar.xz
-   $ tar xf dpdk-17.05.2.tar.xz
-   $ export DPDK_DIR=/usr/src/dpdk-stable-17.05.2
+   $ wget http://fast.dpdk.org/rel/dpdk-17.11.tar.xz
+   $ tar xf dpdk-17.11.tar.xz
+   $ export DPDK_DIR=/usr/src/dpdk-17.11
$ cd $DPDK_DIR
 
 #. (Optional) Configure DPDK as a shared library
@@ -583,7 +583,7 @@ Limitations
   The latest list of validated firmware versions can be found in the `DPDK
   release notes`_.
 
-.. _DPDK release notes: http://dpdk.org/doc/guides/rel_notes/release_17_05.html
+.. _DPDK release notes: http://dpdk.org/doc/guides/rel_notes/release_17_11.html
 
 Reporting Bugs
 --
diff --git a/Documentation/topics/dpdk/ring.rst 
b/Documentation/topics/dpdk/ring.rst
index ad9d7a5..8d0ede8 100644
--- a/Documentation/topics/dpdk/ring.rst
+++ b/Documentation/topics/dpdk/ring.rst
@@ -77,4 +77,4 @@ DPDK. However, this functionality was removed because:
 - :doc:`vhost-user interfaces ` are the defacto DPDK-based path to
   guests
 
-.. _DPDK documentation: 
https://dpdk.readthedocs.io/en/v17.05/prog_guide/ring_lib.html
+.. _DPDK documentation: 
https://dpdk.readthedocs.io/en/v17.11/prog_guide/ring_lib.html
diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index 74ac06e..5347995 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -292,9 +292,9 @@ To begin, instantiate a guest as described in 
:ref:`dpdk-vhost-user` or
 DPDK sources to VM and build DPDK::
 
 $ cd /root/dpdk/
-$ wget http://fast.dpdk.org/rel/dpdk-17.05.2.tar.xz
-$ tar xf dpdk-17.05.2.tar.xz
-$ export DPDK_DIR=/root/dpdk/dpdk-stable-17.05.2
+$ wget http://fast.dpdk.org/rel/dpdk-17.11.tar.xz
+$ tar xf dpdk-17.11.tar.xz
+$ export DPDK_DIR=/root/dpdk/dpdk-17.11
 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
 $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
 $ cd $DPDK_DIR
@@ -378,7 +378,7 @@ Sample XML
 
 
   
-  
+  
   
   
 
diff --git a/NEWS b/NEWS
index a93237f..74e59bf 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Post-v2.8.0
  IPv6 packets.
- Linux kernel 4.13
  * Add support for compiling OVS with the latest Linux 4.13 kernel
+   - DPDK:
+ * Add support for DPDK v17.11
 
 v2.8.0 - 31 Aug 2017
 
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 76e79be..ed5bf62 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -150,8 +151,8 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF / 
ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
 
 #define DPDK_ETH_PORT_ID_INVALIDRTE_MAX_ETHPORTS
 
-/* DPDK library uses uint8_t for port_id. */
-typedef uint8_t dpdk_port_t;
+/* DPDK library uses uint16_t for port_id. */
+typ

[ovs-dev] [PATCH 2/2] netdev-dpdk: add support for vhost IOMMU feature

2017-11-16 Thread Mark Kavanagh
DPDK v17.11 introduces support for the vHost IOMMU feature.
This is a security feature, that restricts the vhost memory
that a virtio device may access.

This feature also enables the vhost REPLY_ACK protocol, the
implementation of which is known to work in newer versions of
QEMU (i.e. v2.10.0), but is buggy in older versions (v2.7.0 -
v2.9.0, inclusive). As such, the feature is disabled by default
in (and should remain so, for the aforementioned older QEMU
verions). Starting with QEMU v2.9.1, vhost-iommu-support can
safely be enabled, even without having an IOMMU device, with
no performance penalty.

This patch adds a new vhost port option, vhost-iommu-support,
to allow enablement of the vhost IOMMU feature:

$ ovs-vsctl add-port br0 vhost-client-1 \
-- set Interface vhost-client-1 type=dpdkvhostuserclient \
 options:vhost-server-path=$VHOST_USER_SOCKET_PATH   \
 options:vhost-iommu-support=true

Note that support for this feature is only implemented for vhost
user client ports (since vhost user ports are considered deprecated).

Signed-off-by: Mark Kavanagh 
Acked-by: Maxime Coquelin 
Acked-by: Ciara Loftus 
---
 Documentation/topics/dpdk/vhost-user.rst | 21 +
 NEWS |  1 +
 lib/netdev-dpdk.c| 29 ++---
 vswitchd/vswitch.xml | 10 ++
 4 files changed, 58 insertions(+), 3 deletions(-)

diff --git a/Documentation/topics/dpdk/vhost-user.rst 
b/Documentation/topics/dpdk/vhost-user.rst
index 5347995..8dff901 100644
--- a/Documentation/topics/dpdk/vhost-user.rst
+++ b/Documentation/topics/dpdk/vhost-user.rst
@@ -250,6 +250,27 @@ Once the vhost-user-client ports have been added to the 
switch, they must be
 added to the guest. Like vhost-user ports, there are two ways to do this: using
 QEMU directly, or using libvirt. Only the QEMU case is covered here.
 
+vhost-user client IOMMU
+~~~
+It is possible to enable IOMMU support for vHost User client ports. This is
+a feature which restricts the vhost memory that a virtio device can access, and
+as such is useful in deployments in which security is a concern. IOMMU mode may
+be enabled on the command line::
+
+$ ovs-vsctl add-port br0 vhost-client-1 \
+-- set Interface vhost-client-1 type=dpdkvhostuserclient \
+ options:vhost-server-path=$VHOST_USER_SOCKET_PATH   \
+ options:vhost-iommu-support=true
+
+.. important::
+
+Enabling the IOMMU feature also enables the vhost user reply-ack protocol;
+this is known to work on QEMU v2.10.0, but is buggy on older versions
+(2.7.0 - 2.9.0, inclusive). Consequently, the IOMMU feaure is disabled by
+default (and should remain so if using the aforementioned versions of 
QEMU).
+Starting with QEMU v2.9.1, vhost-iommu-support can safely be enabled, even
+without having an IOMMU device, with no performance penalty.
+
 Adding vhost-user-client ports to the guest (QEMU)
 ~~
 
diff --git a/NEWS b/NEWS
index 74e59bf..c15dc24 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Post-v2.8.0
  * Add support for compiling OVS with the latest Linux 4.13 kernel
- DPDK:
  * Add support for DPDK v17.11
+ * Add support for vHost IOMMU feature
 
 v2.8.0 - 31 Aug 2017
 
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index ed5bf62..2e9633a 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1424,15 +1424,29 @@ netdev_dpdk_vhost_client_set_config(struct netdev 
*netdev,
 {
 struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
 const char *path;
+bool iommu_enable;
+bool request_reconfigure = false;
+uint64_t vhost_driver_flags_prev = dev->vhost_driver_flags;
 
 ovs_mutex_lock(&dev->mutex);
 if (!(dev->vhost_driver_flags & RTE_VHOST_USER_CLIENT)) {
 path = smap_get(args, "vhost-server-path");
 if (path && strcmp(path, dev->vhost_id)) {
 strcpy(dev->vhost_id, path);
-netdev_request_reconfigure(netdev);
+request_reconfigure = true;
 }
 }
+
+iommu_enable = smap_get_bool(args, "vhost-iommu-support", false);
+if (iommu_enable)
+dev->vhost_driver_flags |= RTE_VHOST_USER_IOMMU_SUPPORT;
+else
+dev->vhost_driver_flags &= ~RTE_VHOST_USER_IOMMU_SUPPORT;
+if (vhost_driver_flags_prev != dev->vhost_driver_flags)
+request_reconfigure = true;
+
+if (request_reconfigure)
+netdev_request_reconfigure(netdev);
 ovs_mutex_unlock(&dev->mutex);
 
 return 0;
@@ -3326,9 +3340,18 @@ netdev_dpdk_vhost_client_reconfigure(struct netdev 
*netdev)
  */
 if (!(dev->vhost_driver_flags & RTE_VHOST_USER_CLIENT)
 && strlen(dev->vhost_id)) {
+/* Enable vhost IOMMU, if it was requested.
+ * XXX: the 'flags' variable is required, as not all vhost backend
+ * features 

Re: [ovs-dev] [PATCH 7/9] tests: Convert dot2pic build tool from Perl to Python.

2017-11-16 Thread Aaron Conole
Hi Ben,

Ben Pfaff  writes:

> Perl is unfashionable and Python is more widely available and understood,
> so this commit converts one of the OVS uses of Perl into Python.
>
> Signed-off-by: Ben Pfaff 
> ---
>  ovn/automake.mk  |   4 +-
>  ovsdb/dot2pic| 155 
> +++
>  vswitchd/automake.mk |   2 +-
>  vtep/automake.mk |   2 +-
>  4 files changed, 100 insertions(+), 63 deletions(-)
>
> diff --git a/ovn/automake.mk b/ovn/automake.mk
> index c5925e9285ac..b33112ef14e5 100644
> --- a/ovn/automake.mk
> +++ b/ovn/automake.mk
> @@ -11,7 +11,7 @@ if HAVE_DOT
>  ovn/ovn-sb.gv: ovsdb/ovsdb-dot.in ovn/ovn-sb.ovsschema
>   $(AM_V_GEN)$(OVSDB_DOT) --no-arrows $(srcdir)/ovn/ovn-sb.ovsschema > $@
>  ovn/ovn-sb.pic: ovn/ovn-sb.gv ovsdb/dot2pic
> - $(AM_V_GEN)(dot -T plain < ovn/ovn-sb.gv | $(PERL) 
> $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
> + $(AM_V_GEN)(dot -T plain < ovn/ovn-sb.gv | $(PYTHON) 
> $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
>   mv $@.tmp $@
>  OVN_SB_PIC = ovn/ovn-sb.pic
>  OVN_SB_DOT_DIAGRAM_ARG = --er-diagram=$(OVN_SB_PIC)
> @@ -45,7 +45,7 @@ if HAVE_DOT
>  ovn/ovn-nb.gv: ovsdb/ovsdb-dot.in ovn/ovn-nb.ovsschema
>   $(AM_V_GEN)$(OVSDB_DOT) --no-arrows $(srcdir)/ovn/ovn-nb.ovsschema > $@
>  ovn/ovn-nb.pic: ovn/ovn-nb.gv ovsdb/dot2pic
> - $(AM_V_GEN)(dot -T plain < ovn/ovn-nb.gv | $(PERL) 
> $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
> + $(AM_V_GEN)(dot -T plain < ovn/ovn-nb.gv | $(PYTHON) 
> $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp && \
>   mv $@.tmp $@
>  OVN_NB_PIC = ovn/ovn-nb.pic
>  OVN_NB_DOT_DIAGRAM_ARG = --er-diagram=$(OVN_NB_PIC)
> diff --git a/ovsdb/dot2pic b/ovsdb/dot2pic
> index d682be5f9610..51d454b62e18 100755
> --- a/ovsdb/dot2pic
> +++ b/ovsdb/dot2pic
> @@ -1,6 +1,6 @@
> -#! /usr/bin/perl
> +#! /usr/bin/env python
>  
> -# Copyright (c) 2009, 2010, 2011, 2013 Nicira, Inc.
> +# Copyright (c) 2009, 2010, 2011, 2013, 2017 Nicira, Inc.
>  #
>  # Licensed under the Apache License, Version 2.0 (the "License");
>  # you may not use this file except in compliance with the License.
> @@ -14,67 +14,104 @@
>  # See the License for the specific language governing permissions and
>  # limitations under the License.
>  
> -use strict;
> -use warnings;
> +import getopt
> +import sys
>  
> -use Getopt::Long;
> +def dot2pic(src, dst):
> +scale = 1.0
> +while True:
> +line = src.readline()
> +if not line:
> +break
>  
> -my $font_scale = 0;
> -GetOptions("f=i" => \$font_scale) || exit 1;
> +words = line.split()
> +command = words[0]
> +if command == 'graph':
> +scale = float(words[1])
> +elif command == 'node':
> +name = words[1]
> +x = float(words[2])
> +y = float(words[3])
> +width = float(words[4])
> +height = float(words[5])
> +label, style, shape, color, fillcolor = words[6:11]
> +x *= scale
> +y *= scale
> +width *= scale
> +height *= scale
> +dst.write("linethick = %f;\n" % (0.5 if style == 'bold' else 
> 1.0))
> +dst.write('box at %f,%f wid %f height %f "%s"\n'
> +  % (x, y, width, height, name))
> +if style == 'bold':
> +inset = 2.0 / 72.0
> +width -= inset * 2
> +height -= inset * 2
> +dst.write("box at %f,%f wid %f height %f\n"
> +  % (x, y, width, height))
> +elif command == 'edge':
> +tail = words[1]
> +head = words[2]
> +n = int(words[3])
>  
> -my ($scale) = 1;
> -printf ".ps %+d\n", -$font_scale if $font_scale;
> -print ".PS\n";
> -print "linethick = 1;\n";
> -while (<>) {
> -if (/^graph/) {
> -(undef, $scale) = split;
> -} elsif (/^node/) {
> -my (undef, $name, $x, $y, $width, $height, $label, $style, $shape, 
> $color, $fillcolor) = split;
> -$x *= $scale;
> -$y *= $scale;
> -$width *= $scale;
> -$height *= $scale;
> -print "linethick = ", ($style eq 'bold' ? 0.5 : 1.0), ";\n";
> -print "box at $x,$y wid $width height $height \"$name\"\n";
> -if ($style eq 'bold') {
> -my $inset = 2.0 / 72.0;
> -$width -= $inset * 2;
> -$height -= $inset * 2;
> -print "box at $x,$y wid $width height $height\n";
> -}
> -} elsif (/edge/) {
> -my (undef, $tail, $head, $n, $rest) = split(' ', $_, 5);
> -my @xy;
> -for (1...$n) {
> -my ($x, $y);
> -($x, $y, $rest) = split(' ', $rest, 3);
> -push(@xy, [$x * $scale, $y * $scale]);
> -}
> -my ($label, $xl, $yl);
> -if (scalar(my @junk = split(' ', $rest)) > 2) {
> -if ($rest =~ s/^"([^"]*)"\s+//) {
> -$label = $1;
> -} else {
> 

Re: [ovs-dev] [PATCH 2/9] tests: Convert ovsdb-monitor-sort utility from Perl to Python.

2017-11-16 Thread Aaron Conole
Hi Ben,

Ben Pfaff  writes:

> Perl is unfashionable and Python is more widely available and understood,
> so this commit converts one of the OVS uses of Perl into Python.
>
> Signed-off-by: Ben Pfaff 
> ---
>  tests/automake.mk   |  2 +-
>  tests/ovsdb-monitor-sort.pl | 52 ---
>  tests/ovsdb-monitor-sort.py | 85 
> +
>  tests/ovsdb-monitor.at  |  4 +--
>  4 files changed, 88 insertions(+), 55 deletions(-)
>  delete mode 100755 tests/ovsdb-monitor-sort.pl
>  create mode 100755 tests/ovsdb-monitor-sort.py
>
> diff --git a/tests/automake.mk b/tests/automake.mk
> index 3ca60e2ea450..1ea08fef850d 100644
> --- a/tests/automake.mk
> +++ b/tests/automake.mk
> @@ -290,7 +290,6 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
>  noinst_PROGRAMS += tests/test-ovsdb
>  tests_test_ovsdb_SOURCES = tests/test-ovsdb.c
>  nodist_tests_test_ovsdb_SOURCES = tests/idltest.c tests/idltest.h
> -EXTRA_DIST += tests/ovsdb-monitor-sort.pl
>  tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
>  
>  noinst_PROGRAMS += tests/test-lib
> @@ -380,6 +379,7 @@ tests_test_type_props_SOURCES = tests/test-type-props.c
>  # Python tests.
>  CHECK_PYFILES = \
>   tests/appctl.py \
> + tests/ovsdb-monitor-sort.py \
>   tests/test-daemon.py \
>   tests/test-json.py \
>   tests/test-jsonrpc.py \
> diff --git a/tests/ovsdb-monitor-sort.pl b/tests/ovsdb-monitor-sort.pl
> deleted file mode 100755
> index 24f3ffcd6162..
> --- a/tests/ovsdb-monitor-sort.pl
> +++ /dev/null
> @@ -1,52 +0,0 @@
> -#! /usr/bin/perl
> -
> -use strict;
> -use warnings;
> -
> -# Breaks lines read from  into groups using blank lines as
> -# group separators, then sorts lines within the groups for
> -# reproducibility.
> -
> -sub compare_lines {
> -my ($a, $b) = @_;
> -
> -my $u = '[0-9a-fA-F]';
> -my $uuid_re = "${u}{8}-${u}{4}-${u}{4}-${u}{4}-${u}{12}";
> -if ($a =~ /^$uuid_re/) {
> -if ($b =~ /^$uuid_re/) {
> -return substr($a, 36) cmp substr($b, 36);
> -} else {
> -return 1;
> -}
> -} elsif ($b =~ /^$uuid_re/) {
> -return -1;
> -} else {
> -return $a cmp $b;
> -}
> -}
> -
> -sub output_group {
> -my (@group) = @_;
> -print "$_\n" foreach sort { compare_lines($a, $b) } @group;
> -}
> -
> -if ("$^O" eq "msys") {
> -$/ = "\r\n";
> -}
> -my @group = ();
> -while () {
> -chomp;
> -if ($_ eq '') {
> -output_group(@group);
> -@group = ();
> -print "\n";
> -} else {
> -if (/^,/ && @group) {
> -$group[$#group] .= "\n" . $_;
> -} else {
> -push(@group, $_);
> -}
> -}
> -}
> -
> -output_group(@group) if @group;
> diff --git a/tests/ovsdb-monitor-sort.py b/tests/ovsdb-monitor-sort.py
> new file mode 100755
> index ..c538d9d6b573
> --- /dev/null
> +++ b/tests/ovsdb-monitor-sort.py
> @@ -0,0 +1,85 @@
> +#! /usr/bin/env python
> +
> +# Breaks lines read from stdin into groups using blank lines as
> +# group separators, then sorts lines within the groups for
> +# reproducibility.
> +
> +import re
> +import sys
> +
> +
> +# This is copied out of the Python Sorting HOWTO at
> +# https://docs.python.org/3/howto/sorting.html#sortinghowto
> +def cmp_to_key(mycmp):
> +'Convert a cmp= function into a key= function'
> +class K:

I get a flake8 complaint for this - I think it should be:

 class K(object):
 ...

> +
> +def __init__(self, obj, *args):
> +self.obj = obj
> +
> +def __lt__(self, other):
> +return mycmp(self.obj, other.obj) < 0
> +
> +def __gt__(self, other):
> +return mycmp(self.obj, other.obj) > 0
> +
> +def __eq__(self, other):
> +return mycmp(self.obj, other.obj) == 0
> +
> +def __le__(self, other):
> +return mycmp(self.obj, other.obj) <= 0
> +
> +def __ge__(self, other):
> +return mycmp(self.obj, other.obj) >= 0
> +
> +def __ne__(self, other):
> +return mycmp(self.obj, other.obj) != 0
> +
> +return K
> +
> +
> +u = '[0-9a-fA-F]'
> +uuid_re = re.compile(r'%s{8}-%s{4}-%s{4}-%s{4}-%s{12}' % ((u,) * 5))
> +
> +
> +def cmp(a, b):
> +return (a > b) - (a < b)
> +
> +
> +def compare_lines(a, b):
> +if uuid_re.match(a):
> +if uuid_re.match(b):
> +return cmp(a[36:], b[36:])
> +else:
> +return 1
> +elif uuid_re.match(b):
> +return -1
> +else:
> +return cmp(a, b)
> +
> +
> +def output_group(group, dst):
> +for x in sorted(group, key=cmp_to_key(compare_lines)):
> +dst.write(x)
> +
> +
> +def ovsdb_monitor_sort(src, dst):
> +group = []
> +while True:
> +line = src.readline()
> +if not line:
> +break
> +if line.rstrip() == '':
> +output_group(group, dst)
> +group = []
> 

Re: [ovs-dev] [PATCH 5/9] tests: Convert soexpand build tool from Perl to Python.

2017-11-16 Thread Aaron Conole
Ben Pfaff  writes:

> Perl is unfashionable and Python is more widely available and understood,
> so this commit converts one of the OVS uses of Perl into Python.
>
> Signed-off-by: Ben Pfaff 
> ---
>  Makefile.am   |  4 +--
>  build-aux/automake.mk |  3 +-
>  build-aux/soexpand.pl | 40 -
>  build-aux/soexpand.py | 97 
> +++
>  4 files changed, 101 insertions(+), 43 deletions(-)
>  delete mode 100644 build-aux/soexpand.pl
>  create mode 100755 build-aux/soexpand.py
>
> diff --git a/Makefile.am b/Makefile.am
> index c82a9e21ec36..11e2e6d21005 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -88,7 +88,7 @@ EXTRA_DIST = \
>   build-aux/dist-docs \
>   build-aux/dpdkstrip.py \
>   build-aux/sodepends.pl \
> - build-aux/soexpand.pl \
> + build-aux/soexpand.py \
>   build-aux/xml2nroff \
>   $(MAN_FRAGMENTS) \
>   $(MAN_ROOTS) \
> @@ -144,7 +144,7 @@ ro_shell = printf '\043 Generated automatically -- do not 
> modify!-*- buffer-
>  
>  SUFFIXES += .in
>  .in:
> - $(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \
> + $(AM_V_GEN)$(PYTHON) $(srcdir)/build-aux/soexpand.py -I$(srcdir) < $< | 
> \
> $(PYTHON) $(srcdir)/build-aux/dpdkstrip.py $(DPDKSTRIP_FLAGS) | \
> sed \
>   -e 's,[@]PKIDIR[@],$(PKIDIR),g' \
> diff --git a/build-aux/automake.mk b/build-aux/automake.mk
> index c0553e6edffb..1003144fd664 100644
> --- a/build-aux/automake.mk
> +++ b/build-aux/automake.mk
> @@ -1,4 +1,5 @@
>  # This file is purely used for checking the style of the python build tools.
>  FLAKE8_PYFILES += \
>  $(srcdir)/build-aux/xml2nroff \
> -build-aux/dpdkstrip.py
> +build-aux/dpdkstrip.py \
> +build-aux/soexpand.py
> diff --git a/build-aux/soexpand.pl b/build-aux/soexpand.pl
> deleted file mode 100644
> index 216256451a4d..
> --- a/build-aux/soexpand.pl
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -# Copyright (c) 2008 Nicira, Inc.
> -#
> -# Licensed under the Apache License, Version 2.0 (the "License");
> -# you may not use this file except in compliance with the License.
> -# You may obtain a copy of the License at:
> -#
> -# http://www.apache.org/licenses/LICENSE-2.0
> -#
> -# Unless required by applicable law or agreed to in writing, software
> -# distributed under the License is distributed on an "AS IS" BASIS,
> -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> -# See the License for the specific language governing permissions and
> -# limitations under the License.
> -
> -use strict;
> -use warnings;
> -use Getopt::Long;
> -
> -my ($exit_code) = 0;
> -my (@include_dirs);
> -Getopt::Long::Configure ("bundling");
> -GetOptions("I|include=s" => \@include_dirs) or exit(1);
> -@include_dirs = ('.') if !@include_dirs;
> -OUTER: while () {
> -if (my ($name) = /^\.so (\S+)$/) {
> - foreach my $dir (@include_dirs, '.') {
> - if (open(INNER, "$dir/$name")) {
> - while () {
> - print $_;
> - }
> - close(INNER);
> - next OUTER;
> - }
> - }
> - print STDERR "$name not found in: ", join(' ', @include_dirs), "\n";
> - $exit_code = 1;
> -}
> -print $_;
> -}
> -exit $exit_code;
> diff --git a/build-aux/soexpand.py b/build-aux/soexpand.py
> new file mode 100755
> index ..fe99b461f980
> --- /dev/null
> +++ b/build-aux/soexpand.py
> @@ -0,0 +1,97 @@
> +#! /usr/bin/env python
> +
> +# Copyright (c) 2008, 2017 Nicira, Inc.
> +#
> +# Licensed under the Apache License, Version 2.0 (the "License");
> +# you may not use this file except in compliance with the License.
> +# You may obtain a copy of the License at:
> +#
> +# http://www.apache.org/licenses/LICENSE-2.0
> +#
> +# Unless required by applicable law or agreed to in writing, software
> +# distributed under the License is distributed on an "AS IS" BASIS,
> +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> +# See the License for the specific language governing permissions and
> +# limitations under the License.
> +
> +import getopt
> +import os
> +import re
> +import sys
> +
> +
> +def parse_include_dirs():
> +include_dirs = []
> +options, args = getopt.gnu_getopt(sys.argv[1:], 'I:', ['include='])
> +for key, value in options:
> +if key in ['-I', '--include']:
> +include_dirs.append(value)
> +else:
> +assert False
> +
> +include_dirs.append('.')
> +return include_dirs, args
> +
> +
> +def find_file(include_dirs, name):
> +for dir in include_dirs:
> +file = "%s/%s" % (dir, name)
> +try:
> +os.stat(file)
> +return file
> +except IOError as e:

This should just be 'except IOError:'

> +pass
> +sys.stderr.write("%s not found in: %s\n" % (name, ' 
> '.join(include_dirs)))
> +return None
> +
> +
> +so_re = 

Re: [ovs-dev] [PATCH 6/9] tests: Convert sodepends build tool from Perl to Python.

2017-11-16 Thread Aaron Conole
Ben Pfaff  writes:

> Perl is unfashionable and Python is more widely available and understood,
> so this commit converts one of the OVS uses of Perl into Python.
>
> Signed-off-by: Ben Pfaff 
> ---
>  Makefile.am|   6 +--
>  build-aux/automake.mk  |   1 +
>  build-aux/sodepends.pl |  70 -
>  build-aux/sodepends.py | 105 
> +
>  4 files changed, 109 insertions(+), 73 deletions(-)
>  delete mode 100644 build-aux/sodepends.pl
>  create mode 100755 build-aux/sodepends.py
>
> diff --git a/Makefile.am b/Makefile.am
> index 11e2e6d21005..5bcd2919c1b4 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -87,7 +87,7 @@ EXTRA_DIST = \
>   build-aux/calculate-schema-cksum \
>   build-aux/dist-docs \
>   build-aux/dpdkstrip.py \
> - build-aux/sodepends.pl \
> + build-aux/sodepends.py \
>   build-aux/soexpand.py \
>   build-aux/xml2nroff \
>   $(MAN_FRAGMENTS) \
> @@ -394,8 +394,8 @@ endif
>  CLEANFILES += flake8-check
>  
>  include $(srcdir)/manpages.mk
> -$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
> - @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) 
> >$(@F).tmp
> +$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.py
> + @$(PYTHON) $(srcdir)/build-aux/sodepends.py -I. -I$(srcdir) 
> $(MAN_ROOTS) >$(@F).tmp
>   @if cmp -s $(@F).tmp $@; then \
> touch $@; \
> rm -f $(@F).tmp; \
> diff --git a/build-aux/automake.mk b/build-aux/automake.mk
> index 1003144fd664..6baafab0e867 100644
> --- a/build-aux/automake.mk
> +++ b/build-aux/automake.mk
> @@ -2,4 +2,5 @@
>  FLAKE8_PYFILES += \
>  $(srcdir)/build-aux/xml2nroff \
>  build-aux/dpdkstrip.py \
> +build-aux/sodepends.py \
>  build-aux/soexpand.py
> diff --git a/build-aux/sodepends.pl b/build-aux/sodepends.pl
> deleted file mode 100644
> index 333d037f2dcf..
> --- a/build-aux/sodepends.pl
> +++ /dev/null
> @@ -1,70 +0,0 @@
> -# Copyright (c) 2008, 2011 Nicira, Inc.
> -#
> -# Licensed under the Apache License, Version 2.0 (the "License");
> -# you may not use this file except in compliance with the License.
> -# You may obtain a copy of the License at:
> -#
> -# http://www.apache.org/licenses/LICENSE-2.0
> -#
> -# Unless required by applicable law or agreed to in writing, software
> -# distributed under the License is distributed on an "AS IS" BASIS,
> -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> -# See the License for the specific language governing permissions and
> -# limitations under the License.
> -
> -use strict;
> -use warnings;
> -use Getopt::Long;
> -
> -our ($exit_code) = 0;
> -
> -our (@include_dirs);
> -Getopt::Long::Configure ("bundling");
> -GetOptions("I|include=s" => \@include_dirs) or exit(1);
> -@include_dirs = ('.') if !@include_dirs;
> -
> -sub find_file {
> -my ($name) = @_;
> -foreach my $dir (@include_dirs, '.') {
> -my $file = "$dir/$name";
> -if (stat($file)) {
> -return $file;
> -}
> -}
> -print STDERR "$name not found in: ", join(' ', @include_dirs), "\n";
> -$exit_code = 1;
> -return;
> -}
> -
> -print "# Generated automatically -- do not modify!-*- buffer-read-only: 
> t -*-\n";
> -for my $toplevel (sort(@ARGV)) {
> -# Skip names that don't end in .in.
> -next if $toplevel !~ /\.in$/;
> -
> -# Open file.
> -my ($fn) = find_file($toplevel);
> -next if !defined($fn);
> -if (!open(OUTER, '<', $fn)) {
> -print "$fn: open: $!\n";
> -$exit_code = 1;
> -next;
> -}
> -
> -my (@dependencies);
> -  OUTER:
> -while () {
> -if (my ($name) = /^\.so (\S+)$/) {
> -push(@dependencies, $name) if find_file($name);
> -}
> -}
> -close(OUTER);
> -
> -my ($output) = $toplevel;
> -$output =~ s/\.in//;
> -
> -print "\n$output:";
> -print " \\\n\t$_" foreach $toplevel, sort(@dependencies);
> -print "\n";
> -print "$_:\n" foreach $toplevel, sort(@dependencies);
> -}
> -exit $exit_code;
> diff --git a/build-aux/sodepends.py b/build-aux/sodepends.py
> new file mode 100755
> index ..fafe900b9965
> --- /dev/null
> +++ b/build-aux/sodepends.py
> @@ -0,0 +1,105 @@
> +#! /usr/bin/env python
> +
> +# Copyright (c) 2008, 2011, 2017 Nicira, Inc.
> +#
> +# Licensed under the Apache License, Version 2.0 (the "License");
> +# you may not use this file except in compliance with the License.
> +# You may obtain a copy of the License at:
> +#
> +# http://www.apache.org/licenses/LICENSE-2.0
> +#
> +# Unless required by applicable law or agreed to in writing, software
> +# distributed under the License is distributed on an "AS IS" BASIS,
> +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> +# See the License for the specific language governing permissions and
> +# limitations under the License.
> +
> +import 

[ovs-dev] Latest pricelist

2017-11-16 Thread Bonesca - Jona
If you are not able to see this mail, click 
http://r.newsletter.bonescamail.nl/7xa28kh26oatrf.html 

 
   [ Click here for our latest pricelist!
Haga clic aquí para ver la lista de ofertas!
Klicken Sie hier für die letzte Preisliste!
Klik hier voor de meest recente prijslijst!
Cliquez ici pour la liste des prix récentes! ]( 
http://r.newsletter.bonescamail.nl/track/click/vp48y9w8daoatrd )   
   [ Click here for complete overview latest offers
Haga clic aquí para ver la lista completa de las últimas ofertas
Klicken Sie hier für die komplette Liste der letzten Angebote
Klik hier voor het complete overzicht recente aanbiedingen
Cliquez ici pour la liste complète des offres récentes ]( 
http://r.newsletter.bonescamail.nl/track/click/vp48y9w95qoatrd )     
This email was sent to d...@openvswitch.org
You received this email because you are registered with Bonesca Import en 
Export BV
 
[ Unsubscribe here ]( http://r.newsletter.bonescamail.nl/7xa28kh26oatrg.html )  

Sent by
[  ]( http://r.newsletter.bonescamail.nl/track/click/vp48y9w9y6oatrd )     
© 2017 Bonesca Import en Export BV  

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH V2 3/4] tc: Add header rewrite using tc pedit action

2017-11-16 Thread Simon Horman
On Wed, Oct 25, 2017 at 02:24:15PM +0300, Roi Dayan wrote:
> 
> 
> On 27/09/2017 12:08, Simon Horman wrote:
> > On Mon, Sep 25, 2017 at 04:31:42PM +0300, Paul Blakey wrote:
> > > 
> > > 
> > > On 18/09/2017 18:01, Simon Horman wrote:
> > > > On Mon, Sep 18, 2017 at 07:16:03AM +0300, Roi Dayan wrote:
> > > > > From: Paul Blakey 
> > > > > 
> > > > > To be later used to implement ovs action set offloading.
> > > > > 
> > > > > Signed-off-by: Paul Blakey 
> > > > > Reviewed-by: Roi Dayan 
> > > > > ---
> > > > >   lib/tc.c | 372 
> > > > > ++-
> > > > >   lib/tc.h |  16 +++
> > > > >   2 files changed, 385 insertions(+), 3 deletions(-)
> > > > > 
> > > > > diff --git a/lib/tc.c b/lib/tc.c
> > > > > index c9cada2..743b2ee 100644
> > > > > --- a/lib/tc.c
> > > > > +++ b/lib/tc.c
> > > > > @@ -21,8 +21,10 @@
> > > > >   #include 
> > > > >   #include 
> > > > >   #include 
> > > > > +#include 
> > > > >   #include 
> > > > >   #include 
> > > > > +#include 
> > > > >   #include 
> > > > >   #include 
> > > > >   #include 
> > > > > @@ -33,11 +35,14 @@
> > > > >   #include "netlink-socket.h"
> > > > >   #include "netlink.h"
> > > > >   #include "openvswitch/ofpbuf.h"
> > > > > +#include "openvswitch/util.h"
> > > > >   #include "openvswitch/vlog.h"
> > > > >   #include "packets.h"
> > > > >   #include "timeval.h"
> > > > >   #include "unaligned.h"
> > > > > +#define MAX_PEDIT_OFFSETS 8
> > > > 
> > > > Why 8?
> > > We don't expect anything more right now (ipv6 src/dst rewrite requires 8
> > > pedits iirc). I can't think of a larger use case, maybe ipv6 + macs if
> > > that's makes sens. do you suggest we increase it? to what?
> > 
> > It seems strange to me to place a somewhat arbitrary small limit
> > when none exists in the pedit API being used. I would at prefer if
> > it was at least a bigger, say 16 or 32.
> 

> Hi Simon,
> 
> Sorry for the late reply due to holidays and vacations.
> Me & Paul going to go over this and do the fixes needed and
> also rebase over latest master and run tests again.
> 
> I'll answer what I'm more familiar with now and Paul will continue.
> The 8 here is too low and you right. We used this definition
> for allocation of the pedit keys on the stack in
> nl_msg_put_flower_rewrite_pedits()
> 
> It was for convenience instead of calculating the maximum possible
> keys that could exists and allocating it there and freeing it at
> the end.
> 
> Increasing it to 32 is probably more than enough and wont waste much.

I updated the value to 32 when applying the patch.

...

> > > > If I understand the above correctly it is designed to make
> > > > pedit actions disjoint. If so, why is that necessary? >
> > > 
> > > It's not, as a single flower key rewrite can be split to multiple pedit
> > > actions it finds the overlap between a flower key and a pedit action, if
> > > they do overlap it translates it to the correct offset and masks it out.
> > 
> > Thanks, understood.
> > 
> > > 
> > > > > +} else {
> > > > > +VLOG_ERR_RL(&error_rl, "unable to parse legacy pedit 
> > > > > type: %d",
> > > > > +nl_attr_type(nla));
> > > > > +return EOPNOTSUPP;
> > > > > +}
> > > > 
> > > > I think the code could exit early here as
> > > > nl_msg_put_flower_rewrite_pedits() does below.
> > > > 
> > > 
> > > Sorry, didn't understand. can you give an example?
> > > 
> > 
> > I meant something like this.
> > 
> >  if (nl_attr_type(nla) != TCA_PEDIT_KEY_EX) {
> >  VLOG_ERR_RL(...);
> >  return EOPNOTSUPP;
> >  }
> 
> understood. we'll do that. thanks.

I also fixed this when applying the patch.

...
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH V2 0/4] Add offload support for action set

2017-11-16 Thread Simon Horman
On Mon, Sep 18, 2017 at 07:16:00AM +0300, Roi Dayan wrote:
> Hi,
> 
> This series adds support for offloading action set using
> tc interface.
> 
> V1->V2:
> - Check patch whitespaces fixes
> -  Changed flower_pedit_map to be non sparse.
> - Missing handling of unsupported attributes and sub
>   attributes of action set key struct
> -  Removed unnsessary loop over action SET/SET_MASKED
>(has only one nested attr
> 
> Thanks,
> Roi

Applied, thanks.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] netdev-dpdk: defer MTU set after interface start

2017-11-16 Thread Matteo Croce
Some PMD assumes that the RX buffers are already allocated when setting the
device MTU, because the RX buffer size depends on the MTU.
This worked until 67fe6d635193 added a call to rte_eth_dev_set_mtu() in
the init code, which would set the MTU before the RX buffer allocation,
triggering a segmentation fault with some PMD:

Stack trace of thread 20680:
#0  0x559464396534 qede_set_mtu (ovs-vswitchd)
#1  0x559464323c41 rte_eth_dev_set_mtu (ovs-vswitchd)
#2  0x5594645f5e85 dpdk_eth_dev_queue_setup (ovs-vswitchd)
#3  0x5594645f8ae6 netdev_dpdk_reconfigure (ovs-vswitchd)
#4  0x55946452225c reconfigure_datapath (ovs-vswitchd)
#5  0x559464522d07 do_add_port (ovs-vswitchd)
#6  0x559464522e8d dpif_netdev_port_add (ovs-vswitchd)
#7  0x559464528dde dpif_port_add (ovs-vswitchd)
#8  0x5594644dc0e0 port_add (ovs-vswitchd)
#9  0x5594644d2ab1 ofproto_port_add (ovs-vswitchd)
#10 0x5594644c0a85 bridge_add_ports__ (ovs-vswitchd)
#11 0x5594644c26e8 bridge_reconfigure (ovs-vswitchd)
#12 0x5594644c5c49 bridge_run (ovs-vswitchd)
#13 0x5594642d4155 main (ovs-vswitchd)
#14 0x7f0e1444bc05 __libc_start_main (libc.so.6)
#15 0x5594642d8328 _start (ovs-vswitchd)

A possible solution could be to move the first call to
rte_eth_dev_set_mtu() just after the device start instead of
dpdk_eth_dev_queue_setup() which, by the way, set the MTU multiple times
as the call to rte_eth_dev_set_mtu() was in a loop.

CC: Mark Kavanagh 
Fixes: 67fe6d635193 ("netdev-dpdk: use rte_eth_dev_set_mtu.")
Signed-off-by: Matteo Croce 
---
 lib/netdev-dpdk.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 76e79be25..229aa4a76 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -750,13 +750,6 @@ dpdk_eth_dev_queue_setup(struct netdev_dpdk *dev, int 
n_rxq, int n_txq)
 break;
 }
 
-diag = rte_eth_dev_set_mtu(dev->port_id, dev->mtu);
-if (diag) {
-VLOG_ERR("Interface %s MTU (%d) setup error: %s",
-dev->up.name, dev->mtu, rte_strerror(-diag));
-break;
-}
-
 for (i = 0; i < n_txq; i++) {
 diag = rte_eth_tx_queue_setup(dev->port_id, i, dev->txq_size,
   dev->socket_id, NULL);
@@ -849,6 +842,13 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev)
 return -diag;
 }
 
+diag = rte_eth_dev_set_mtu(dev->port_id, dev->mtu);
+if (diag) {
+VLOG_ERR("Interface %s MTU (%d) setup error: %s",
+dev->up.name, dev->mtu, rte_strerror(-diag));
+return -diag;
+}
+
 rte_eth_promiscuous_enable(dev->port_id);
 rte_eth_allmulticast_enable(dev->port_id);
 
-- 
2.13.6

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] Mackerel Filets Iceland

2017-11-16 Thread Bonesca - Jona
If you are not able to see this mail, click 
http://r.newsletter.bonescamail.nl/7xa28khumoatrf.html 
[
]( http://r.newsletter.bonescamail.nl/track/click/vp48y9ze5aoatrd ) 
Special offer Mackerel Filets From Iceland
 
Product : Mackerel Filets Skin On PBI
Size : Average 110 grs check below sheets for details
Scientific name : Scomber Scombrus FAO 27
Production date: August 2017
Available: 45 tons
Packing : 2 x 13 kilo blockfrozen
Price : € 2,09 per kilo FCA The Netherlands
 
Minimum order quantity is full palets (55 boxes)     








 
Kind regards, 

Bonesca Import en Export B.V.

Schulpengat 9
8321 WC URK
The Netherlands
Tel : +31 (0) 527 701063
Fax: +31 (0) 527 690446
e-mail : i...@bonesca.nl
web : www.bonesca.nl      
This email was sent to d...@openvswitch.org
You received this email because you are registered with Bonesca Import en 
Export BV
 
[ Unsubscribe here ]( http://r.newsletter.bonescamail.nl/7xa28khumoatrg.html )  

Sent by
[  ]( http://r.newsletter.bonescamail.nl/track/click/vp48y9zexqoatrd )     
© 2017 Bonesca Import en Export BV  

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 0/8] Add minimum network namespace support.

2017-11-16 Thread Flavio Leitner
On Tue, 14 Nov 2017 14:54:20 -0800
Gregory Rose  wrote:

> On 11/9/2017 9:30 AM, Flavio Leitner wrote:
> > Today Open vSwitch doesn't know about network namespaces (netns), but
> > users are moving internal ports to other namespaces.  Although packets
> > are still flowing, the daemon fails to find out basic port information,
> > like if it is UP or DOWN, for instance.
> >
> > This patchset rely on a new kernel vport API recently accepted to find
> > out the new network namespace ID of a bridge's port. This information
> > along with the port's name recorded in the database is used to match the
> > corresponding netlink messages.
> >
> > This patchset also leverages another kernel API that allows the daemon
> > to listen to all netlink messages from all netns which has an ID assigned
> > into it.  This and the previous change allows the userspace to track ports
> > in other network namespaces.
> >
> > If any of the APIs aren't available, it falls back to the older APIs to
> > not break backwards compatibility.
> >
> >
> > Flavio Leitner (8):
> >netlink: provide network namespace id from a msg.
> >netdev-linux: initialize netns as invalid.
> >vport: retrieve the netnsid if available.
> >netdev: update device info only if netns matches.
> >netdev-linux: use netlink to update netdev.
> >netlink linux: enable listening to all nsids
> >nlmon: added netns support.
> >netdev-linux: fail ops not supporting remote netns.
> >
> >   configure.ac  |   3 +-
> >   datapath/linux/compat/include/linux/openvswitch.h |   2 +
> >   lib/automake.mk   |   1 +
> >   lib/daemon-unix.c |   3 +-
> >   lib/daemon.man|   6 +-
> >   lib/daemon.xml|   8 +-
> >   lib/dpif-netlink.c|  12 +-
> >   lib/dpif-netlink.h|   2 +
> >   lib/netdev-linux.c| 314 
> > --
> >   lib/netlink-notifier.c|   2 +-
> >   lib/netlink-protocol.h|   6 +
> >   lib/netlink-socket.c  |  80 +-
> >   lib/netlink-socket.h  |   6 +-
> >   lib/netns.h   | 119 
> >   tests/ofproto-macros.at   |   1 +
> >   tests/ovn-controller-vtep.at  |   1 +
> >   utilities/nlmon.c |   9 +-
> >   17 files changed, 531 insertions(+), 44 deletions(-)
> >   create mode 100644 lib/netns.h
> >  
> 
> Besides one little nit in patch 3 it all looks good.  I'll let someone 
> who knows the namespace code
> better than I give it an ack but...
> 
> Reviewed-by: Greg Rose 
> Tested-by: Greg Rose 

Thanks for the review and tests!

Jiri is busy and he works inside of the kernel so maybe someone else
can review?

-- 
Flavio
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] Taller de Nóminas, sueldos y salarios

2017-11-16 Thread Ley Federal del Trabajo
Establezca una política de administración salarial y maximice los resultados de 
sus colaboradores

Taller de Nóminas, sueldos y salarios
23 de noviembre - Mtra. Leticia Tercero Leyzaola 9am-8pm

El sistema para determinar el pago de los salarios debe tomar en cuenta 
factores que considera el puesto a desempeñar, la eficiencia, las necesidades e 
inquietudes del personal y las posibilidades de la empresa. El manejo eficiente 
de un sistema de nóminas, sueldos y salarios se reflejará en la actitud que 
tenga el personal hacia su trabajo, sus compañeros, sus jefes y hacia la misma 
empresa, por lo que es importante darle el análisis y el tiempo necesario para 
que cumpla su objetivo; una retribución justa y equitativa con relación al 
trabajo desempeñado por parte del personal.

BENEFICIOS DE ASISTIR: 

1. Aprenderá y dará cumplimento a lo estipulado en la Ley Federal del Trabajo 
en materia de nóminas. 
2. Observará todas las obligaciones legales que debe cubrir la empresa al tener 
personal a su cargo (LFT, IMSS, INFONAVIT, ISR) 
3. Enfatizará las prestaciones legales y su tratamiento incluidos los del 
Impuesto sobre la Renta.
 4. Sabrá cómo calcular los finiquitos y liquidaciones de acuerdo con la ley.
 5. Conocerá la importancia de una estructura salarial estadísticamente 
definida, así como diseñar la política salarial. 

¿Requiere la información a la Brevedad? responda este email con la palabra: 
Sueldos + nombre - teléfono - correo.


centro telefónico:018002120744


 


___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] OVN: Add support for ARP renewal and expiration.

2017-11-16 Thread Tiago Lam
Currently, any binding that is inserted in the SB DB MAC_Binding table
(dynamically discovered), is not renewed nor disposed of, if stalled. This
commit adds initial support for ARP renewal and expiration, cleaning the
binds if stalled.

The logic implemented is similar to how gARP and Ipv6 periodic router
advertisements are currently working, where, in the ovn-controller (more
specifically, pinctrl.c), a map is maintained to keep track of the ARP
state of each local logical port scanned from the SB DB which has a MAC-
Binding entry associated with it. For each of those entries:
  a. If the 'timestamp' of the entry has expired (taking into account the
  configured 'timeout'), send a Unicast ARP;
  b. If entry is still not updated within the 'timeout', send a broadcast
  ARP;
  c. If that hasn't resulted in an update either, the entry is disposed of.

A change in the SB DB schema was also required (a new 'timestamp' column in
the MAC_Binding table); to keep track of when each MAC-IP bind entry has
been updated.

By default the timeout for each logical port is 60 seconds. In order to
configure one can use (in this case to set it to 30s):

ovn-nbctl set Logical_Router_Port ro-sw arp_configs:timeout=30

Finally. the test "ARP recheck and expiration" has also been written to
test the case where a logical router port receives an ARP reply and thus
needs to revalidate and expire/delete that MAC-IP bind (taking into account
the "timeout" configuration of the port). The test verifies that an ARP
unicast is sent, to revalidate the bind, followed by an ARP broadcast.

Signed-off-by: Tiago Lam 
---
Note: This patch depends on the series at [1], and can't be directly applied to 
master.

This presents a first approach for tackling the "ARP renewal and expiration", 
any feedback / suggestions is welcome. There's also room for improvement, I 
think; With regards to gARP, since some work can be combined in the future; Or 
even on a more fancier logic between sending the Unicast and the Broadcast ARPs 
(sending the Unicast ARP multiple times before sending the Broadcast ARP, for 
example).

[1] https://patchwork.ozlabs.org/cover/837323/

---
 lib/packets.h|   2 +
 ovn/controller/pinctrl.c | 312 +++
 ovn/northd/ovn-northd.c  |  27 
 ovn/ovn-nb.ovsschema |   7 +-
 ovn/ovn-nb.xml   |   9 ++
 ovn/ovn-sb.ovsschema |   5 +-
 ovn/ovn-sb.xml   |   5 +
 tests/ovn.at | 166 +
 8 files changed, 529 insertions(+), 4 deletions(-)

diff --git a/lib/packets.h b/lib/packets.h
index f545455..f13e903 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -1022,6 +1022,8 @@ BUILD_ASSERT_DECL(RA_MSG_LEN == sizeof(struct 
ovs_ra_msg));
 #define ND_RA_MAX_INTERVAL_DEFAULT 600
 #define ND_RA_MIN_INTERVAL_DEFAULT(max) ((max) >= 9 ? (max) / 3 : (max) * 3 / 
4)
 
+#define ND_ARP_DEFAULT_TIMEOUT 60
+
 /*
  * Use the same struct for MLD and MLD2, naming members as the defined fields 
in
  * in the corresponding version of the protocol, though they are reserved in 
the
diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
index 7f6f55b..e5789be 100644
--- a/ovn/controller/pinctrl.c
+++ b/ovn/controller/pinctrl.c
@@ -95,6 +95,12 @@ static void ipv6_ra_wait(void);
 static void send_ipv6_ras(const struct controller_ctx *ctx,
 struct hmap *local_datapaths);
 
+static void init_arp_states(void);
+static void destroy_arp_states(void);
+static void send_arp(const struct controller_ctx *ctx,
+ const struct sbrec_chassis *chassis,
+ struct hmap *local_datapaths);
+
 COVERAGE_DEFINE(pinctrl_drop_put_mac_binding);
 
 void
@@ -105,6 +111,7 @@ pinctrl_init(void)
 init_put_mac_bindings();
 init_send_garps();
 init_ipv6_ras();
+init_arp_states();
 }
 
 static ovs_be32
@@ -1091,6 +1098,7 @@ pinctrl_run(struct controller_ctx *ctx,
 send_garp_run(ctx, br_int, chassis, chassis_index, local_datapaths,
   active_tunnels);
 send_ipv6_ras(ctx, local_datapaths);
+send_arp(ctx, chassis, local_datapaths);
 }
 
 /* Table of ipv6_ra_state structures, keyed on logical port name */
@@ -1425,6 +1433,304 @@ send_ipv6_ras(const struct controller_ctx *ctx 
OVS_UNUSED,
 }
 }
 
+/* Table of `arp_state` structures, keyed on logical port + IP of the mapped
+ * entry (concatenatedd), so to allow us to have all data in one flat structure
+ * (`arp_state`) */
+static struct shash arp_states;
+
+/* Next ARP in miliseconds. */
+static long long int send_arp_time;
+
+struct arp_config {
+time_t timeout;
+struct eth_addr eth_src;
+struct eth_addr eth_dst;
+ovs_be32 ipv4_src;
+ovs_be32 ipv4_dst;
+};
+
+struct arp_state {
+struct arp_config *config;
+int64_t port_key;
+int64_t metadata;
+bool delete_me;
+/* Tracking flags, used to differentiate between unicast and broadcast */
+bool unicast;
+bool broadcast;
+};
+
+static void
+init_

[ovs-dev] failed to build in some Debian arch

2017-11-16 Thread Thomas Goirand
Hi,

I took over OpenVSwitch packaging in Debian within the OpenStack
packaging group, as Ben mentioned in the bug report that he'd be happy
to have co-maintainers. So Ben & myself will be co-maintaining OVS
within the Debian OpenStack team.

OpenVSwitch 2.8.1 fails to builds on some Debian arch because of failed
tests. Here's the logs in the buidd:

https://buildd.debian.org/status/package.php?p=openvswitch

As you can see, it fails in armel, mips and mipsel64. The other arch
where it fails aren't part of the official Debian release, but it'd be
nice to have them fixed anyway.

I tried to build the tip of the 2.8 branch in a Debian porter box, and
these tests are failing as well.

2 RC bugs were reported in Debian:
https://bugs.debian.org/880508
https://bugs.debian.org/880509

Could someone have a look and help me fix these bugs?

Cheers,

Thomas Goirand (zigo)
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] vlan on dpdk port

2017-11-16 Thread Joo Kim
Can anybody give a comment on this?  -thanks-

On Wed, Nov 15, 2017 at 4:39 PM, Joo Kim  wrote:

> Hello folks,
>
> I see 'tag=' option for ovs-vsctl add-portbut does the option work
> also for dpdk-type port?
>
>
>
>
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] (no subject)

2017-11-16 Thread frontoff...@careind.net
Your email address just won £500,000 pounds from Sonia Davies Donation,Reply 
for More Info.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] vlan on dpdk port

2017-11-16 Thread Jan Scheurich
Yes, the tag option works also on dpdk ports in the same way as for non-dpdk 
interfaces.

It basically just associates the received untagged packet with the specified 
VLAN tag inside the OVS bridge. If the packet is sent out on another port with 
the same tag, it is sent out untagged. Only if it sent out on a port with VLAN 
trunking, the tag would actually be pushed to the packet.

Regards, Jan

> -Original Message-
> From: ovs-dev-boun...@openvswitch.org 
> [mailto:ovs-dev-boun...@openvswitch.org] On Behalf Of Joo Kim
> Sent: Friday, 17 November, 2017 00:28
> To: ovs-dev@openvswitch.org
> Subject: Re: [ovs-dev] vlan on dpdk port
> 
> Can anybody give a comment on this?  -thanks-
> 
> On Wed, Nov 15, 2017 at 4:39 PM, Joo Kim  wrote:
> 
> > Hello folks,
> >
> > I see 'tag=' option for ovs-vsctl add-portbut does the option work
> > also for dpdk-type port?
> >
> >
> >
> >
> >
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] Web Listing

2017-11-16 Thread web
Hi There,

My name is Mike and I am an online strategist. I have been tracking the
success of your website. while doing some researching  on your industry. I
am impressed with your company, but here are some opportunities for growth
that you currently are missing. 

Are you interested in several proven strategies to use Google search and
social media to drive relevant traffic to your site? We are a Sydney based
Google Partner Agency specializing in website performance optimization! In
20 minutes I can show you how to fuel your brand and generate more revenue
from search engines. I'd like to follow up about this with a quick phone
call.

 

Can I call you this week to discuss your campaign? Kindly share your phone
number and suitable time.

 

I look forward to hear from you.

 

Regards,

Mike

 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] Upcall/Slowpath rate limiter for OVS

2017-11-16 Thread Manohar Krishnappa Chidambaraswamy
Hi,

Does anyone have any comments on this add-on to upcalls?

Thanx
Manu

On 10/11/17, 7:06 PM, "ovs-dev-boun...@openvswitch.org on behalf of Manohar 
Krishnappa Chidambaraswamy"  wrote:

In OVS-DPDK, both fast-path and slow-path execute in the context of a common
thread (i.e, PMD thread), without any partitioning of CPU cycles between the
two. When there is a burst of new flows coming into the data-path, packets
are punted to slow-path in the order they are received and the PMD is busy
for the duration of the upcall. Slow-path processing of a packet consumes
100-200 times the cycles of fast-path handling. As a result, the forwarding
performance of a PMD degrades significantly during an upcall burst. If the
PMD was highly loaded already, it becomes temporarily overloaded and its rx
queues start filling up. If the upcall burst is long enough, packets will be
dropped when rx queues are full. This happens even if the new flows are
unexpected and the slow-path decides to drop the packets.

It is likely that most of the packets dropped due to rx queue overflow 
belong
to established flows that should have been processed by the fast-path. 
Hence,
the current OVS-DPDK architecture favors the handling of new flows over the
forwarding of established flows. This is generally a sub-optimal approach.

Without a limit to the rate of upcalls, OVS-DPDK is vulnerable for DoS 
attacks.
But even sporadic bursts of e.g. unexpected multicast packets have shown to
cause such packet drops.

Proposed solution:
--
This patch implements a mechanism to limit the rate of packets going into
slow-path from fast-path in OVS-DPDK mode. A simple token bucket policer per
packet processing thread (either PMD or non-PMD thread) restricts the flow
of packets funneling from fast-path into slow-path, as shown below. So for
each PMD (or non-PMD) thread, there is a limited amount of cycles carved out
for its slow-path. This Upcall Policer allows only configured number of
packets per second (pps) into handle_packet_upcall() which identifies the
start of slow-path in OVS-DPDK. A packet entering slow-path has to take a
token to get into slow-path and if no tokens are available, the packet is
dropped and accounted per-PMD (or thread) under
"ovs-appctl dpif-netdev/pmd-stats-show".

pmd thread numa_id 0 core_id 2:
emc hits:0
megaflow hits:0
avg. subtable lookups per hit:0.00
miss:287572
rate limit drops:x <
lost:0
idle cycles:14925072116 (43.81%)
processing cycles:19140112904 (56.19%)
avg cycles per packet: 118457.93 (34065185020/287572)
avg processing cycles per packet: 66557.64 (19140112904/287572)
NOTE: This is a sample output and may need adaptation based on new
changes/proposals (if any) in progress.

The upcall policer can be enabled and configured with the following
parameters in the "Open_vSwitch" table as new items under other_config.
These values are common for all packet processing threads (PMD or non-PMD),
with each thread using the same configured value independently.

1. ovs-vsctl set Open_vSwitch . other_config:upcall-rl=true
- Global knob to enable/disable upcall ratelimiting for all non-PMD/PMD
  threads.
2. ovs-vsctl set Open_vSwitch . other_config:upcall-rate=xxx
- xxx is in packets per second (pps). This determines the token bucket's
  fill-rate.
3. ovs-vsctl set Open_vSwitch . other_config:upcall-burst=xxx
- xxx is the maximum burst of packets allowed at any time. This 
determines
  the token bucket's burst size.

By default, this feature is disabled for backward compatibility and needs 
to be
explicitly enabled (via global knob upcall-rl shown above). When enabled,
default values (that are derived based on typical slow-path and fast-path
performance measurements) will be used during init and can be overridden by 
the
above knob/commands. Configured values for rate and burst would take effect 
only
when the feature is enabled.

The patch is based on an existing token bucket implementation in OVS.
Signed-off-by: Manohar K C 
CC: Jan Scheurich jan.scheur...@ericsson.com
---
 Documentation/howto/dpdk.rst | 21 +++
 lib/dpif-netdev.c| 85 
+---
 vswitchd/vswitch.xml | 47 
 3 files changed, 148 insertions(+), 5 deletions(-)

diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst
index d123819..2cd0209 100644
--- a/Documentation/howto/dpdk.rst
+++ b/Documentation/howto/dpdk.rst
@@ -709,3 +709,24 @@ devices to bridge ``br0``. Once complete, follow the 
below steps

[ovs-dev] [PATCH RFC] netdev-dpdk: Fix device obtain mac address when received first packet in vhost type

2017-11-16 Thread Hailin Chen
The stp could not work on netdev-dpdk if network is loop.
Because the stp protocol negotiates designate port by sending
BPDU packets which contains MAC address.
However the device doesn't have MAC address in vhostuser type.
Thus, function send_bpdu_cb would not send BPDU packets.

This patch will set the MAC for device when received first packet.

Signed-off-by: Hailin Chen 
---
 lib/netdev-dpdk.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index ee53c4cd0..8496d7a9d 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -143,6 +143,11 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF / 
ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
 #define VHOST_ENQ_RETRY_NUM 8
 #define IF_NAME_SZ (PATH_MAX > IFNAMSIZ ? PATH_MAX : IFNAMSIZ)
 
+/* State of virtio device. */
+#define DEVICE_MAC_LEARNING0
+#define DEVICE_RX  1
+#define DEVICE_SAFE_REMOVE 2
+
 static const struct rte_eth_conf port_conf = {
 .rxmode = {
 .mq_mode = ETH_MQ_RX_RSS,
@@ -353,6 +358,9 @@ struct netdev_dpdk {
 /* True if vHost device is 'up' and has been reconfigured at least once */
 bool vhost_reconfigured;
 
+/* A device is set as ready if the MAC address has been set. */
+volatile uint8_t ready;
+
 /* Identifier used to distinguish vhost devices from each other. */
 char vhost_id[PATH_MAX];
 
@@ -1549,6 +1557,16 @@ netdev_dpdk_vhost_rxq_recv(struct netdev_rxq *rxq,
 return EAGAIN;
 }
 
+if (unlikely(dev->ready == DEVICE_MAC_LEARNING)) {
+struct ether_hdr *pkt_hdr =
+rte_pktmbuf_mtod(*(struct rte_mbuf**)batch->packets, struct 
ether_hdr*);
+ovs_mutex_lock(&dev->mutex);
+dev->hwaddr = *(struct eth_addr*)pkt_hdr->s_addr.addr_bytes;
+netdev_change_seq_changed(&dev->up);
+dev->ready = DEVICE_RX;
+ovs_mutex_unlock(&dev->mutex);
+}
+
 if (policer) {
 dropped = nb_rx;
 nb_rx = ingress_policer_run(policer,
@@ -2548,6 +2566,7 @@ new_device(int vid)
 LIST_FOR_EACH(dev, list_node, &dpdk_list) {
 ovs_mutex_lock(&dev->mutex);
 if (strncmp(ifname, dev->vhost_id, IF_NAME_SZ) == 0) {
+dev->ready = DEVICE_MAC_LEARNING;
 uint32_t qp_num = rte_vhost_get_queue_num(vid);
 
 /* Get NUMA information */
@@ -2629,6 +2648,7 @@ destroy_device(int vid)
 if (netdev_dpdk_get_vid(dev) == vid) {
 
 ovs_mutex_lock(&dev->mutex);
+dev->ready = DEVICE_SAFE_REMOVE;
 dev->vhost_reconfigured = false;
 ovsrcu_index_set(&dev->vid, -1);
 netdev_dpdk_txq_map_clear(dev);
-- 
2.13.2

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] (no subject)

2017-11-16 Thread Robert Charles



-- 
Bewerben Sie sich für schnelle und einfache Kredite.Sie sind garantiert, Ihr 
Darlehen innerhalb von 48 Stunden der Anwendung zu bekommen.Wir geben 
persönliche und Business-Darlehen zu einem niedrigen Zinssatz von 2% .Wenn Sie 
interessiert sind, kontaktieren Sie uns über (3ttrustfina...@gmail.com) mit 
Details unten.

Benötigte Menge:
Dauer:
Telefon:
Land:
 
Grüße.
Robert Charles.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev