]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
7 years agodatapath: backport: vlan: Introduce helper functions to check if skb is tagged
Yang, Yi Y [Mon, 13 Feb 2017 02:39:12 +0000 (10:39 +0800)]
datapath: backport: vlan: Introduce helper functions to check if skb is tagged

Upstream commit:
    commit f5a7fb88e1f82542ca14ba93a1d4fa35471c60ca
    Author: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
    Date:   Fri Mar 27 14:31:11 2015 +0900

    vlan: Introduce helper functions to check if skb is tagged

    Separate the two checks for single vlan and multiple vlans in
    netif_skb_features().  This allows us to move the check for multiple
    vlans to another function later.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Acked-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: backport: Fix vlan_insert_tag_set_proto().
Yang, Yi Y [Mon, 13 Feb 2017 02:39:16 +0000 (10:39 +0800)]
datapath: backport: Fix vlan_insert_tag_set_proto().

Fix cvlan test failure on old kernel versions with 802.1ad. The root
cause is the upcall re-inserts the VLAN back into the raw packet data,
but the TPID is hard coded to 0x8100. This affects kernels for which
HAVE_VLAN_INSERT_TAG_SET_PROTO is not set.

The below patch allows the cvlan and 802.ad tests to pass on debian
with 3.16 kernel.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Acked-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoFAQ: Update kernel support info.
Jarno Rajahalme [Tue, 28 Feb 2017 01:44:52 +0000 (17:44 -0800)]
FAQ: Update kernel support info.

OVS 2.7 works with Linux kernels 3.10-4.9.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
7 years agorhel-systemd: Document systemd behavior
Eelco Chaudron [Wed, 8 Feb 2017 16:28:22 +0000 (17:28 +0100)]
rhel-systemd: Document systemd behavior

This is a follow up patch to document the systemd behavior including
the change introduced by the "rhel-systemd: Restart openvswitch
service if a daemon crashes", still under review.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agorhel-systemd: Restart openvswitch service if a daemon crashes
Eelco Chaudron [Mon, 27 Feb 2017 20:56:41 +0000 (15:56 -0500)]
rhel-systemd: Restart openvswitch service if a daemon crashes

Currently if either ovsdb-server or ovs-vswitchd is crashing the
daemon is not restarting leaving the system in faulty state.
This patch will detect the daemon crash and will restart the
openvswitch service.

Here is a (bit to wide) table showing the behavior before and after
the patch. Note that only the Crash behavior has changed:

Before patch:
                               |       Process Status        |             systemctl <> status            |
                               | ovs-vswitchd | ovsdb-server | openvswitch  | ovs-vswitchd | ovsdb-server |
                               +--------------+--------------+--------------+--------------+--------------+
systemctl start openvswitch*   | started      | started      |active,exited |active,running|active,running|
Crash vswitchd                 | crashed      | stopped      |inactive, dead|failed        |inactive,dead |
Crash ovsdb                    | stopped      | crashed      |inactive, dead|inactive,dead |failed        |
systemctl restart openvswitch  | re-started   | re-started   |active,exited |active,running|active,running|
systemctl restart ovs-vswitchd | re-started   | re-started   |active,exited |active,running|active,running|
systemctl restart ovsdb-server | re-started   | re-started   |active,exited |active,running|active,running|
systemctl stop openvswitch     | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl stop ovs-vswitchd    | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl stop ovsdb-server    | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl start ovs-vswitchd*  | started      | started      |inactive, dead|active,running|active,running|
systemctl start ovsdb-server*  | not started  | started      |inactive, dead|inactive, dead|active,running|

With patch:
                               |       Process Status        |             systemctk <> status            |
                               | ovs-vswitchd | ovsdb-server | openvswitch  | ovs-vswitchd | ovsdb-server |
                               +--------------+--------------+--------------+--------------+--------------+
systemctl start openvswitch*   | started      | started      |active,exited |active,running|active,running|
Crash vswitchd                 | crash,started| re-started   |active,exited |active,running|active,running|
Crash ovsdb                    | re-started   | crash,started|active,exited |active,running|active,running|
systemctl restart openvswitch  | re-started   | re-started   |active,exited |active,running|active,running|
systemctl restart ovs-vswitchd | re-started   | re-started   |active,exited |active,running|active,running|
systemctl restart ovsdb-server | re-started   | re-started   |active,exited |active,running|active,running|
systemctl stop openvswitch     | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl stop ovs-vswitchd    | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl stop ovsdb-server    | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl start ovs-vswitchd*  | started      | started      |inactive, dead|active,running|active,running|
systemctl start ovsdb-server*  | not started  | started      |inactive, dead|inactive, dead|active,running|

* These commands where executed when no ovs related processes where
  running. All other commands where executed when OVS was successfully
  running.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Markos Chandras <mchandras@suse.de>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agomsi: add ovs-vswitchd trigger info
Alin Serdean [Tue, 21 Feb 2017 21:50:53 +0000 (21:50 +0000)]
msi: add ovs-vswitchd trigger info

This patch changes the service ovs-vswitchd from "auto" execution to
"demand" start.

This patch also introduces a custom action for the ovs-vswitchd service
in which the following command will be executed before the service startup:

sc triggerinfo ovs-vswitchd \
start/strcustom/6066F867-7CA1-4418-85FD-36E3F9C0600C/VmmsWmiEventProvider

The above command is a service trigger available since Windows 7.
More on the topic:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd405513%28v=vs.85%29.aspx

In out case we will wait until Microsoft-Windows-Hyper-V-VMMS has triggered
that the WMI provider: VmmsWmiEventProvider has started.

The change is needed because the network service inside VMMS starts slower than
ovs-vswitchd, which will cause a race condition because we check if the OVS
extension is enabled on a single switch.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovs-ctl: allow passing user:group to daemons
Aaron Conole [Tue, 21 Feb 2017 22:31:05 +0000 (17:31 -0500)]
ovs-ctl: allow passing user:group to daemons

The Open vSwitch daemons allow passing --user user[:group] to allow
spawning under different user privileges.  ovs-ctl now accepts --ovs-user
in the same form to pass this argument on, as well as create databases and
data directories with the appropriate privileges.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Markos Chandras <mchandras@suse.de>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoofproto/bond: fix interal flow leak of tcp-balance bond
Huanle Han [Sun, 19 Feb 2017 10:41:27 +0000 (18:41 +0800)]
ofproto/bond: fix interal flow leak of tcp-balance bond

ofproto_dpif_delete_internal_flow() never deletes any flows
because out_port and out_group mismatch.

Signed-off-by: Huanle Han <hanxueluo@gmail.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoofproto/bond: Fix bond post recirc rule leak.
Andy Zhou [Thu, 23 Feb 2017 08:38:16 +0000 (00:38 -0800)]
ofproto/bond: Fix bond post recirc rule leak.

When bond is removed or when its configuration changes,
the post recirculation rules that are installed by current
bond configuration, if any, should be also be removed.

Reported-by: Huanle Han <hanxueluo@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-February/328969.html
CC: Huanle Han <hanxueluo@gmail.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Huanle Han <hanxueluo@gmail.com>
7 years agoofproto/bond: Fix bond reconfiguration race condition.
Andy Zhou [Thu, 23 Feb 2017 07:31:31 +0000 (23:31 -0800)]
ofproto/bond: Fix bond reconfiguration race condition.

During the upcall thread bond output translation, bond_may_recirc()
is currently called outside the lock. In case the main thread executes
bond_reconfigure() at the same time, the upcall thread may find bond
state to be inconsistent when calling bond_update_post_recirc_rules().

This patch fixes the race condition by acquiring the write lock
before calling bond_may_recirc(). The APIs are refactored slightly.

The race condition can result in the following stack trace. Copied
from 'Reported-at':

    Thread 23 handler69:
    Invalid write of size 8
        update_recirc_rules (bond.c:385)
        bond_update_post_recirc_rules__ (bond.c:952)
        bond_update_post_recirc_rules (bond.c:960)
        output_normal (ofproto-dpif-xlate.c:2102)
        xlate_normal (ofproto-dpif-xlate.c:2858)
        xlate_output_action (ofproto-dpif-xlate.c:4407)
        do_xlate_actions (ofproto-dpif-xlate.c:5335)
        xlate_actions (ofproto-dpif-xlate.c:6198)
        upcall_xlate (ofproto-dpif-upcall.c:1129)
        process_upcall (ofproto-dpif-upcall.c:1271)
        recv_upcalls (ofproto-dpif-upcall.c:822)
        udpif_upcall_handler (ofproto-dpif-upcall.c:740)
    Address 0x18630490 is 1,904 bytes inside a block of size 12,288 free'd
        free (vg_replace_malloc.c:529)
        bond_entry_reset (bond.c:1635)
        bond_reconfigure (bond.c:457)
        bundle_set (ofproto-dpif.c:2896)
        ofproto_bundle_register (ofproto.c:1343)
        port_configure (bridge.c:1159)
        bridge_reconfigure (bridge.c:785)
        bridge_run (bridge.c:3099)
        main (ovs-vswitchd.c:111)
    Block was alloc'd at
        malloc (vg_replace_malloc.c:298)
        xmalloc (util.c:110)
        bond_entry_reset (bond.c:1629)
        bond_reconfigure (bond.c:457)
        bond_create (bond.c:245)
        bundle_set (ofproto-dpif.c:2900)
        ofproto_bundle_register (ofproto.c:1343)
        port_configure (bridge.c:1159)
        bridge_reconfigure (bridge.c:785)
        bridge_run (bridge.c:3099)
        main (ovs-vswitchd.c:111)

Reported-by: Huanle Han <hanxueluo@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-February/328969.html
CC: Huanle Han <hanxueluo@gmail.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Huanle Han <hanxueluo@gmail.com>
7 years agoovs-appctl: Document -T and --timeout options.
Ben Pfaff [Thu, 23 Feb 2017 20:40:01 +0000 (12:40 -0800)]
ovs-appctl: Document -T and --timeout options.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agorhel: Add hostname as dependency
Jakub Libosvar [Thu, 9 Feb 2017 11:11:28 +0000 (12:11 +0100)]
rhel: Add hostname as dependency

ovs-ctl script uses hostname. This patch adds dependency for
rhel systems.

Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agofedora: Add python3-openvswitch split package
Timothy Redaelli [Tue, 21 Feb 2017 15:29:51 +0000 (16:29 +0100)]
fedora: Add python3-openvswitch split package

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1412694
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agoofproto: Remove 'ofproto/self-check' from ovs-vswitchd manpage
Timothy Redaelli [Tue, 21 Feb 2017 11:13:42 +0000 (12:13 +0100)]
ofproto: Remove 'ofproto/self-check' from ovs-vswitchd manpage

ofproto/self-check was removed in commit e79a6c83, so this patch
removes the man page item.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodocs: fix typo in testing.rst
Lance Richardson [Mon, 20 Feb 2017 18:12:30 +0000 (13:12 -0500)]
docs: fix typo in testing.rst

Coverage section refers to "check-lcoc" target, should be
"check-lcov".

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoMakefile.am: Suppress echoing of config-h-check.
Timothy Redaelli [Wed, 22 Feb 2017 16:18:28 +0000 (17:18 +0100)]
Makefile.am: Suppress echoing of config-h-check.

Fixes: c458e4a372d1 ("Makefile.am: Avoid include/ depending on lib/.")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoovn pacemaker: Pass --db-(n/s)b-addr option when starting ovsdb-servers
Numan Siddique [Wed, 22 Feb 2017 14:58:36 +0000 (20:28 +0530)]
ovn pacemaker: Pass --db-(n/s)b-addr option when starting ovsdb-servers

When pacemaker script, starts the ovsdb-servers in all the nodes,
it doesn't pass the --db-(n/s)b-addr=MASTER_IP option.
When pacemaker promotes a master, it won't be listening on the
master ip address unless "ovn-nbctl set-connection" is used.

In this patch this option, along with --db-(n/s)b-create-insecure-remote=yes
for "tcp" connection types is passed when starting the OVN ovsdb-servers
to overcome this issue.

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agowindows: Broken internal netdevs
Alin Serdean [Fri, 17 Feb 2017 11:10:27 +0000 (11:10 +0000)]
windows: Broken internal netdevs

Commit fa07525f9cf3fa698ebc23ea09da477d3d881a87 fixed error logging for
for regular netdevs, however it overlooked "internal" netdevs.

This patch allows "internal" netdev objects to be created and passed to
dpif_port_add().

Reported-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Nithin Raju <Nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodoc: Describe backporting process.
Joe Stringer [Fri, 10 Feb 2017 23:01:11 +0000 (15:01 -0800)]
doc: Describe backporting process.

This patch documents the backporting process, and provides a walkthrough
for developers who would like to backport upstream Linux patches into
the Open vSwitch tree. Nothing in this documentation should be
surprising or new; it merely puts the existing process into words.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agoMakefile.am: Avoid include/ depending on lib/.
Yi-Hung Wei [Sat, 18 Feb 2017 01:47:45 +0000 (17:47 -0800)]
Makefile.am: Avoid include/ depending on lib/.

Add a build check that public openvswitch header file should not include
internal library.

Suggested-by: Joe Stringer <joe@ovn.org>
Suggested-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agometa-flow: Remove cmap dependency.
Yi-Hung Wei [Sat, 18 Feb 2017 01:47:44 +0000 (17:47 -0800)]
meta-flow: Remove cmap dependency.

Previous patch 04f48a68 ("ofp-actions: Fix variable length meta-flow OXMs.")
introduced dependency of an internal library (cmap.h) to ovs public
interface (meta-flow.h) that may cause potential building problem. In this
patch, we remove cmap from struct mf_field, and provide a wrapper struct
vl_mff_map that resolve the dependency problem.

Fixes: 04f48a68c428 ("ofp-actions: Fix variable length meta-flow OXMs.")
Suggested-by: Joe Stringer <joe@ovn.org>
Suggested-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoofp-msgs: Remove unnecessary #include.
Yi-Hung Wei [Sat, 18 Feb 2017 01:47:43 +0000 (17:47 -0800)]
ofp-msgs: Remove unnecessary #include.

Include of lib/*.h from include/openvswitch/*.h is disallowed.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoofproto/bond: Fix bond/show when all interfaces are disabled
Andy Zhou [Wed, 15 Feb 2017 22:04:29 +0000 (14:04 -0800)]
ofproto/bond: Fix bond/show when all interfaces are disabled

Without this patch, when all slaves are disabled, the 'bond/show'
command still shows the mac address of last active slave in
'active slave mac' output. This patch clears them to zeros.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: nickcooper-zhangtonghao <nic@opencloud.tech>
7 years agopython: Prevent extra unexpected reply debug logs.
Terry Wilson [Fri, 17 Feb 2017 17:27:46 +0000 (11:27 -0600)]
python: Prevent extra unexpected reply debug logs.

Since __txn_process_reply always returns None, the existing code
will always hit the final else for replies and log a debug message
about receiving an unexpected reply. In the C version,
ovsdb_idl_txn_process_reply returns true any time the txn is found,
so that behavior is duplicated here.

Signed-off-by: Terry Wilson <twilson@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agonetdev-dpdk: Fix rx_error stat for dpdk ports.
Ian Stokes [Thu, 16 Feb 2017 15:31:22 +0000 (15:31 +0000)]
netdev-dpdk: Fix rx_error stat for dpdk ports.

"rx_error" stat for a DPDK interface was calculated with the assumption that
dropped packets due to hardware buffer overload were counted as errors
in DPDK and the rte ierror stat included rte imissed packets i.e.

rx_errors = rte_stats.ierrors - rte_stats.imissed

This results in negative statistic values as imissed packets are no longer
counted as part of ierror since DPDK v.16.04.

Fix this by setting rx_errors equal to ierrors only.

Fixes: 9e3ddd45 (netdev-dpdk: Add some missing statistics.)
CC: Timo Puha <timox.puha@intel.com>)
Reported-by: Stepan Andrushko <stepanx.andrushko@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoovs-appctl: Print lacp_fallback_ab info in "bond/show".
nickcooper-zhangtonghao [Thu, 16 Feb 2017 10:52:45 +0000 (02:52 -0800)]
ovs-appctl: Print lacp_fallback_ab info in "bond/show".

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoofproto/bond: Drop traffic in balance-tcp mode without lacp.
nickcooper-zhangtonghao [Thu, 16 Feb 2017 01:32:18 +0000 (17:32 -0800)]
ofproto/bond: Drop traffic in balance-tcp mode without lacp.

The balance-tcp mode requires the upstream switch to support 802.3ad
with successful LACP negotiation. When bond ports are configured to
balance-tcp mode without lacp, drop the traffic.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agodpif-netdev: Conditional EMC insert
Ciara Loftus [Thu, 16 Feb 2017 10:22:10 +0000 (10:22 +0000)]
dpif-netdev: Conditional EMC insert

Unconditional insertion of EMC entries results in EMC thrashing at high
numbers of parallel flows. When this occurs, the performance of the EMC
often falls below that of the dpcls classifier, rendering the EMC
practically useless.

Instead of unconditionally inserting entries into the EMC when a miss
occurs, use a 1% probability of insertion. This ensures that the most
frequent flows have the highest chance of creating an entry in the EMC,
and the probability of thrashing the EMC is also greatly reduced.

The probability of insertion is configurable, via the
other_config:emc-insert-inv-prob option. This value sets the average
probability of insertion to 1/emc-insert-inv-prob.

For example the following command changes the insertion probability to
(on average) 1 in every 20 packets ie. 1/20 ie. 5%.

ovs-vsctl set Open_vSwitch . other_config:emc-insert-inv-prob=20

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Georg Schmuecking <georg.schmuecking@ericsson.com>
Co-authored-by: Georg Schmuecking <georg.schmuecking@ericsson.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoovn: Mention distributed NAT in NEWS
Mickey Spiegel [Fri, 10 Feb 2017 23:07:28 +0000 (15:07 -0800)]
ovn: Mention distributed NAT in NEWS

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodocker.rst: Add documentation to open up TCP ports.
Gurucharan Shetty [Tue, 7 Feb 2017 12:53:16 +0000 (04:53 -0800)]
docker.rst: Add documentation to open up TCP ports.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agovswitchd: Move config_ofproto_types call before bridge_add_port
Shashank Ram [Wed, 15 Feb 2017 18:02:40 +0000 (10:02 -0800)]
vswitchd: Move config_ofproto_types call before bridge_add_port

Currently, the call to config_ofproto_types() happens at the end
of bridge_reconfigure(), after missing ofprotos and ports are created.
However, it might be usefull to make this call before adding missing
ports through the dpif interface. With the current use case
(dpif-netdev), this will save us a reconfiguration cycle.

The call to config_ofproto_types() was introduced as a
part of passing the Openvswitch other_config smap to dpif.
However, if we want to do this before the ports are added,
it needs to be done after ofproto_create() is called so that
dpif_backer is added to all_dpif_backers list. Once the
dpif_backer is added, the call to config_ofproto_types()
will ensure that the set_config handler in dpif-netdev/netlink.c
is called.

Signed-off-by: Shashank Ram <rams@vmware.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodoc: Updates bonding.rst because of api changed.
nickcooper-zhangtonghao [Tue, 14 Feb 2017 06:52:53 +0000 (22:52 -0800)]
doc: Updates bonding.rst because of api changed.

Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoofproto/bond: Validate active-slave mac.
nickcooper-zhangtonghao [Tue, 14 Feb 2017 06:52:50 +0000 (22:52 -0800)]
ofproto/bond: Validate active-slave mac.

That the mac of active-slave is invalid(e.g. 00:00:00:00:00:00)
is incidental. The reason is described as below.

In the bridge_reconfig():
1. bond devices created in port_configure().
2. the bonded interfaces may be disabled even calling bridge_run__(),
   because the interface link is not ready.

The OvS will run bridge_run__() in next loop. In next loop, the
active-slave may be selected. But OvS the bridge_reconfig() again,
the bond_reconfigure() set active-slave mac zero and flag false.
If using the 'ovs-appctl bond/show bond-name' to check active-slave
mac, you will find the mac is zero and mac in the ovsdb is also zero.

The active_slave_mac and active_slave_changed should be initialized
when created.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoovn-northd ipam: handle the static MAC updates by the user
Numan Siddique [Mon, 13 Feb 2017 07:13:03 +0000 (12:43 +0530)]
ovn-northd ipam: handle the static MAC updates by the user

Changing the logical port's address from "MAC1 dynamic"
to "MAC2 dynamic" is not handled by ovn-northd. This patch
fixes this issue.

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1408121
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agoovsdb: Print enum elements for man pages in alphabetical order.
Justin Pettit [Wed, 15 Feb 2017 00:50:32 +0000 (16:50 -0800)]
ovsdb: Print enum elements for man pages in alphabetical order.

The previous behavior printed them in a pseudorandom order, which made
them look odd in man pages.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
7 years agoRemove build-time generated files when "make clean" is run.
Justin Pettit [Tue, 14 Feb 2017 01:20:56 +0000 (17:20 -0800)]
Remove build-time generated files when "make clean" is run.

"make clean" should remove all files generated by building a program, while
"make distclean" should also remove files generated by configuring the
program.  Previously some generated files during the build process, such
as man pages, were left behind when "make clean" was run.  This commit
only leaves configuration files after "make clean" is run, and removes
all other generated files.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovsdb: Prevent OVSDB server from replicating itself.
Andy Zhou [Mon, 6 Feb 2017 22:00:22 +0000 (14:00 -0800)]
ovsdb: Prevent OVSDB server from replicating itself.

Replication OVSDB server from itself is usually caused by configuration
errors. Such configuration errors can lead to OVSDB server data loss.
See "reported-at" for more details.

This patch adds logics that prevent OVSDB server from replicating
itself.

Reported-by: Guishuai Li <ligs@dtdream.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326963.html
Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovsdb: Add OVSDB server per instance UUID.
Andy Zhou [Mon, 6 Feb 2017 20:43:35 +0000 (12:43 -0800)]
ovsdb: Add OVSDB server per instance UUID.

Currently, there is no way for an OVSDB server to ID itself. This patch
adds a UUID field that is populated every time OVSDB server runs.
Later patch will make use this UUID to detect and stop and OVSDB server
from replicating itself.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovsdb: Gracefully handle replication errors.
Andy Zhou [Wed, 8 Feb 2017 03:38:13 +0000 (19:38 -0800)]
ovsdb: Gracefully handle replication errors.

Sometimes replication session can fail mostly due to replication
configurations. i.e. replicating from a database with a different
version of the schema.

Currently, those errors are treated as fatal errors, and stops the
OVSDB server. A better way to handle those error may be to stop
only the replication session, and leave the OVSDB server up, so that
the replication can be restarted, may be with a different configuration,
at a later time.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoAUTHORS: Add Mickey Spiegel
Mickey Spiegel [Fri, 10 Feb 2017 23:15:14 +0000 (15:15 -0800)]
AUTHORS: Add Mickey Spiegel

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agorhel: make openvswitch service start return when ready
Alan Pevec [Sat, 11 Feb 2017 00:03:19 +0000 (19:03 -0500)]
rhel: make openvswitch service start return when ready

In OVS 2.6 openvswitch systemd service was changed to use BindsTo
instead of Requires for sub-services but also removed them from After

This made main openvswitch service return before sub-services were ready
breaking scripts which assumed everything is ready after systemctl start
e.g. in OpenStack CI infra [1] is calling ovs-vsctl immediately after
service start exposing a race in virtualized CI environment:
2017-02-09T23:11:12.498Z|00007|bridge|INFO|ovs-vswitchd (Open vSwitch) 2.6.1
but ovs-ctl tried to access it few msec too early:
2017-02-09 23:11:12.352493 | ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)

Solution is to add ordering dependencies, BindsTo/Requires do not ensure it [2]

[1] https://github.com/openstack-infra/devstack-gate/blob/c435a724bd257b22a2e39e8e9125c11302a8c81d/functions.sh#L1057-L1078

[2] https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Requires=

Fixes: 84ad120 ("rhel: Improved Systemd Integration")
Signed-off-by: Alan Pevec <alan.pevec@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agorhel: Fix dpdk-devel version and dependencies in fedora packager
Timothy Redaelli [Thu, 9 Feb 2017 14:47:50 +0000 (15:47 +0100)]
rhel: Fix dpdk-devel version and dependencies in fedora packager

Now dpdk-devel >= 16.11 is needed and also libpcap-devel numactl-devel

Tested on mock with rawhide chroot and Fedora 23 vagrant machine by using the
rawhide dpdk and dpdk-devel packages

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodpdk: Fixes memory leak in dpdk_init__().
nickcooper-zhangtonghao [Thu, 9 Feb 2017 11:25:41 +0000 (03:25 -0800)]
dpdk: Fixes memory leak in dpdk_init__().

If users configure the 'vhost-sock-dir' for dpdk, the memory
allocated by xstrdup(ovs_rundir()) is not freed. This patch
allows the process_vhost_flags to xstrdup() for val or
default_val according to configuration and the caller must
free new_val when it is no longer needed.

Fixes: 01961bbdd34a ("dpdk: New module with some code from netdev-dpdk.")
CC: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agorhel/ifup: support vhost-user client mode
Aaron Conole [Fri, 10 Feb 2017 17:49:38 +0000 (12:49 -0500)]
rhel/ifup: support vhost-user client mode

This adds support for ifup to configure client-mode sockets by exposing
two new variables $OVS_PORT_MODE and $OVS_PORT_PATH to the ifcfg
scripts.  When OVS_PORT_MODE is set to 'client', the OVS_PORT_PATH will
be passed as the vhost-server-path option.

No change is needed to ifdown because the OVSDPDKVhostUserPort type
already has an appropriate entry.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodoc: Clarify how user space is experimental.
Ian Stokes [Wed, 8 Feb 2017 10:08:14 +0000 (10:08 +0000)]
doc: Clarify how user space is experimental.

Clarify that the use of the user space datapath with non DPDK devices is
considered experimental.

Fixes: 602e24ee189b (doc: Remove experimental warning for DPDK.)
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Co-authored-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoovs-ofctl: fix memory leak reported by valgrind.
William Tu [Wed, 8 Feb 2017 15:03:54 +0000 (07:03 -0800)]
ovs-ofctl: fix memory leak reported by valgrind.

Testcase 1057 ofproto-dpif - fragment handling - upcall reports
the following leak:
  xrealloc (util.c:123)
  vconn_dump_flows (vconn.c:1030)
  read_flows_from_switch (ovs-ofctl.c:3360)
  ofctl_replace_flows (ovs-ofctl.c:3433)
  ovs_cmdl_run_command__ (command-line.c:115)

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoovs-router: fix memory leak reported by valgrind.
William Tu [Wed, 8 Feb 2017 15:03:53 +0000 (07:03 -0800)]
ovs-router: fix memory leak reported by valgrind.

Valgrind testcase 772: appctl - route/lookup6 reports the
following definitely lost:
  xmalloc (util.c:112)
  miniflow_alloc (flow.c:2500)
  minimatch_init (match.c:1387)
  rt_entry_delete (ovs-router.c:274)
  ovs_router_del (ovs-router.c:384)
  process_command (unixctl.c:313)

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agouuid: New macro UUID_ZERO for an all-zero expression or initializer.
Ben Pfaff [Fri, 11 Nov 2016 23:47:54 +0000 (15:47 -0800)]
uuid: New macro UUID_ZERO for an all-zero expression or initializer.

This is convenient in expressions, e.g. "uuid = x ? *x : UUID_ZERO;".

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agojsonrpc: Fix capitalization of parameter name.
Ben Pfaff [Wed, 8 Feb 2017 16:31:17 +0000 (08:31 -0800)]
jsonrpc: Fix capitalization of parameter name.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agosmap: Improve comment on SMAP_CONST1, SMAP_CONST2 macros.
Ben Pfaff [Fri, 11 Nov 2016 23:57:45 +0000 (15:57 -0800)]
smap: Improve comment on SMAP_CONST1, SMAP_CONST2 macros.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agotests: Generate valgrind wrappers only for real test programs.
Ben Pfaff [Fri, 11 Nov 2016 23:52:01 +0000 (15:52 -0800)]
tests: Generate valgrind wrappers only for real test programs.

ovstest is the main test binary these days, and that has been so for a
long time, but the tests code was still generating valgrind wrappers for
other binaries that went away a long time ago.  That's harmless but
confusing, so this commit fixes it.

Also fixes alphabetical ordering and adds the missing test-strtok_r
wrapper.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoofctrl: Free contents of symbol table in ofctrl_destroy().
Ben Pfaff [Wed, 8 Feb 2017 16:40:21 +0000 (08:40 -0800)]
ofctrl: Free contents of symbol table in ofctrl_destroy().

This fixes a memory leak, although it was not a significant leak because
the symbol table is in use until shortly before ovn-controller exits.

Reported-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agowindows: netdev report error if query failed
Alin Serdean [Wed, 8 Feb 2017 06:41:24 +0000 (06:41 +0000)]
windows: netdev report error if query failed

The netdev Windows construct uses query_netdev to see if a port exists
in the datapath, in the case an error occurred in the reply message
we returned 0, meaning netdev_open was successful.

This patch fixes fixes that problem.

Reported-at: https://github.com/openvswitch/ovs-issues/issues/125
Reported-by: Shashank Ram <rams@vmware.com>
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-By: Shashank Ram <rams@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agosystem-ovn.at: Fix a race condition.
Gurucharan Shetty [Mon, 6 Feb 2017 11:35:44 +0000 (03:35 -0800)]
system-ovn.at: Fix a race condition.

Commit 2f35b6c5c12c (system-ovn.at: Fix race conditions.)
fixed a number of race conditions, but left atleast one out.
This commit fixes that race condition.

Reported-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodoc: Remove experimental warning for DPDK.
Ian Stokes [Mon, 6 Feb 2017 17:20:35 +0000 (17:20 +0000)]
doc: Remove experimental warning for DPDK.

Remove the experimental warning tag in documentation regarding OVS deployed
with DPDK.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoofproto: Uses the VLOG_WARN_RL instead of VLOG_WARN.
nickcooper-zhangtonghao [Mon, 6 Feb 2017 13:38:07 +0000 (05:38 -0800)]
ofproto: Uses the VLOG_WARN_RL instead of VLOG_WARN.

There are a lot of logs when OvS bridges, connected to controllers,
can't find the right routes. So we may use the VLOG_WARN_RL instead
of VLOG_WARN to limit the log messages. The netdev-open and
arp-lookingup are in the same case in this function.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agorhel: Fix firewalld additions.
Russell Bryant [Sun, 5 Feb 2017 03:38:22 +0000 (22:38 -0500)]
rhel: Fix firewalld additions.

When I updated this patch for v2, I made some mistakes.  This fixes them.
The first is that we need to create a directory in the rpm build root for
the firewalld service files before we can install them there.  Second,
I made two typos when I updated the patch to use %{_prefix}.

Fixes: 55f36be59122 ("rhel: Firewall service files for OVN.")
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agoodp: Fix sample action in userspace
Andy Zhou [Thu, 12 Jan 2017 00:00:04 +0000 (16:00 -0800)]
odp: Fix sample action in userspace

User space implementation of the sample action is not consistent with
kernel datapath. In kernel datapath, the side effects of actions
within the sample actions are not visible to the subsequent actions.
Current user space handling does not follow the same logic. This patch
makes them consistent.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovs-vsctl: Disallow empty bridge, port, and interface names.
Ben Pfaff [Fri, 3 Feb 2017 22:13:38 +0000 (14:13 -0800)]
ovs-vsctl: Disallow empty bridge, port, and interface names.

Reported-by: Gabor Locsei <gabor.locsei@ericsson.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2017-February/043613.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agonetdev: Reject empty names in netdev_open().
Ben Pfaff [Fri, 3 Feb 2017 16:58:27 +0000 (08:58 -0800)]
netdev: Reject empty names in netdev_open().

The empty string is not a valid name for a network device.  I would have
expected that each of the netdev provider implementations would reject an
empty string, but there was a special case for Linux tap devices where they
instead caused unexpected behavior.  This commit should fix the problem for
those devices and every other kind.

Reported-by: Gabor Locsei <gabor.locsei@ericsson.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2017-February/043613.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Girish Moodalbail <girish.moodalbail@oracle.com>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agorhel: Firewall service files for OVN.
Marcin Mirecki [Fri, 3 Feb 2017 20:47:50 +0000 (15:47 -0500)]
rhel: Firewall service files for OVN.

Firewall service files allowing to open firewalld
ports required for running OVN

Signed-off-by: Marcin Mirecki <mmirecki@redhat.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Update DPDK version for 2.7 release.
Ian Stokes [Thu, 2 Feb 2017 16:30:15 +0000 (16:30 +0000)]
doc: Update DPDK version for 2.7 release.

Add DPDK version required for the OVS 2.7 release in documentation.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodpif-netdev: Pass Openvswitch other_config smap to dpif.
Daniele Di Proietto [Sat, 28 Jan 2017 00:41:36 +0000 (16:41 -0800)]
dpif-netdev: Pass Openvswitch other_config smap to dpif.

Currently we parse the 'other_config' column in Openvswitch table in
bridge.c.  We extract the values (just 'pmd-cpu-mask' for now) and we
pass them down to the datapath, via different layers.

If we want to pass other values to dpif-netdev.c (like we recently
discussed) we would have to touch ofproto.c, ofproto-dpif.c and dpif.c.

This patch sends the entire other_config column to dpif-netdev, so that
dpif-netdev can extract the values it's interested in.

No functional change.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agorhel: Remove obsolete OVSDPDKVhostPort from ifdown script.
Daniele Di Proietto [Tue, 24 Jan 2017 22:55:52 +0000 (14:55 -0800)]
rhel: Remove obsolete OVSDPDKVhostPort from ifdown script.

The support for vhost cuse port has been removed long ago.

Fixes:419876444357("netdev-dpdk: Remove dpdkvhostcuse ports")
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: Add missing netdev_close in setup_qos.
Russell Bryant [Thu, 2 Feb 2017 07:04:07 +0000 (02:04 -0500)]
ovn: Add missing netdev_close in setup_qos.

We missed calling netdev_close in a couple of places.  One was in an error
condition rarely hit.  The second was just introduced and would be hit in
all cases where QoS is not in use.

Fixes: dc2dab6e6de5 ("ovn-controller: Configure interface QoS only if it would actually be used.")
Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agodocs: Add OVS and OVN headings to pages.
Russell Bryant [Thu, 2 Feb 2017 07:02:34 +0000 (02:02 -0500)]
docs: Add OVS and OVN headings to pages.

Update the "deep dive" and "howto" pages with headings that more clearly
indicate the separate lists of OVS or OVN content.  Also add a link to
ovn-architecture from the "deep dive" page as it seems quite relevant
there.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agosystem-ovn.at: Fix race conditions.
Gurucharan Shetty [Thu, 2 Feb 2017 07:49:00 +0000 (23:49 -0800)]
system-ovn.at: Fix race conditions.

The code to wait for a particular type of flow
in ovs-vswitchd was not specific enough. This commit
changes that and to be doubly sure, also uses the
sync command.

Reported-by: Andy Zhou <azhou@ovn.org>
Reported-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath-windows: GENEVE Check for flow destination port
Alin Serdean [Tue, 10 Jan 2017 16:48:30 +0000 (16:48 +0000)]
datapath-windows: GENEVE Check for flow destination port

Change the UDP destination port(GENEVE header) to check if it was set by
the userspace, use it if it was set.
If the userspace did not specify a destination port, use the configured
vport destination port.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
7 years agodatapath-windows: STT Check for flow destination port
Alin Serdean [Tue, 10 Jan 2017 16:48:29 +0000 (16:48 +0000)]
datapath-windows: STT Check for flow destination port

Change the TCP destination port(STT header) to check if it was set by
the userspace, use it if it was set.
If the userspace did not specify a destination port, use the configured
vport destination port.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
7 years agodatapath-windows: VXLAN Check for flow destination port
Alin Serdean [Tue, 10 Jan 2017 16:48:29 +0000 (16:48 +0000)]
datapath-windows: VXLAN Check for flow destination port

Change the UDP destination port(VXLAN header) to check if it was set by
the userspace, use it if it was set.
If the userspace did not specify a destination port, use the configured
vport destination port.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
7 years agodatapath-windows: Add support for OVS_TUNNEL_KEY_ATTR_TP_DST
Alin Serdean [Tue, 10 Jan 2017 16:48:29 +0000 (16:48 +0000)]
datapath-windows: Add support for OVS_TUNNEL_KEY_ATTR_TP_DST

Add support for netlink attribute OVS_TUNNEL_KEY_ATTR_TP_DST get/set
flow functions.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
7 years agodatapath-windows: Allow tunnel action to modify destination port
Alin Serdean [Tue, 10 Jan 2017 16:48:29 +0000 (16:48 +0000)]
datapath-windows: Allow tunnel action to modify destination port

'OvsTunnelAttrToIPv4TunnelKey' modifies 'tunkey' with the received netlink
attributes(i.e. OVS_TUNNEL_KEY_ATTR_IPV4_DST).

Change the order of the value assignment to reflect the values received via
userspace.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
7 years agotests: Fix race in MPLS translate.
Alin Serdean [Wed, 1 Feb 2017 14:39:36 +0000 (14:39 +0000)]
tests: Fix race in MPLS translate.

On slow systems ofproto/trace in combination with a recirculation ID
causes issues because the flow is evicted before the second packet
can reach it.

I.e:
"
Flow: recirc_id=0x2,ip,in_port=1,vlan_tci=0x0000,dl_src=f8:bc:12:44:34:b6,
dl_dst=f8:bc:12:46:58:e0,nw_src=1.1.2.92,nw_dst=1.1.2.88,nw_proto=47,
nw_tos=0,nw_ecn=0,nw_ttl=64

bridge("br0")
-------------
     >>>> Recirculation context not found for ID 2 <<<<

Final flow: unchanged
Megaflow: recirc_id=0x2,ip,in_port=1,nw_frag=no
Datapath actions: drop
Translation failed (No recirculation context), packet is dropped.
"

Since eviction of the flows is not needed for the current logic,
this commit adds a time/stop to bypass the problem.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-trace: Style improvements.
Ben Pfaff [Fri, 13 Jan 2017 19:30:07 +0000 (11:30 -0800)]
ovn-trace: Style improvements.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agoodp: Add datapath clone action parser.
Andy Zhou [Wed, 1 Feb 2017 03:23:27 +0000 (19:23 -0800)]
odp: Add datapath clone action parser.

When adding userspace datapath clone action, the corresponding odp
actions parser and unit tests were missing. This patch adds them.

Reported-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agotun-metadata: Fix entry key documentation.
Yi-Hung Wei [Wed, 1 Feb 2017 01:02:03 +0000 (17:02 -0800)]
tun-metadata: Fix entry key documentation.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoofp-actions: Fix variable length meta-flow OXMs.
Yi-Hung Wei [Fri, 20 Jan 2017 23:12:21 +0000 (15:12 -0800)]
ofp-actions: Fix variable length meta-flow OXMs.

Previously, if a flow action that involves a tunnel metadata meta-flow
field is dumped from vswitchd, the replied field length in the OXM header
is filled with the maximum possible field length, instead of the length
configured in the tunnel TLV mapping table. To solve this issue, this patch
introduces the following changes.

In order to maintain the correct length of variable length mf_fields (i.e.
tun_metadata), this patch creates a per-switch based map (struct vl_mff_map)
that hosts the variable length mf_fields. This map is updated when a
controller adds/deletes tlv-mapping entries to/from a switch. Although the
per-swtch based vl_mff_map only hosts tun_metadata for now, it is able to
support new variable length mf_fields in the future.

With this commit, when a switch decodes a flow action with mf_field, the switch
firstly looks up the global mf_fields map to identify the mf_field type. For
the variable length mf_fields, the switch uses the vl_mff_map to get the
configured mf_field entries. By lookig up vl_mff_map, the switch can check
if the added flow action access beyond the configured size of a variable
length mf_field, and the switch reports an ofperr if the controller adds a flow
with unmapped variable length mf_field. Later on, when a controller request
flows from the switch, with the per-switch based mf_fields, the switch will
encode the OXM header with correct length for variable length mf_fields.

To use the vl_mff_map for decoding flow actions, extract-ofp-actions is
updated to pass the vl_mff_map to the required action decoding functions.
Also, a new error code is introduced to identify a flow with an invalid
variable length mf_field. Moreover, a testcase is added to prevent future
regressions.

Committer notes:
 - Factor out common code
 - Style fixups
 - Rename OFPERR_NXFMFC_INVALID_VL_MFF -> OFPERR_NXFMFC_INVALID_TLV_FIELD

VMWare-BZ: #1768370
Reported-by: Harold Lim <haroldl@vmware.com>
Suggested-by: Joe Stringer <joe@ovn.org>
Suggested-by: Jarno Rajahalme <jarno@ovn.org>
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoovn-controller: Configure interface QoS only if it would actually be used.
Ben Pfaff [Wed, 1 Feb 2017 17:21:38 +0000 (09:21 -0800)]
ovn-controller: Configure interface QoS only if it would actually be used.

Until now, ovn-controller has unconditionally configured linux-htb on
physical interfaces.  QoS is pretty much always trouble, but it's even more
trouble if we set it up for no good reason.  We received a bug report, in
particular, that doing this disrupts connectivity in Docker.

This commit attempts to make that less likely, by making ovn-controller
only configure a qdisc if QoS support has in turn been configured in OVN.
The same problems as before will recur if QoS support is actually
configured, but at least now there's some purpose, and possibly a symptom
that the user can better diagnose ("I turned on QoS and OVN stopped
working" is at least a cause-and-effect chain that makes some sense).

Reported-by: Ritesh Rekhi <ritesh.rekhi@nutanix.com>
Reported-by: Hexin Wang <hexin.wang@nutanix.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2017-February/043564.html
Tested-by: Hexin Wang <hexin.wang@nutanix.com>
Tested-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2017-February/043575.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: Fix memory leak and bug in setup_qos().
Ben Pfaff [Wed, 1 Feb 2017 16:42:37 +0000 (08:42 -0800)]
ovn-controller: Fix memory leak and bug in setup_qos().

The caller of netdev_get_qos() is responsible for freeing its 'details'
smap.

Also, the previous qdisc details, for some arbitrary previous type of QoS,
aren't relevant for changing the type of QoS.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoPrepare for post-2.7.0 (2.7.90).
Justin Pettit [Wed, 1 Feb 2017 01:52:16 +0000 (17:52 -0800)]
Prepare for post-2.7.0 (2.7.90).

Signed-off-by: Justin Pettit <jpettit@ovn.org>
7 years agoovn: fix slave node can not connect to the master node using SSL, for pacemaker
Guoshuai Li [Wed, 11 Jan 2017 12:11:33 +0000 (04:11 -0800)]
ovn: fix slave node can not connect to the master node using SSL, for pacemaker

The default slave node connect to the master node using TCP, and
the pacemaker can not modify the protocol and port of the
connection.  Add pacemaker parameters to support the connection of
the slave node to the master node using a different protocol and port.

Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoofproto-dpif: Reduce the time to create many bridges.
Sha Zhang [Tue, 31 Jan 2017 23:07:15 +0000 (15:07 -0800)]
ofproto-dpif: Reduce the time to create many bridges.

This patch moves xlate_txn_start() and xlate_txn_commit() out of the loop
traversing all the ofproto-dpifs to reduce the time of creating a large mount
of bridges in separate database transactions.  As a global variable, new_xcfg
should only be allocated at the beginning and commited at the end once time,
rather than doing it repeatedly in the loop body.

Signed-off-by: Sha Zhang <zhangsha.zhang@huawei.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: Provide the option to set Encap.options:csum
Numan Siddique [Sun, 15 Jan 2017 07:06:09 +0000 (12:36 +0530)]
ovn-controller: Provide the option to set Encap.options:csum

ovn-controller by default enables tunnel encapsulation checksums
for geneve tunnels. With this patch user can set the desired value
in Open_vSwitch.external_ids:ovn_encap_csum.

This option will be useful in cases where enabling tunnel
encapsulation checksums incur significant performance loss due to
limitations in checksum offloading capabilities of the nics.

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-trace: Fix memory leaks.
Ben Pfaff [Fri, 13 Jan 2017 19:28:54 +0000 (11:28 -0800)]
ovn-trace: Fix memory leaks.

Suggested-by: Justin Pettit <jpettit@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-nbctl: check for duplicated ACL adding.
Han Zhou [Thu, 19 Jan 2017 02:51:16 +0000 (18:51 -0800)]
ovn-nbctl: check for duplicated ACL adding.

Check for duplicated ACL adding and add option --may-exist for
ovn-nbctl acl-add.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoappveyor: Bump OpenSSL version
Alin Serdean [Tue, 31 Jan 2017 22:00:51 +0000 (22:00 +0000)]
appveyor: Bump OpenSSL version

The URL https://slproweb.com/download/Win32OpenSSL-1_0_2j.exe is
no longer valid.

Bump to the variables to the latest version of OpenSSL version.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodocumentation: Windows supports multiple VTEP/NICs now.
Alin Serdean [Fri, 27 Jan 2017 02:30:31 +0000 (02:30 +0000)]
documentation: Windows supports multiple VTEP/NICs now.

Multiple VTEP and multiple physical NICs are supported on Hyper-V now.
Update the documentation

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
7 years agoAUTHORS: Add Roi Dayan.
Ben Pfaff [Tue, 31 Jan 2017 16:13:03 +0000 (08:13 -0800)]
AUTHORS: Add Roi Dayan.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agonetlink-socket: Fix possiblity of nl_transact dereferencing null pointer
Roi Dayan [Tue, 31 Jan 2017 06:40:08 +0000 (08:40 +0200)]
netlink-socket: Fix possiblity of nl_transact dereferencing null pointer

Many nl_transact callers and its wrapper tc_transact pass NULL for replyp
which is being accessed in error flow without being checked if null or not.

Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agorhel: Fix ifdown for OVSDPDKBond.
Daniele Di Proietto [Tue, 24 Jan 2017 22:51:54 +0000 (14:51 -0800)]
rhel: Fix ifdown for OVSDPDKBond.

The OVSDPDKBond case wasn't handled in the rhel ifdown script.

Fixes: f6bf8880613a ("rhel: Add support DPDK port creation via network scripts")
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Aaron Conole <aconole@redhat.com>
7 years agorhel: Add missing unpackaged file 'ovs-fields.7.gz' in the %files list
Numan Siddique [Fri, 27 Jan 2017 13:06:51 +0000 (18:36 +0530)]
rhel: Add missing unpackaged file 'ovs-fields.7.gz' in the %files list

Fixes: 96fee5e0a2a0 ("ovs-fields: New manpage to document Open vSwitch and OpenFlow fields")
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoovn-trace: Possible null dereference
Alin Serdean [Mon, 30 Jan 2017 07:04:18 +0000 (07:04 +0000)]
ovn-trace: Possible null dereference

Found by inspection.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agowindows: wmi add include
Alin Serdean [Mon, 30 Jan 2017 07:42:31 +0000 (07:42 +0000)]
windows: wmi add include

Add 'util.h' to includes otherwise the result of the function
'ovs_format_message' will be unknown and be converted to int,
triggering an abort of vswitchd.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/123
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovs-router: introduce pkt-mark.
Pravin B Shelar [Wed, 28 Dec 2016 19:41:25 +0000 (11:41 -0800)]
ovs-router: introduce pkt-mark.

OVS router is basically partial copy of linux kernel FIB.
kernel routing table uses skb-mark along with usual routing
parameters. Following patch brings in support for skb-mark
to ovs-router so that we can lookup route for given skb-mark.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agorouting-table: parse skb-mark from RTNETLINK msg
Pravin B Shelar [Wed, 28 Dec 2016 19:41:22 +0000 (11:41 -0800)]
routing-table: parse skb-mark from RTNETLINK msg

Keep track of skb-mark of given RTNL routing notification.
This will be used by next commit.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agotunnel: Add support to configure ptk_mark
Pravin B Shelar [Tue, 17 Jan 2017 18:16:09 +0000 (10:16 -0800)]
tunnel: Add support to configure ptk_mark

Today packet mark action is broken for Tunnel ports with
tunnel monitoring. User can write a flow to set pkt-mark for
any tunnel traffic, but there is no way to set the packet
mark for corresponding BFD traffic.

Following patch introduces new option in OVSDB tunnel
configuration so that user can set skb-mark for given
tunnel endpoint. OVS would set the mark according to the
skb-mark option for all tunnel traffic including packets
generated by vSwitchd like tunnel monitoring BFD packet.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agotests: rstp close input file
Alin Serdean [Fri, 27 Jan 2017 07:16:28 +0000 (07:16 +0000)]
tests: rstp close input file

Close the 'input_file' after data is read.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agotests dpdk: ring_client, client_id is unsigned
Alin Serdean [Fri, 27 Jan 2017 07:15:42 +0000 (07:15 +0000)]
tests dpdk: ring_client, client_id is unsigned

'client_id' is of type unsigned int. Change the printf specifier to match it.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agopython windows: Allow clients to read from server before disconnect.
Alin Serdean [Thu, 26 Jan 2017 19:44:03 +0000 (19:44 +0000)]
python windows: Allow clients to read from server before disconnect.

Wait for clients to read from the pipe before disconnecting the server.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agowindows: Allow clients to read from server before disconnect
Alin Serdean [Thu, 26 Jan 2017 19:12:20 +0000 (19:12 +0000)]
windows: Allow clients to read from server before disconnect

Wait for clients to read from the pipe before disconnecting the server.

Found while testing.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>