Wenyu Zhang | 23 Jul 11:32 2014

[PATCH v6] Extend OVS IPFIX exporter to export tunnel headers

Extend IPFIX exporter to export tunnel headers when both input and output
of the port.
Add three other_config options in IPFIX table: enable-input-sampling,
enable-output-sampling and enable-tunnel-sampling, to control whether
sampling tunnel info, on which direction (input or output).
Insert sampling action before output action and the output tunnel port
is sent to datapath in the sampling action.
Make datapath collect output tunnel info and send it back to userpace
in upcall message with a new additional optional attribute.
Add a tunnel ports map to make the tunnel port lookup faster in sampling
upcalls in IPFIX exporter. Make the IPFIX exporter generate IPFIX template
sets with enterprise elements for the tunnel info, save the tunnel info
in IPFIX cache entries, and send IPFIX DATA with tunnel info.
Add flowDirection element in IPFIX templates.

Signed-off-by: Wenyu Zhang <wenyuz-pghWNbHTmq7QT0dZR+AlfA <at> public.gmane.org>
Acked-by: Romain Lenglet <rlenglet-pghWNbHTmq7QT0dZR+AlfA <at> public.gmane.org>
---
v2: Address Romain's comments
v3: Address Pravin's comments, make datapath sent all tunnel info,
    not only tunnel key to userspace.
v4: Address Pravin's comments, introduce a common function to get output
    tunnel info for all vports, remove duplicated codes.
    Rebase.
v5: Address Pravin's comments on v4, correct sparse errors, make a common
    function to setup tunnel info data for both input and output case. 
v6: Address Pravin's comments on v5, correct coding style issues in kernel.
    Rebase.
---
 datapath/actions.c                    |   19 ++
(Continue reading)

Alex Wang | 23 Jul 08:36 2014

[PATCH] datapath: flow_netlink: Fix a bug.

Commit 62974663fe (datapath/flow_netlink: Create right mask with
disabled megaflows) introduced the bug which caused
ovs_nla_get_match() returns immediately after parsing the flow
mask for OVS_KEY_ATTR_ENCAP.  Consequently, when vlan encapsulated
packets are present, the corresponding datapath flows will have
incorrect mask like below.  And the incorrect flows could affect
other non-vlan packets.

~/ovs# ovs-dpctl dump-flows
in_port(3/0xffff0000),eth_type(0x8100),encap(), packets:0,
bytes:0, used:never, actions:2

This commit fixes the bug by checking and handling the return
value of the parsing function correctly.

Signed-off-by: Alex Wang <alexw@...>
---
 datapath/flow_netlink.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c
index 5f975a1..445fa88 100644
--- a/datapath/flow_netlink.c
+++ b/datapath/flow_netlink.c
 <at>  <at>  -938,7 +938,8  <at>  <at>  int ovs_nla_get_match(struct sw_flow_match *match,
 				mask_attrs &= ~(1ULL << OVS_KEY_ATTR_ETHERTYPE);
 				encap = a[OVS_KEY_ATTR_ENCAP];
 				err = parse_flow_mask_nlattrs(encap, a, &mask_attrs);
-				goto free_newmask;
+				if (err)
(Continue reading)

Ben Pfaff | 23 Jul 06:13 2014

[PATCH] dpif-netdev: Initialize upcall->packet when queuing to userspace.

Commit db73f7166a6 (netdev-dpdk: Fix race condition with DPDK mempools in
non pmd threads) switched to a new way of setting up 'upcall->packet', but
only initialized two of the fields in the packet.  This could cause
core dumps and other strange behavior.  In particular it caused failures in
several unit tests on XenServer.

This commit fixes the problem by initializing the entire ofpbuf.

Signed-off-by: Ben Pfaff <blp@...>
---
 lib/dpif-netdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index cfd7539..742b118 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
 <at>  <at>  -2153,6 +2153,7  <at>  <at>  OVS_REQUIRES(q->mutex)
         struct ofpbuf *buf = &u->buf;
         size_t buf_size;
         struct flow flow;
+        void *data;

         upcall->type = type;

 <at>  <at>  -2179,8 +2180,8  <at>  <at>  OVS_REQUIRES(q->mutex)
         /* We have to perform a copy of the packet, because we cannot send DPDK
          * mbufs to a non pmd thread. When the upcall processing will be done
          * in the pmd thread, this copy can be avoided */
-        ofpbuf_set_data(&upcall->packet, ofpbuf_put(buf, ofpbuf_data(packet),
(Continue reading)

Daniele Di Proietto | 23 Jul 02:09 2014

[PATCH] netdev-dpdk: Increase tx queue size and rx batch size

These values has been found to give the best throughput in simple cases (1 flow
64 bytes UDP packets)

Signed-off-by: Daniele Di Proietto <ddiproietto@...>
---
 lib/netdev-dpdk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 62c9a0c..b45e367 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
 <at>  <at>  -123,8 +123,8  <at>  <at>  static const struct rte_eth_txconf tx_conf = {
     .txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS|ETH_TXQ_FLAGS_NOOFFLOADS,
 };

-enum { MAX_RX_QUEUE_LEN = 64 };
-enum { MAX_TX_QUEUE_LEN = 64 };
+enum { MAX_RX_QUEUE_LEN = 192 };
+enum { MAX_TX_QUEUE_LEN = 384 };
 enum { DRAIN_TSC = 200000ULL };

 static int rte_eal_init_ret = ENODEV;
--

-- 
2.0.0

Daniele Di Proietto | 23 Jul 02:06 2014

[PATCH 0/4] DPDK performance improvement: exact match cache

This series introduces in dpif-netdev an exact match cache for frequently
used flows. It uses the RSS hash (currently implemented only for netdev-dpdk)
to search the miniflow in an hash table.

While there might be still some tuning left to do, these patch provides
significant performance improvements for the following simple testcase:

CPU: Intel(R) Xeon(R) CPU E5-2650 0  <at>  2.00GHz
NIC: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 01)
     dual port (dpdk0, dpdk1)

    Bridge "br0"
        Port "dpdk1"
            Interface "dpdk1"
                type: dpdk
        Port "br0"
            Interface "br0"
                type: internal
        Port "dpdk0"
            Interface "dpdk0"
                type: dpdk

Source connected to dpdk0, sink to dpdk1

1 flow 64 bytes UDP packets going from source to sink

zero drop throughput:

   master: ~ 5.5 Mpps
new patch: ~12.5 Mpps
(Continue reading)

Ben Pfaff | 23 Jul 02:07 2014

[PATCH RFC] ovs-vswitchd: Drop all capabilities that OVS doesn't need.

Signed-off-by: Ben Pfaff <blp@...>
---
ovs-vswitchd typically runs as root, but it doesn't need most of the powers
of root.  This commit makes it drop all the capabilities that it doesn't
typically need.

I don't know how capabilities are really used in practice.  Something
equivalent could be achieved through the file system.  I don't know the
preferred way to do it.

diff --git a/configure.ac b/configure.ac
index 971c7b3..9665516 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -55,6 +55,7  <at>  <at>  OVS_CHECK_COVERAGE
 OVS_CHECK_NDEBUG
 OVS_CHECK_NETLINK
 OVS_CHECK_OPENSSL
+OVS_CHECK_LIBCAP
 OVS_CHECK_LOGDIR
 OVS_CHECK_PYTHON
 OVS_CHECK_PYTHON_COMPAT
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 26b8058..6017c74 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
 <at>  <at>  -192,6 +192,15  <at>  <at>  AC_DEFUN([OVS_CHECK_BACKTRACE],
                   [AC_DEFINE([HAVE_BACKTRACE], [1],
                              [Define to 1 if you have backtrace(3).])])])

(Continue reading)

Ben Pfaff | 23 Jul 01:21 2014

[PATCH] configure: Don't check for malloc hooks that we no longer use.

Commit 825da1c6d1c7 (leak-checker: Remove because it cannot be made
thread-safe.) removed the only uses of these hooks but neglected to remove
the test for them.

Signed-off-by: Ben Pfaff <blp@...>
---
 configure.ac      |    1 -
 m4/openvswitch.m4 |   20 --------------------
 2 files changed, 21 deletions(-)

diff --git a/configure.ac b/configure.ac
index ebe4ef9..971c7b3 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -75,7 +75,6  <at>  <at>  OVS_CHECK_PKIDIR
 OVS_CHECK_RUNDIR
 OVS_CHECK_DBDIR
 OVS_CHECK_BACKTRACE
-OVS_CHECK_MALLOC_HOOKS
 OVS_CHECK_VALGRIND
 OVS_CHECK_SOCKET_LIBS
 OVS_CHECK_XENSERVER_VERSION
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 1308d1c..26b8058 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
 <at>  <at>  -192,26 +192,6  <at>  <at>  AC_DEFUN([OVS_CHECK_BACKTRACE],
                   [AC_DEFINE([HAVE_BACKTRACE], [1],
                              [Define to 1 if you have backtrace(3).])])])

(Continue reading)

Ben Pfaff | 23 Jul 01:09 2014

[PATCH] ovs-ctl: Add comment to explain why we only save ofports for pre-1.10.

We've had a couple of questions about this lately, including one suggestion
that we should always save the OpenFlow port numbers.  This explains why
the behavior is as it is.

Signed-off-by: Ben Pfaff <blp@...>
---
 utilities/ovs-ctl.in |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index 170f39a..6d2e938 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
 <at>  <at>  -1,5 +1,5  <at>  <at> 
 #! /bin/sh
-# Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 <at>  <at>  -297,7 +297,10  <at>  <at>  ovs_save () {
 }

 save_ofports_if_required () {
-    # Save ofports if we are upgrading from a pre-1.10 branch.
+    # Save OpenFlow port numbers if we are upgrading from a pre-1.10 branch.
+    #
+    # (Versions 1.10 and later save OpenFlow port numbers without assistance,
+    # so we don't have to do anything for them.
     case `ovs-appctl version | sed 1q` in
(Continue reading)

Ben Pfaff | 23 Jul 01:01 2014

Re: [PATCH] debian: Avoid -Wformat-zero-length warnings.

Thanks, applied to master.

On Tue, Jul 22, 2014 at 03:54:47PM -0700, Justin Pettit wrote:
> Acked-by: Justin Pettit <jpettit@...>
> 
> 
> On Tue, Jul 22, 2014 at 11:50 AM, Ben Pfaff <blp@...> wrote:
> 
> > Debian puts an extra "-Wformat" in the CFLAGS following OVS's own
> > "-Wformat -Wno-format-zero-length", which therefore overrides
> > -Wno-format-zero-length, so this commit adds an extra
> > -Wno-format-zero-length to avoid those false positives.
> >
> > Signed-off-by: Ben Pfaff <blp@...>
> > ---
> >  debian/rules |    7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/debian/rules b/debian/rules
> > index 5cf9f02..081f24a 100755
> > --- a/debian/rules
> > +++ b/debian/rules
> >  <at>  <at>  -35,6 +35,13  <at>  <at>  endif
> >  buildflags := $(shell if dpkg-buildflags --export=configure >/dev/null
> > 2>&1; \
> >                       then dpkg-buildflags --export=configure; fi)
> >
> > +# dpkg-buildflags tends to turn on -Wformat, which is admirable, but
> > +# the -Wformat-zero-length subset of that option triggers a couple of
> > +# false positives in Open vSwitch so turn it right back off again.
(Continue reading)

Ben Pfaff | 23 Jul 00:58 2014

[PATCH 1/3] ovs-ofctl: Add --unixctl command line option.

This matches the option offered by some other Open vSwitch daemons.  I
intend to use it in tests in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@...>
---
 utilities/ovs-ofctl.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index d3aad0f..7b4a006 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
 <at>  <at>  -91,6 +91,10  <at>  <at>  static int verbosity;
  * "snoop" command? */
 static bool timestamp;

+/* --unixctl-path: Path to use for unixctl server, for "monitor" and "snoop"
+     commands. */
+static char *unixctl_path;
+
 /* --sort, --rsort: Sort order. */
 enum sort_order { SORT_ASC, SORT_DESC };
 struct sort_criterion {
 <at>  <at>  -150,6 +154,7  <at>  <at>  parse_options(int argc, char *argv[])
         OPT_TIMESTAMP,
         OPT_SORT,
         OPT_RSORT,
+        OPT_UNIXCTL,
         DAEMON_OPTION_ENUMS,
         OFP_VERSION_OPTION_ENUMS,
(Continue reading)

Ben Pfaff | 23 Jul 00:48 2014

[PATCH] Use xstrdup() instead of strdup(), xmalloc() instead of malloc().

Signed-off-by: Ben Pfaff <blp@...>
---
 lib/daemon-windows.c |    2 +-
 lib/stream-tcp.c     |    4 ++--
 lib/unixctl.c        |    6 +++---
 tests/test-odp.c     |    2 +-
 tests/test-vconn.c   |    2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/daemon-windows.c b/lib/daemon-windows.c
index 33b3b36..3d1907e 100644
--- a/lib/daemon-windows.c
+++ b/lib/daemon-windows.c
 <at>  <at>  -478,7 +478,7  <at>  <at>  char *
 make_pidfile_name(const char *name)
 {
     if (name && strchr(name, ':')) {
-        return strdup(name);
+        return xstrdup(name);
     } else {
         return xasprintf("%s/%s.pid", ovs_rundir(), program_name);
     }
diff --git a/lib/stream-tcp.c b/lib/stream-tcp.c
index 0a1ba6b..5d0602a 100644
--- a/lib/stream-tcp.c
+++ b/lib/stream-tcp.c
 <at>  <at>  -106,7 +106,7  <at>  <at>  windows_open(const char *name, char *suffix, struct stream **streamp,
     if (!strchr(suffix, ':')) {
         path = xasprintf("%s/%s", ovs_rundir(), suffix);
     } else {
(Continue reading)


Gmane