]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
7 years agodoc: Populate 'topics' section
Stephen Finucane [Thu, 8 Dec 2016 12:55:26 +0000 (12:55 +0000)]
doc: Populate 'topics' section

There are many docs that don't need to kept at the top level, along
with many more hidden in random folders. Move them all.

This also allows us to add the '-W' flag to Sphinx, ensuring unindexed
docs result in build failures.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Further populate the 'howto' section
Stephen Finucane [Thu, 8 Dec 2016 12:55:25 +0000 (12:55 +0000)]
doc: Further populate the 'howto' section

There are a couple of references to these for various build systems.
The website is going to be our "one true resource" for all docs, so
simply remove these references.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Populate 'install', 'howto' sections
Stephen Finucane [Thu, 8 Dec 2016 12:55:24 +0000 (12:55 +0000)]
doc: Populate 'install', 'howto' sections

This is a dumb move of all 'INSTALL*' docs, with very little
refactoring (mostly updating links and making the titles a little more
consistent. Additional refactoring will be done in subsequent changes.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Populate 'internals' section
Stephen Finucane [Thu, 8 Dec 2016 12:55:23 +0000 (12:55 +0000)]
doc: Populate 'internals' section

This is mostly docs moved from the top-level directory and content
scraped from the Open vSwitch website source [1].

[1] https://github.com/openvswitch/openvswitch.github.io/

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Populate 'ref' section
Stephen Finucane [Thu, 8 Dec 2016 12:55:22 +0000 (12:55 +0000)]
doc: Populate 'ref' section

This is a simple table with links to the manpages published on
openvswitch.org. Something fancier can be done in the future.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Create directory structure
Stephen Finucane [Thu, 8 Dec 2016 12:55:21 +0000 (12:55 +0000)]
doc: Create directory structure

Create a series of sections, all of which are currently empty, using
the general design established by Jacob Kaplan-Moss and the Django
project [1]. Five sections are provided:

- intro
- tutorials
- topics
- howto
- ref
- faq
- internals

The purpose of each section is described in the documents themselves.

[1] https://jacobian.org/writing/great-documentation/

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoAdd initial sphinx configuration
Stephen Finucane [Thu, 8 Dec 2016 12:55:20 +0000 (12:55 +0000)]
Add initial sphinx configuration

This is essentially the output of 'sphinx-quickstart' but with the
following changes:

- Parts of the generated Makefile are merged into the existing
  Documentation/automake.mk Makefile
- A license is added to the index.rst file
- The OVS logo is added
- A 'contents' page is added, so we don't need to include a TOC on the
  home page
- The theme is switched to 'bizstyle', which makes better use of
  horizontal real estate than the default 'alabaster' theme

Copyright is assigned to "The Open vSwitch Development Community".

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-sbctl: Fix a few minor typesetting errors.
Ben Pfaff [Fri, 9 Dec 2016 18:28:04 +0000 (10:28 -0800)]
ovn-sbctl: Fix a few minor typesetting errors.

In manpages, \- is used primarily for literal "-" in literal text, that is,
it should usually be used for bold (literal) text.  (It's also used for
minus signs in mathematics.)  It should not generally be used for hyphens
in English text, as it was used here in italic (metasyntactic variable)
text.  This fixes the problem.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agonetdev: Set the default number of queues at removal from the database
Ilya Maximets [Thu, 8 Dec 2016 08:55:31 +0000 (11:55 +0300)]
netdev: Set the default number of queues at removal from the database

Expected behavior for attribute removal from the database is
resetting it to default value. Currently this doesn't work for
n_rxq/n_txq options of pmd netdevs (last requested value used):

# ovs-vsctl set interface dpdk0 options:n_rxq=4
# ovs-vsctl remove interface dpdk0 options n_rxq
# ovs-appctl dpif/show | grep dpdk0
  <...>
  dpdk0 1/1: (dpdk: configured_rx_queues=4, <...> \
                    requested_rx_queues=4,  <...>)

Fix that by using NR_QUEUE or 1 as a default value for 'smap_get_int'.

Fixes: a14b8947fd13 ("dpif-netdev: Allow different numbers of
                      rx queues for different ports.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Tested-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodatapath: Fix compile time assertion.
Jarno Rajahalme [Sat, 10 Dec 2016 01:52:48 +0000 (17:52 -0800)]
datapath: Fix compile time assertion.

compiletime_assert() cannot be used in file scope, so use preprocessor
directives instead.

Reported-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: Allow compile against current net-next.
Jarno Rajahalme [Sat, 10 Dec 2016 01:22:42 +0000 (17:22 -0800)]
datapath: Allow compile against current net-next.

This patch allows openvswitch kernel module in the OVS tree to be
compiled against the current net-next Linux kernel.  The changes are
due to these upstream commits:

56989f6d856 ("genetlink: mark families as __ro_after_init")
489111e5c25 ("genetlink: statically initialize families")
a07ea4d9941 ("genetlink: no longer support using static family IDs")

struct genl_family initialization is changed be completely static and
to include the new (in Linux 4.6) __ro_after_init attribute.  Compat
code defines it as an empty macro if not defined already.

GENL_ID_GENERATE is no longer defined, but since it was defined as 0,
it is safe to drop it from all initializers also on older Linux
versions.  A compiletime_assert is added to make sure this is true
whenever GENL_ID_GENERATE is defined.

Tested with current Linux net-next (4.9) and 3.16.

It should be noted that there are still a number of fixes and new
features in upstream net-next that are yet to be backported.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoofproto-dpif-ipfix: Fix assertion failure for bad configuration.
Ben Pfaff [Fri, 9 Dec 2016 23:09:42 +0000 (15:09 -0800)]
ofproto-dpif-ipfix: Fix assertion failure for bad configuration.

The assertions in dpif_ipfix_set_options() made some bad assumptions about
flow exporters.  The code that added and removed exporters would add a flow
exporter even if it had an invalid configuration ("broken"), but the
assertions checked that broken flow exporters were not added.  Thus, the
when a flow exporter was broken, ovs-vswitchd would crash due to an
assertion failure.

Here is an example vsctl command that, run in the sandbox, would crash
ovs-vswitchd:

    ovs-vsctl \
        -- add-br br0 \
        -- --id=@br0 get bridge br0 \
        -- --id=@ipfix create ipfix target='["xyzzy"]' \
        -- create flow_sample_collector_set id=1 bridge=@br0 ipfix=@ipfix

The minimal fix would be to remove the assertions, but this would leave
broken flow exporters in place.  This commit goes a little farther and
actually removes broken flow exporters.

This fix pulls code out of an "if" statement to a higher level, so it is a
smaller fix when viewed igoring space changes.

This bug dates back to the introduction of IPFIX in 2013.

VMware-BZ: #1779123
CC: Romain Lenglet <romain.lenglet@berabera.info>
Fixes: 29089a540cfa ("Implement IPFIX export")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agorpms: Remove more OVN files form openvswitch rpm builds
Andy Zhou [Fri, 9 Dec 2016 01:26:10 +0000 (17:26 -0800)]
rpms: Remove more OVN files form openvswitch rpm builds

OVN is packaged with openvswitch-fedora.spec.in, but not with
openvswitch.spec.in. Remove OVN files from openvswitch.spec.in
builds to make rpm build happy.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agocsum: Fix csum_continue() on big endian with an odd number of bytes.
Daniele Di Proietto [Thu, 8 Dec 2016 19:35:30 +0000 (11:35 -0800)]
csum: Fix csum_continue() on big endian with an odd number of bytes.

Even though it reads 16 bits at a time, csum_continue() is almost
neutral to endianness (see RFC 1071 1.2 (B), "Byte Order Independence").

Consider a buffer like the following:

00000000: XX YY XX YY XX YY XX YY ZZ

Each couple of bytes is interpreted on little endian as:

*data = 0xYYXX

while on big endian

*data = 0xXXYY

The last byte "ZZ" should be treated as the two bytes "ZZ 00"
little endian:

*data = 0x00ZZ

big endian:

*data = 0xZZ00

which means that the last byte (for odd buffers) should be left shifted
by 8 bits on big endian platforms.

This fixes a couple of connection tracking tests in userspace for big
endian platforms.

I guess RFC1071 4.1 (implementation example of the checksum in C), would
manifest the same problem on big endian.

Reported-at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840770
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agoovs-vswitchd: Avoid segfault for "netdev" datapath.
nickcooper-zhangtonghao [Wed, 7 Dec 2016 18:04:04 +0000 (10:04 -0800)]
ovs-vswitchd: Avoid segfault for "netdev" datapath.

When the datapath, whose type is "netdev", processes packets
in userspce action, it may cause a segmentation fault. In the
dp_execute_userspace_action(), we pass the "wc" argument to
dp_netdev_upcall() using NULL. In the dp_netdev_upcall() call tree,
the "wc" will be used. For example, dp_netdev_upcall() uses the
&wc->masks for debugging, and flow_wildcards_init_for_packet()
uses the  "wc" if we disable megaflow, which is described in
more detail below.

Segmentation fault in flow_wildcards_init_for_packet:

    #0  0x0000000000468fe8 flow_wildcards_init_for_packet lib/flow.c:1275
    #1  0x0000000000436c0b upcall_cb ofproto/ofproto-dpif-upcall.c:1231
    #2  0x000000000045bd96 dp_netdev_upcall lib/dpif-netdev.c:3857
    #3  0x0000000000461bf3 dp_execute_userspace_action lib/dpif-netdev.c:4388
    #4  dp_execute_cb lib/dpif-netdev.c:4521
    #5  0x0000000000486ae2 odp_execute_actions lib/odp-execute.c:538
    #6  0x00000000004607f9 dp_netdev_execute_actions lib/dpif-netdev.c:4627
    #7  packet_batch_per_flow_execute lib/dpif-netdev.c:3927
    #8  dp_netdev_input__ lib/dpif-netdev.c:4229
    #9  0x0000000000460ba8 dp_netdev_input lib/dpif-netdev.c:4238
    #10 dp_netdev_process_rxq_port lib/dpif-netdev.c:2873
    #11 0x000000000046126e dpif_netdev_run lib/dpif-netdev.c:3000
    #12 0x000000000042baf5 type_run ofproto/ofproto-dpif.c:504
    #13 0x00000000004192bf ofproto_type_run ofproto/ofproto.c:1687
    #14 0x0000000000409965 bridge_run__ vswitchd/bridge.c:2875
    #15 0x000000000040f145 bridge_run vswitchd/bridge.c:2938
    #16 0x00000000004062e5 main vswitchd/ovs-vswitchd.c:111

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agotreewide: Fix recent flake8-check.
Joe Stringer [Thu, 8 Dec 2016 18:22:16 +0000 (10:22 -0800)]
treewide: Fix recent flake8-check.

Without this patch, I see errors like this on master:
../ofproto/ipfix-gen-entities:115:1: E305 expected 2 blank lines after
class or function definition, found 1

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoIntegrationGuide: Fix word wrapping.
Guoshuai Li [Wed, 7 Dec 2016 06:07:05 +0000 (14:07 +0800)]
IntegrationGuide: Fix word wrapping.

Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoFix ovndb_servers master and VirtualIP are not on the same node.
Guoshuai Li [Sat, 3 Dec 2016 07:38:12 +0000 (15:38 +0800)]
Fix ovndb_servers master and VirtualIP are not on the same node.

PCS man page says role=Stopped/Started/Master/Slave.
A role can be master or slave (if no role is specified,
it defaults to 'started').

Command line

"$pcs constraint colocation add ovndb_servers-master with
master VirtualIP"

means that the Started role node of ovsdb follows the master node of
VirtualIP.  But we actually want the ovsdb master node to follow the
VirtualIP's Started node.

Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoovn: Fix pacemaker Master node does not monitor the OVSDB status
Guoshuai Li [Tue, 6 Dec 2016 12:35:08 +0000 (20:35 +0800)]
ovn: Fix pacemaker Master node does not monitor the OVSDB status

OVSDB resource is multi-state resource, pacemaker monitor actions are
insufficient to monitor a multi-state resource.  The usual one will
cover the slave role, so it is need to configure monitoring for the
master.

http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html/ \
Pacemaker_Explained/_monitoring_multi_state_resources.html

Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agodpctl: Fix usage for most dpctl commands.
Ben Pfaff [Tue, 6 Dec 2016 19:40:29 +0000 (11:40 -0800)]
dpctl: Fix usage for most dpctl commands.

The usage should not repeat the command name, but most of the dpctl
commands' usage did repeat it.  This fixes the problem.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Aaron Conole <aconole@redhat.com>
7 years agoovs-appctl: Add usage content to "upcall/set-flow-limit" command.
nickcooper-zhangtonghao [Tue, 6 Dec 2016 09:01:22 +0000 (01:01 -0800)]
ovs-appctl: Add usage content to "upcall/set-flow-limit" command.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovs-appctl: Add usage content to "dpctl/*" command.
nickcooper-zhangtonghao [Tue, 6 Dec 2016 09:01:21 +0000 (01:01 -0800)]
ovs-appctl: Add usage content to "dpctl/*" command.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-trace: Add output format options to usage message.
Ben Pfaff [Sun, 23 Oct 2016 18:25:02 +0000 (11:25 -0700)]
ovn-trace: Add output format options to usage message.

Also adjust the indentation of the option explanations so that they line up
better.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agotests: Add tracing to "ovn -- 2 HVs, 4 lports/HV, localnet ports" test.
Ben Pfaff [Sun, 23 Oct 2016 17:50:36 +0000 (10:50 -0700)]
tests: Add tracing to "ovn -- 2 HVs, 4 lports/HV, localnet ports" test.

Adding ovn-trace calls makes failures easier to understand and diagnose.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agotests: Fix order confusion in "ovn -- 2 HVs, 4 lports/HV, localnet ports".
Ben Pfaff [Sun, 23 Oct 2016 17:50:35 +0000 (10:50 -0700)]
tests: Fix order confusion in "ovn -- 2 HVs, 4 lports/HV, localnet ports".

The order of src and dst was swapped both in assignment and reference,
which meant that the result worked OK but was really confusing to try to
extend or modify.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agonetdev-dpdk: Don't use dev->vhost_id without mutex.
Ilya Maximets [Tue, 6 Dec 2016 06:45:07 +0000 (09:45 +0300)]
netdev-dpdk: Don't use dev->vhost_id without mutex.

The copy should be used here.
Additionally, 'strlen' changed to the faster check.

Fixes: 821b86649a90 ("netdev-dpdk: Don't try to unregister empty vhost_id.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agonetdev-bsd: Fix compiling error in netbsd.
Hui Kang [Tue, 6 Dec 2016 05:04:00 +0000 (00:04 -0500)]
netdev-bsd: Fix compiling error in netbsd.

In some netbsd version, RTF_LLINFO is undefined.

Signed-off-by: Hui Kang <hkang.sunysb@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotests/bundle: Use active_backup algorithm for up/down test.
Ilya Maximets [Tue, 6 Dec 2016 11:48:43 +0000 (14:48 +0300)]
tests/bundle: Use active_backup algorithm for up/down test.

HRW algorithm uses hash function which is dependent from the build
environment. This leads to constant fails of the testsuite
with CFLAGS='-march=native' if CPU supports hashing instructions:

[-------------------------------------------------------------------]
 ./bundle.at:233: ovs-appctl ofproto/trace br0 \
     'in_port=LOCAL,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06'
 stdout:
 Bridge: br0
 Flow: in_port=LOCAL,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,\
       dl_dst=50:54:00:00:00:06,dl_type=0x0000

 Rule: table=0 cookie=0
 OpenFlow actions=bundle(eth_src,50,hrw,ofport,slaves:1,2)

 Final flow: unchanged
 Megaflow: recirc_id=0,in_port=LOCAL,dl_src=50:54:00:00:00:05, \
           dl_type=0x0000
 Datapath actions: 2
 ./bundle.at:234: tail -1 stdout
 --- -
 +++ /testsuite.dir/at-groups/85/stdout
 @@ -1,2 +1,2 @@
 -Datapath actions: 1
 +Datapath actions: 2

[-------------------------------------------------------------------]

Using of 'active_backup' algorithm will help to avoid such issues.

CC: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Fixes: 63460a30c53e ("tests/bundle: test bundle action with ports up and down")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: Fix the duplicate code: start) ovsdb_server_start; ;
Guoshuai Li [Tue, 6 Dec 2016 11:36:09 +0000 (19:36 +0800)]
ovn: Fix the duplicate code: start) ovsdb_server_start; ;

In 341 line already have this code

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotunnel: set udp dst-port in tunnel metadata
Pravin B Shelar [Tue, 6 Dec 2016 02:22:11 +0000 (18:22 -0800)]
tunnel: set udp dst-port in tunnel metadata

VxLan device expect valid tp-dst in tunnel metadata.
Following patch sets consistent tp-dst with respect to
the egress tunnel port.

Reported-by: Gerhard Stenzel <gstenzel@linux.vnet.ibm.com>
Tested-by: Gerhard Stenzel <gstenzel@linux.vnet.ibm.com>
Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agoovn-controller(8): ovn-remote must be an ovsdb remote.
Russell Bryant [Mon, 5 Dec 2016 17:04:32 +0000 (12:04 -0500)]
ovn-controller(8): ovn-remote must be an ovsdb remote.

Document that the value of the ovn-remote configuration
option must be in the form of an ovsdb remote as previously documented
in this man page. This came up on IRC where someone trying OVN
put a hostname here and observed that it did not work.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto: Honor OFPFF_RESET_COUNTS flag in flow modify message.
Jarno Rajahalme [Thu, 1 Dec 2016 21:10:53 +0000 (13:10 -0800)]
ofproto: Honor OFPFF_RESET_COUNTS flag in flow modify message.

While a flow modify must keep the original flow's flags, it must reset
counts if (and only if) the reset_counts flag is present in the flow
mod message.

Behavior prior to this patch is broken in a few ways:

- OpenFlow 1.0 and 1.1 mod-flows did reset the counts, if the flow had
  reset_counts flag set.  Only add-flow should reset counts.
- With OpenFlow 1.2 and later, if the old flow had the reset_counts
  flag set, the counts would be reset by mod-flows, even if the
  flow-mod message does not have the reset_counts flag set.
- With OpenFlow 1.2 and later, mod-flows with a reset_count did not
  reset the counts, if the old flow did not have the reset_counts flag
  set.

Even though the prevailing interpretation seems to be that the
reset_counts flag in the flow-mod message should be stored as part of
the flow state (and reported back in flow dumps with OpenFlow >= 1.3),
we should always just look at the reset_counts flag in the current
flow-mod and ignore the reset_counts flag stored in the flow when
processing a flow mod.

For OpenFlow 1.0 and 1.1 we already implicitly add the reset_counts
flag for add-flow messages (only) to maintain the expected behavior.

This patch adds a comprehensive test case to prevent future regressions.

Suggested-by: Tony van der Peet <tony.vanderpeet@alliedtelesis.co.nz>
Fixes: 748eb2f5b1 ("ofproto-dpif: Always forward 'used' from the old_rule.")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agompls: Fix MPLS restoration after patch port and group bucket.
Jarno Rajahalme [Thu, 1 Dec 2016 22:05:24 +0000 (14:05 -0800)]
mpls: Fix MPLS restoration after patch port and group bucket.

This patch fixes problems with MPLS handling related to patch ports
and group buckets.

If a group bucket or a peer bridge across a patch port pushes MPLS
headers to a non-MPLS packet and outputs, the flow translation after
returning from the group bucket or patch port would undo the packet
transformations so that the processing could continue with the packet
as it was before entering the patch port.  There were two problems
with this:

1. As part of the first MPLS push on a non-MPLS packet, the flow
translation would first clear the L3/4 headers of the 'flow' to mark
those fields invalid.  Later, when committing 'flow' changes to
datapath actions before output, the necessary datapath MPLS actions
are created and the corresponding changes updated to the 'base flow'.
This was done using the same flow_push_mpls() function that clears
the L2/3 headers, so also the 'base flow' L2/3 headers were cleared.

Then, when translation returns from a patch port or group bucket, the
original 'flow' is restored, now showing no sign of the MPLS labels.
Since the 'base flow' now has the MPLS labels, following translations
know to issue MPLS POP actions before any output actions.  However, as
part of checking for changes to IP headers we test that the IP
protocol type was not changed.  But now the 'base flow's 'nw_proto'
field is zero and an assert fail crashes OVS.

This is solved by not clearing the L3/4 fields of the 'base
flow'. This allows the processing after the patch port to continue
with L3/4 fields as if no MPLS was done, after first issuing the
necessary MPLS POP actions.

2. IP header updates were done before the MPLS POP actions were
issued. This caused incorrect packet output after, e.g., group action
or patch port.  For example, with actions:

group 1234: all bucket=push_mpls,output:LOCAL

ip actions=group:1234,dec_ttl,output:LOCAL,output:LOCAL

the dec_ttl would only be executed before the last output to LOCAL,
since at the time of committing IP changes after the group action the
packet was still an MPLS packet.

This is solved by checking the dl_type of both 'flow' and 'base flow'
and issuing MPLS actions if they can transform the packet from an MPLS
packet to a non-MPLS packet.  For an IP packet the change in ttl can
then be correctly committed before the last two output actions.

Two test cases are added to prevent future regressions.

Reported-by: Thomas Morin <thomas.morin@orange.com>
Suggested-by: Takashi YAMAMOTO <yamamoto@ovn.org>
Fixes: 8bfd0fdac ("Enhance userspace support for MPLS, for up to 3 labels.")
Fixes: 1b035ef20 ("mpls: Allow l3 and l4 actions to prior to a push_mpls action")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: YAMAMOTO Takashi <yamamoto@ovn.org>
7 years agoovs-numa: Allow leading 0x on pmd-cpu-mask.
billyom [Tue, 29 Nov 2016 10:24:53 +0000 (10:24 +0000)]
ovs-numa: Allow leading 0x on pmd-cpu-mask.

pmd-cpu-mask is interpreted as a hex bit mask. So it should be written
with a leading 0x to indicate this. But if this is done, while the value
is interpreted correctly and the PMDs pinned as expected, a confusing
warning message is also issued.

This patch allows but does not require a leading 0x or 0X to be used
without a warning. Existing functionality is not affected. Relevant DPDK
docs also updated.

Signed-off-by: Billy O'Mahony <billy.o.mahony@intel.com>
Tested-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agopython: Add double newline after fuction or class (E305).
Daniele Di Proietto [Thu, 1 Dec 2016 20:58:25 +0000 (12:58 -0800)]
python: Add double newline after fuction or class (E305).

pycodestyle >= 2.1.0 reports E305 otherwise, and the flake8-check step
fails.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agonetdev-dpdk: Don't try to unregister empty vhost_id.
Ilya Maximets [Tue, 29 Nov 2016 12:20:56 +0000 (15:20 +0300)]
netdev-dpdk: Don't try to unregister empty vhost_id.

If 'vhost-server-path' not provided for vhostuserclient port,
'netdev_dpdk_vhost_destruct()' will try to unregister an empty string.
This leads to error message in log:

netdev_dpdk|ERR|vhost2: Unable to unregister vhost driver for socket ''.

CC: Ciara Loftus <ciara.loftus@intel.com>
Fixes: 2d24d165d6a5 ("netdev-dpdk: Add new 'dpdkvhostuserclient' port type")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodatapath-windows: Fix typos in function summaries
Sairam Venugopal [Fri, 2 Dec 2016 18:21:21 +0000 (10:21 -0800)]
datapath-windows: Fix typos in function summaries

Fixed mismatch between function names and descriptions.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: Remove unused members from local_datapath.
Ben Pfaff [Fri, 2 Dec 2016 00:34:03 +0000 (16:34 -0800)]
ovn-controller: Remove unused members from local_datapath.

Nothing used these, except to initialize and free them.  'logical_port'
wasn't meaningful in any case, it was just the name of the first logical
port encountered from a particular logical datapath when traversing the
database's Port_Binding table, which isn't in a meaningful order.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoovn-controller: 'lports' and 'mcgroups' need not be static.
Ben Pfaff [Fri, 2 Dec 2016 00:57:29 +0000 (16:57 -0800)]
ovn-controller: 'lports' and 'mcgroups' need not be static.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Simon Horman <simon.horman@netronome.com>
7 years agoovsdb-tool: Document database numbering scheme.
Ben Pfaff [Thu, 1 Dec 2016 19:06:54 +0000 (11:06 -0800)]
ovsdb-tool: Document database numbering scheme.

Prompted by an IRC discussion.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agoCONTRIBUTING.rst: Update patch summary and description style guidelines.
Ben Pfaff [Thu, 1 Dec 2016 23:59:29 +0000 (15:59 -0800)]
CONTRIBUTING.rst: Update patch summary and description style guidelines.

Suggested-by: Joe Stringer <joe@ovn.org>
Suggested-at: https://mail.openvswitch.org/pipermail/ovs-dev/2016-November/325513.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agodpdk: update download url
Thomas Monjalon [Sun, 27 Nov 2016 22:22:20 +0000 (23:22 +0100)]
dpdk: update download url

The documentation and the travis script were getting the DPDK sources
from the DPDK cgit service at dpdk.org/browse/dpdk.
A fastest alternative is to use the CDN fast.dpdk.org.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
7 years agophysical: Remove obsolete comments.
Ben Pfaff [Thu, 1 Dec 2016 07:02:32 +0000 (23:02 -0800)]
physical: Remove obsolete comments.

These comments were added above code that removed flows from the flow
table.  Now that that code was deleted, the comments no longer make sense.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agoovn-controller: Remove obsolete concept of "stale" patched datapaths.
Ben Pfaff [Thu, 1 Dec 2016 06:50:33 +0000 (22:50 -0800)]
ovn-controller: Remove obsolete concept of "stale" patched datapaths.

When ovn-controller implemented incremental processing, the set of
patched datapaths was revised on each trip through the main loop, so it
was necessary to notice datapaths that shouldn't exist anymore and remove
them.

With incremental processing gone, the set of patched datapaths is
built and torn down on every trip through the main loop, so there will
never be any stale datapaths.  This commit retires the concept.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agobuild: fix rpm-fedora target breakage
Lance Richardson [Thu, 1 Dec 2016 03:57:25 +0000 (22:57 -0500)]
build: fix rpm-fedora target breakage

Since commit 3deca69b08f2 ("doc: Convert AUTHORS to rST"), the rpm-fedora
target fails to build with:

  *** No rule to make target `AUTHORS.rst', needed by `debian/copyright'.

Fix by adding AUTHORS.rst to the docs list to ensure that it is
included in the dist archive.

Fixes: 3deca69b08f2 ("doc: Convert AUTHORS to rST")
Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Convert AUTHORS to rST
Stephen Finucane [Tue, 22 Nov 2016 18:18:48 +0000 (18:18 +0000)]
doc: Convert AUTHORS to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Don't format emails as code
Stephen Finucane [Tue, 22 Nov 2016 18:18:47 +0000 (18:18 +0000)]
doc: Don't format emails as code

The sample emails provided in committer-grant-revocation are hard to
read when formatted as code. Simply indent them instead.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agotrivial: Don't mix tabs and spaces in ovs-sim
Stephen Finucane [Tue, 22 Nov 2016 18:18:46 +0000 (18:18 +0000)]
trivial: Don't mix tabs and spaces in ovs-sim

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodatapath: backport: openvswitch: Fix skb leak in IPv6 reassembly.
Daniele Di Proietto [Wed, 30 Nov 2016 18:24:43 +0000 (10:24 -0800)]
datapath: backport: openvswitch: Fix skb leak in IPv6 reassembly.

    commit f92a80a9972175a6a1d36c6c44be47fb0efd020d
    Author: Daniele Di Proietto <diproiettod@ovn.org>
    Date:   Mon Nov 28 15:43:53 2016 -0800

    openvswitch: Fix skb leak in IPv6 reassembly.

    If nf_ct_frag6_gather() returns an error other than -EINPROGRESS, it
    means that we still have a reference to the skb.  We should free it
    before returning from handle_fragments, as stated in the comment above.

Fixes: daaa7d647f81 ("netfilter: ipv6: avoid nf_iterate recursion")
CC: Florian Westphal <fw@strlen.de>
CC: Pravin B Shelar <pshelar@ovn.org>
CC: Joe Stringer <joe@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
VMware-BZ: #1728498
Fixes: 2e602ea3dafa("compat: nf_defrag_ipv6: avoid nf_iterate recursion.")
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agoovsdb: Allow online compacting on Windows.
Alin Serdean [Thu, 27 Oct 2016 21:45:42 +0000 (21:45 +0000)]
ovsdb: Allow online compacting on Windows.

This patch allows online compacting to be done under Windows.

To achieve the above we need to close all file handles before trying to
rename the file, switch from rename to MoveFileEx (because rename/MoveFile
fails if the destination exists), reopen the right type of log after the
rename.

If we could not reopen the compacted database or the original database
after the close simply abort and rely on the service manager. This
can be changed in the future.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Co-authored-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
7 years agoofp-actions: Add "ingress" and "egress" options to "sample" action.
Ben Pfaff [Thu, 24 Nov 2016 07:15:19 +0000 (23:15 -0800)]
ofp-actions: Add "ingress" and "egress" options to "sample" action.

Before Open vSwitch 2.5.90, IPFIX reports from Open vSwitch didn't include
whether the packet was ingressing or egressing the switch.  Starting in
OVS 2.5.90, this information was available but only accurate if the action
included a port number that indicated a tunnel.  Conflating these two does
not always make sense (not every packet involves a tunnel!), so this patch
makes it possible for the sample action to simply say whether it's for
ingress or egress.

This is difficult to test, since the "tests" directory of OVS does not have
a proper IPFIX listener.  This passes those tests, plus a couple that just
verify that the actions are properly parsed and formatted.  Benli did test
it end-to-end in a VMware use case.

Requested-by: Benli Ye <daniely@vmware.com>
Tested-by: Benli Ye <daniely@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Simon Horman <simon.horman@netronome.com>
7 years agoovn-northd: Force SNAT for multiple gateway routers.
Gurucharan Shetty [Fri, 4 Nov 2016 11:49:18 +0000 (04:49 -0700)]
ovn-northd: Force SNAT for multiple gateway routers.

When multiple gateway routers exist, a packet can
enter any gateway router. Once the packet reaches its
destination, its reverse direction should be via the
same gateway router.  This is achieved by doing a SNAT
of the packet in the inward direction (towards logical space)
with a IP address of the gateway router such that packet travels back
to the same gateway router.

To do the above, we introduce two new options in the logical router.

options:dnat_force_snat_ip=$IP will force SNAT any packet to $IP if
it has been previously DNATted.

options:lb_force_snat_ip=$IP will force SNAT any packet to $IP if
it has been previously load-balanced.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agodatapath-windows: conntrack leaks
Alin Serdean [Mon, 28 Nov 2016 14:26:31 +0000 (14:26 +0000)]
datapath-windows: conntrack leaks

All conntrack entries should be removed before unloading/disabling the
driver.

This patch forces a flush of all the entries during the cleanup routine.

The bug was found using driver verifier.

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 agodatapath-windows: null comparison for icmp and tcp header
Alin Serdean [Mon, 28 Nov 2016 14:11:57 +0000 (14:11 +0000)]
datapath-windows: null comparison for icmp and tcp header

This patch checks if the TCP or ICMP header exists before trying to use
them.

The issue was found using the driver under low resources.

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 agodatapath-windows: fix return value in conntrack
Alin Serdean [Mon, 28 Nov 2016 14:07:09 +0000 (14:07 +0000)]
datapath-windows: fix return value in conntrack

'status' is of type 'NTSTATUS' and NlFillOvsMsgForNfGenMsg is of type bool.

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 agodatapath-windows: pop buffer from packet / pop_vlan bug
Alin Serdean [Thu, 27 Oct 2016 23:48:54 +0000 (23:48 +0000)]
datapath-windows: pop buffer from packet / pop_vlan bug

Switch too memmove(RtlMoveMemory) instead of copy and predefined allocated
buffer.

Currently if we receive a pop_vlan action, and the vlan tag is inside the
Ethernet frame(not in the net buffer list information) we change the frame
without checking if the it was a vlan tagged or not.

This patch checks if it a vlan tagged frame and makes the action a
non-operation.

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 agoovn-trace: Fix implementation of get_arp and get_nd logical actions.
Ben Pfaff [Sun, 23 Oct 2016 17:49:27 +0000 (10:49 -0700)]
ovn-trace: Fix implementation of get_arp and get_nd logical actions.

These actions looked up the MAC binding but failed to update eth.dst with
the result.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Aaron Conole <aconole@redhat.com>
7 years agoovn-trace: Fix daemon exit for bad datapaths or flows.
Ben Pfaff [Sun, 23 Oct 2016 17:49:26 +0000 (10:49 -0700)]
ovn-trace: Fix daemon exit for bad datapaths or flows.

When ovn-trace is running in daemon mode (with --detach), a trace command
received via unixctl (e.g. "ovs-appctl -t ovn-trace trace ...") should not
cause ovn-trace to exit, but it did.  This fixes the problem.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Aaron Conole <aconole@redhat.com>
7 years agocheckpatch: Add file-parsing mode
Aaron Conole [Fri, 21 Oct 2016 18:49:09 +0000 (14:49 -0400)]
checkpatch: Add file-parsing mode

This adds a new argument and feature, 'check-file', which will allow
checkpatch to run against files instead of only against patches.

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agocheckpatch: fix the if and whitespace checks
Aaron Conole [Fri, 21 Oct 2016 18:49:08 +0000 (14:49 -0400)]
checkpatch: fix the if and whitespace checks

The regex for the if/for/while bracket tests fails to distinguish
non-space text.  This means text such as do_something_if() would match
incorrectly.

Additionally, the ends-with-bracket test doesn't allow for the common
coding paradigm:

    if (condition) { /* Text about conditional. */
    }

So fix that as well.

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agocheckpatch: Fix signoff error
Aaron Conole [Fri, 21 Oct 2016 18:49:07 +0000 (14:49 -0400)]
checkpatch: Fix signoff error

When no 'Signed-off-by' tags are found, the output will look like:

    E: No signatures found.
    E: Too many signoffs; are you missing Co-authored-by lines?
    Warnings: 0, Errors: 2

However, there should really only be one error reported in this case.

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agocheckpatch: Print file line numbers
Aaron Conole [Fri, 21 Oct 2016 18:49:06 +0000 (14:49 -0400)]
checkpatch: Print file line numbers

The line numbers being printed were the line numbers for the patchfile.
This is sometimes okay to fix simple things (trailing or leading
whitespace, missing signoffs, etc).  But more complicated fixes, or
those fixes which require a bit more care, aren't helped by this.  So,
we use the implied file line number.

This can be useful with future work to 'mock' apply and build a real
contextual scanner for checking multi-line changes.

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agocheckpatch: convert some of the warnings
Aaron Conole [Fri, 21 Oct 2016 18:49:05 +0000 (14:49 -0400)]
checkpatch: convert some of the warnings

These coding issues are not just things that shouldn't be done.  They are
styles which should never be submitted.

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agocheckpatch: Print the line in question distinctly
Aaron Conole [Fri, 21 Oct 2016 18:49:04 +0000 (14:49 -0400)]
checkpatch: Print the line in question distinctly

This makes it easier to distinguish between the line, and
the warning/error message.

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agocheckpatch: Announce the file where errors occur
Aaron Conole [Fri, 21 Oct 2016 18:49:03 +0000 (14:49 -0400)]
checkpatch: Announce the file where errors occur

This makes finding the warning and error marks much easier.

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agonetdev-dpdk: Assign value '0' to unsupported netdev features
Binbin Xu [Thu, 13 Oct 2016 15:18:20 +0000 (23:18 +0800)]
netdev-dpdk: Assign value '0' to unsupported netdev features

When OVS&DPDK is used, DPDK doesn't support features 'advertised',
'supported' and 'peer'. If a physical port added to bridge, features
descirbed above can't be assigned, and the values are random.

Signed-off-by: Binbin Xu <xu.binbin1@zte.com.cn>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: Test arp requests received from vtep ports.
Darrell Ball [Fri, 4 Nov 2016 17:06:18 +0000 (10:06 -0700)]
ovn: Test arp requests received from vtep ports.

Add a test that verifies that arp requests received from
vtep ports are not responded to by logical switch arp
responders.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: Add additional comments regarding arp responders.
Darrell Ball [Fri, 4 Nov 2016 17:06:17 +0000 (10:06 -0700)]
ovn: Add additional comments regarding arp responders.

There has been enough confusion regarding logical switch datapath
arp responders in ovn to warrant some additional comments;
hence add a general description regarding why they exist and
document the special cases.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ramu Ramamurthy <ramu.ramamurthy@us.ibm.com>
Co-authored-by: Ramu Ramamurthy <ramu.ramamurthy@us.ibm.com>
Acked-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodist-docs: typo in IntegrationGuide.rst
Lance Richardson [Mon, 28 Nov 2016 20:50:04 +0000 (15:50 -0500)]
dist-docs: typo in IntegrationGuide.rst

Unbalanced angle bracket was causing 'Unknown target name: "ocf
<http://www.linux-ha.org/wiki/ocf_resource_agents".' error message
when building dist-docs.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agorhel: Add EnvironmentFile for ovn services.
Russell Bryant [Wed, 23 Nov 2016 20:01:24 +0000 (15:01 -0500)]
rhel: Add EnvironmentFile for ovn services.

A previous commit documented how you do this using systemd
native interfaces for customizing services.  However, it seems
that some people still would rather see environment variables
specified through an old-style sysconfig file.  It seems harmless
enough to provide, so this patch adds it.

The "-" prefix to the filename means that systemd will ignore this
setting if the file does not exist and will not report any error.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Simon Horman <simon.horman@netronome.com>
7 years agoovn: Fix arping from vtep-gw physical port.
Ramu Ramamurthy [Fri, 4 Nov 2016 17:06:16 +0000 (10:06 -0700)]
ovn: Fix arping from vtep-gw physical port.

Currently, arping from a vtep-gw physical-switch port to
a VIF IP address does not work.

When a physical-switch-port arps for an IP address
of a VIF, that arp packet comes into the VIF hypervisor via a
vxlan tunnel. That arp packet must not be responded-to by the
arp responder table because, potentially, multiple hypervisors
could independently respond and confuse L2 learning at the
arp originator.

Signed-off-by: Ramu Ramamurthy <ramu.ramamurthy@us.ibm.com>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Co-authored-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoINSTALL: Recommend starting daemons with --log-file.
Ben Pfaff [Fri, 25 Nov 2016 19:48:33 +0000 (11:48 -0800)]
INSTALL: Recommend starting daemons with --log-file.

Occasionally someone comes by and can't find the log files.  Perhaps it's
because we didn't recommend using --log-file.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
7 years agoutilities: Use FQDN for external_ids:hostname in Openvswitch table
Babu Shanmugam [Thu, 24 Nov 2016 09:36:16 +0000 (15:06 +0530)]
utilities: Use FQDN for external_ids:hostname in Openvswitch table

Openstack compute manager uses FQDN to check for the hypervisors to
which the ports are bound.

Without this fix, no instances can be launched as the hypervisor's hostname
mismatches.

Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoodp-util: Fix incorrect comment.
Ben Pfaff [Wed, 23 Nov 2016 19:46:32 +0000 (11:46 -0800)]
odp-util: Fix incorrect comment.

The user_action_cookie was once limited to 8 bytes, but that limitation
was eliminated a long time ago.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Simon Horman <simon.horman@netronome.com>
7 years agonetdev-dpdk: Add support for DPDK 16.11
Ciara Loftus [Fri, 25 Nov 2016 10:41:11 +0000 (10:41 +0000)]
netdev-dpdk: Add support for DPDK 16.11

This commit announces support for DPDK 16.11. Compatibility with DPDK
v16.07 is not broken yet thanks to only minor code changes being needed
for the upgrade.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
7 years agotests: add test for the output of ovs/route/lookup
Thadeu Lima de Souza Cascardo [Thu, 24 Nov 2016 18:38:40 +0000 (16:38 -0200)]
tests: add test for the output of ovs/route/lookup

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
7 years agoovs-router: add missing newline in lookup output
Thadeu Lima de Souza Cascardo [Thu, 24 Nov 2016 18:38:39 +0000 (16:38 -0200)]
ovs-router: add missing newline in lookup output

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
7 years agoovs-tcpdump: Do not import unused "select" module.
Ben Pfaff [Tue, 22 Nov 2016 23:32:26 +0000 (15:32 -0800)]
ovs-tcpdump: Do not import unused "select" module.

Fixes the following flake8 warning:
    utilities/ovs-tcpdump.in:21:1: F401 'select' imported but unused

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agoovs-tcpdump: Fix error handling when parsing parameter.
nickcooper-zhangtonghao [Mon, 14 Nov 2016 09:24:14 +0000 (01:24 -0800)]
ovs-tcpdump: Fix error handling when parsing parameter.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
7 years agoovs-tcpdump: destroy_mirror should really destroy the mirror.
nickcooper-zhangtonghao [Mon, 14 Nov 2016 09:24:13 +0000 (01:24 -0800)]
ovs-tcpdump: destroy_mirror should really destroy the mirror.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
7 years agoovs-tcpdump: should't halt when dumping traffic.
nickcooper-zhangtonghao [Mon, 14 Nov 2016 09:24:12 +0000 (01:24 -0800)]
ovs-tcpdump: should't halt when dumping traffic.

when sys.stdin is passed to tcpdump via pipe,
it will cause tcpdump to halt.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
7 years agoovs-tcpdump: Remove the newline from readline().
nickcooper-zhangtonghao [Mon, 14 Nov 2016 09:24:11 +0000 (01:24 -0800)]
ovs-tcpdump: Remove the newline from readline().

When using ovs-tcpdump, we always get the white line.
Remove newline from readline() and ovs-tcpdump will
format the output as tcpdump tool.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
7 years agoovs-ofctl: Fix memory leak in bundle_print_errors().
Yi-Hung Wei [Mon, 21 Nov 2016 21:42:41 +0000 (13:42 -0800)]
ovs-ofctl: Fix memory leak in bundle_print_errors().

In testcase "ofproto - bundle group mod with mod and add_or_mod command",
valgrind reports a memory leak with the following call stack.
    xmalloc (util.c:112)
    ofpbuf_resize__ (ofpbuf.c:246)
    ofpbuf_push_uninit (ofpbuf.c:436)
    ofpbuf_push (ofpbuf.c:459)
    ofperr_decode_msg (ofp-errors.c:332)
    bundle_print_errors (ovs-ofctl.c:692)
    bundle_transact.constprop.25 (ovs-ofctl.c:728)
    bundle_group_mod__ (ovs-ofctl.c:2663)
    ofctl_group_mod__ (ovs-ofctl.c:2681)
    ofctl_group_mod (ovs-ofctl.c:2736)
    ovs_cmdl_run_command__ (command-line.c:115)
    main (ovs-ofctl.c:151)

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofp-print: Fix memory leak in ofp_print_queue_get_config_reply().
Yi-Hung Wei [Mon, 21 Nov 2016 21:42:40 +0000 (13:42 -0800)]
ofp-print: Fix memory leak in ofp_print_queue_get_config_reply().

In testcase "OFPT_QUEUE_GET_CONFIG_REPLY - OF1.0", valgrind reports a memory
leak with the following call stack.
    xrealloc (util.c:123)
    ofp_print_queue_get_config_reply (ofp-print.c:1233)
    ofp_to_string__ (ofp-print.c:3458)
    ofp_to_string (ofp-print.c:3681)
    ofp_print (ofp-print.c:3713)
    ofctl_ofp_print (ovs-ofctl.c:4399)
    ovs_cmdl_run_command__ (command-line.c:115)
    main (ovs-ofctl.c:151)

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovs-ofctl: Fix memory leak in ofctl_packet_out().
Yi-Hung Wei [Mon, 21 Nov 2016 21:42:39 +0000 (13:42 -0800)]
ovs-ofctl: Fix memory leak in ofctl_packet_out().

In testcase "bfd - bfd decay", valgrind reports a memory leak with the
following call stack.
    xmalloc (util.c:112)
    vconn_stream_new (vconn-stream.c:60)
    vconn_stream_open (vconn-stream.c:85)
    vconn_open (vconn.c:248)
    open_vconn_socket (ovs-ofctl.c:517)
    open_vconn__ (ovs-ofctl.c:553)
    open_vconn (ovs-ofctl.c:587)
    open_vconn_for_flow_mod (ovs-ofctl.c:1416)
    ofctl_packet_out (ovs-ofctl.c:2148)
    ovs_cmdl_run_command__ (command-line.c:115)
    main (ovs-ofctl.c:151)

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto: Drop flows between protected ports
Ben Kelly [Sun, 20 Nov 2016 09:34:41 +0000 (20:34 +1100)]
ofproto: Drop flows between protected ports

Protected ports can not forward frames to other protected ports.
Unprotected ports can receive and forward frames to protected and other
unprotected ports.

Signed-off-by: Ben Kelly <ben@benjii.net>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
7 years agoofproto: Add protected property to bundle
Ben Kelly [Sun, 13 Nov 2016 13:30:39 +0000 (00:30 +1100)]
ofproto: Add protected property to bundle

Propagate the protected mode setting from port to xbundle, so that
ofproto* can make decisions.

Signed-off-by: Ben Kelly <ben@benjii.net>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
7 years agoovsschema: Add protected column to Port table
Ben Kelly [Sun, 13 Nov 2016 13:30:38 +0000 (00:30 +1100)]
ovsschema: Add protected column to Port table

Supports setting of protected mode true/false per port e.g.

 # ovs-vsctl set port virtX protected=1/0

Signed-off-by: Ben Kelly <ben@benjii.net>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
7 years agorhel: fix ovn-common rpm installation failure
Lance Richardson [Mon, 21 Nov 2016 22:47:13 +0000 (17:47 -0500)]
rhel: fix ovn-common rpm installation failure

The directory /usr/lib/ocf/ does not exist if the pacemaker
package has not been installed, which causes installation of the
ovn-common rpm to fail on "mkdir /usr/lib/ocf/resource.d/ovn".
Allow for the possibility that /usr/lib/ocf does not exist by
using "mkdir -p".

Fixes: a4245b7869c8 ("ovn: Add ovn db servers ocf script in fedora packager")
Signed-off-by: Lance Richardson <lrichard@redhat.com>
Acked-by: Babu Shanmugam <bschanmu@redhat.com>
Tested-by: Babu Shanmugam <bschanmu@redhat.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
7 years agorhel: support enable/disable of ovn services
Lance Richardson [Mon, 21 Nov 2016 23:01:52 +0000 (18:01 -0500)]
rhel: support enable/disable of ovn services

OVN services (northd, ovn-controller, ovn-controller-vtep) cannot
currently be enabled/disabled to start automatically on boot.

Add [Install] section for these services to allow them to be enabled
and disabled.

Reported-by: Mor Kalfon <mkalfon@redhat.com>
Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
7 years agoAUTHORS: Add Andrew Beekhof
Numan Siddique [Sun, 20 Nov 2016 18:11:11 +0000 (23:41 +0530)]
AUTHORS: Add Andrew Beekhof

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovs: optimize 'ip_parse_port' function.
nickcooper-zhangtonghao [Tue, 1 Nov 2016 02:00:41 +0000 (19:00 -0700)]
ovs: optimize 'ip_parse_port' function.

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn-nbctl: Add NAT commands.
nickcooper-zhangtonghao [Tue, 11 Oct 2016 14:36:24 +0000 (07:36 -0700)]
ovn-nbctl: Add NAT commands.

This patch provides the command line to create NAT rules
on logical router.

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: Add ovndb servers ocf script in debian packager
Babu Shanmugam [Wed, 16 Nov 2016 10:13:11 +0000 (15:43 +0530)]
ovn: Add ovndb servers ocf script in debian packager

The OCF script will be present in the ovn-common package and installed
in the openvswitch scripts folder and a symbolic link to this file will
be created in the OCF resources folder.

The OCF resource agent name for this resource is ocf:ovn:ovndb-servers

Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
Acked-by: Andy Zhou <azhou@ovn.org>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoovn: Add ovn db servers ocf script in fedora packager
Babu Shanmugam [Wed, 16 Nov 2016 10:13:10 +0000 (15:43 +0530)]
ovn: Add ovn db servers ocf script in fedora packager

The OCF script will be present in the ovn-common package and installed
in the openvswitch scripts folder. A symbolic link to this file will
be created in the OCF resources folder.

The OCF resource agent name for this resource is ocf:ovn:ovndb-servers

Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
Acked-by: Andy Zhou <azhou@ovn.org>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoovn: OCF script for OVN OVSDB servers
Babu Shanmugam [Wed, 16 Nov 2016 10:13:09 +0000 (15:43 +0530)]
ovn: OCF script for OVN OVSDB servers

Co-authored-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Co-authored-by: Andrew Beekhof <abeekhof@redhat.com>
Signed-off-by: Andrew Beekhof <abeekhof@redhat.com>
Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
Acked-by: Andy Zhou <azhou@ovn.org>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoovn: ovn-ctl support for HA ovn DB servers
Babu Shanmugam [Wed, 16 Nov 2016 10:13:08 +0000 (15:43 +0530)]
ovn: ovn-ctl support for HA ovn DB servers

This patch adds support to start_ovsdb() function in ovn-ctl to start the
ovn db servers in backup mode. This can be done in the following ways
1. Use parameters --ovn-nb-sync-from-addr and --ovn-sb-sync-from-addr to
   set the addresses of the active server.
2. Create files $etcdir/ovnnb-active.conf and $etcdir/ovnsb-active.conf
   with the tcp url of the active servers.

Additional functions to promote a backup server to active and demote
active server to backup mode are also added in this patch

One can optionally set the DB parameters for northd in
$etcdir/ovn-northd-db-params.conf. For example,

--ovnnb-db=tcp:172.16.247.230:6641 --ovnsb-db=tcp:172.16.247.230:6642

The parameters will be used as is, by start_northd(). If this file exists,
start_northd() will not start the DB servers even if $OVN_MANAGE_OVSDB is
'yes'.

Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
Acked-by: Andy Zhou <azhou@ovn.org>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoovn-nbctl: Fix manpage formatting typo.
nickcooper-zhangtonghao [Tue, 11 Oct 2016 14:36:25 +0000 (07:36 -0700)]
ovn-nbctl: Fix manpage formatting typo.

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agorhel: Support ovn-ctl args through env vars.
Russell Bryant [Thu, 17 Nov 2016 13:32:28 +0000 (08:32 -0500)]
rhel: Support ovn-ctl args through env vars.

Update the systemd units for ovn-controller and ovn-northd to support
passing additional arguments to the ovn-ctl scripts through environment
variables.  Also add some documentation to the top of these files that
describes how to specify these environment variables in systemd
configuration files.

Add similar documentation to the top of the ovn-controller-vtep system
unit to describe how to specify environment variables for options
passed to ovn-controller-vtep.

Signed-off-by: Russell Bryant <russell@ovn.org>
Co-authored-by: Babu Shanmugam <bschanmu@redhat.com>
Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
Acked-by: Simon Horman <simon.horman@netronome.com>
7 years agoovn-ctl: Fix --ovn-controller-log.
Russell Bryant [Thu, 17 Nov 2016 13:36:30 +0000 (08:36 -0500)]
ovn-ctl: Fix --ovn-controller-log.

This option was documented, but didn't actually work because
it wasn't used when starting ovn-controller.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Simon Horman <simon.horman@netronome.com>