cascardo/ovs.git
8 years agoovsdb-server: Refactoring and clean up remote status reporting.
Andy Zhou [Wed, 24 Feb 2016 01:48:11 +0000 (17:48 -0800)]
ovsdb-server: Refactoring and clean up remote status reporting.

When reporting remote status, A listening remote will randomly
pick a session and report its session status. This does not seem
to make much sense. It is probably better to leave those fields
untouched.

Update ovs-vswitchd.conf.db(5) to match the change in implementation.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb: fix a typo in ovs-vswitchd.conf.db(5).
Andy Zhou [Wed, 24 Feb 2016 01:50:55 +0000 (17:50 -0800)]
ovsdb: fix a typo in ovs-vswitchd.conf.db(5).

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agonetdev-dpdk: clean up mbuf initialization
Mark Kavanagh [Fri, 19 Feb 2016 11:25:11 +0000 (11:25 +0000)]
netdev-dpdk: clean up mbuf initialization

Current mbuf initialization relies on magic numbers and does not
accomodate mbufs of different sizes.

Resolve this issue by ensuring that mbufs are always aligned to a 1k
boundary (a typical DPDK NIC Rx buffer alignment).

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agotestsuite: Add timeout to add_of_br() command.
Ilya Maximets [Fri, 26 Feb 2016 11:57:40 +0000 (14:57 +0300)]
testsuite: Add timeout to add_of_br() command.

Fixes hang of testsuite on ovs-vswitchd failure.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoClean code in netlink-socket
Alin Serdean [Fri, 26 Feb 2016 14:10:12 +0000 (14:10 +0000)]
Clean code in netlink-socket

Found by inspection.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Connect to remote lports through localnet port.
Han Zhou [Fri, 26 Feb 2016 04:49:46 +0000 (20:49 -0800)]
ovn: Connect to remote lports through localnet port.

Before this patch, inter-chassis communication between VIFs of same
lswitch will always go through tunnel, which end up of modeling a
single physical network with many lswitches and pairs of lports, and
complexity in CMS like OpenStack neutron to manage the lswitches and
lports.

With this patch, inter-chassis communication can go through physical
networks via localnet port with a 1:1 mapping between lswitches and
physical networks. The pipeline becomes:

Ingress -> Egress (local) -> Ingress (remote) -> Egress

The original tunneling mechanism will still be used if there is no
localnet port configured on the lswitch.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Acked-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Avoid ARP responder for packets from localnet port
Han Zhou [Fri, 26 Feb 2016 04:26:23 +0000 (20:26 -0800)]
ovn: Avoid ARP responder for packets from localnet port

This is required by next commit that allows lswitch with localnet
port to be attached to multiple chassises. Without this patch, if
an ARP request comes from localnet port, on each chassis there will
be an ARP response, which is not desired.

An new stage ls_in_arp_rsp is introduced for ARP responder before
ls_in_l2_lkup.

Suggested-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Han Zhou <zhouhan@gmail.com>
Acked-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agofedora: include ovs-save file in the rpm package
Ansis Atteka [Sat, 13 Feb 2016 21:37:35 +0000 (13:37 -0800)]
fedora: include ovs-save file in the rpm package

Otherwise, "ovs-ctl force-reload-kmod ..." command fails with:

Detected internal interfaces: br-int p1                    [  OK  ]
Saving flows /usr/share/openvswitch/scripts/ovs-ctl:
line 267: /usr/share/openvswitch/scripts/ovs-save: No such file or directory
                                                           [FAILED]
Exiting ovsdb-server (3228)                                [  OK  ]
Starting ovsdb-server                                      [  OK  ]
Configuring Open vSwitch system IDs                        [  OK  ]
Exiting ovs-vswitchd (3243)                                [  OK  ]
Saving interface configuration /usr/share/openvswitch/scripts/ovs-ctl:
line 294: /usr/share/openvswitch/scripts/ovs-save: No such file or directory
                                                           [FAILED]
Failed to save configuration, not replacing kernel module ... (warning).
Starting ovs-vswitchd                                      [  OK  ]
Enabling remote OVSDB managers                             [  OK  ]

Signed-off-by: Ansis Atteka <ansisatteka@gmail.com>
Reported-by: Sanal Pillai <sanalp@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofp-parse: Remove unneeded #include.
Ben Pfaff [Fri, 26 Feb 2016 22:42:58 +0000 (14:42 -0800)]
ofp-parse: Remove unneeded #include.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agothread: Keep openvswitch/thread.h #includes more contained within include/.
Ben Pfaff [Fri, 26 Feb 2016 22:23:19 +0000 (14:23 -0800)]
thread: Keep openvswitch/thread.h #includes more contained within include/.

It's better if the "include" directory is self-contained to the extent
possible.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agotests: Fix use of "test".
Ben Pfaff [Thu, 25 Feb 2016 22:24:20 +0000 (14:24 -0800)]
tests: Fix use of "test".

Only = is portable for testing equality, == is a nonportable extension.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agom4: Rename compat.at to compat.m4.
Ben Pfaff [Mon, 22 Feb 2016 17:58:54 +0000 (09:58 -0800)]
m4: Rename compat.at to compat.m4.

This is used by both Autoconf and Autotest, so it doesn't make sense for
it to have a .at (Autotest) extension.

Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Move Autotest compatibility macros into tests directory.
Ben Pfaff [Mon, 22 Feb 2016 17:57:50 +0000 (09:57 -0800)]
tests: Move Autotest compatibility macros into tests directory.

compat.at mixes compatibility for m4sh, which is used by Autoconf and
Autotest, with compatibility for Autotest.  It makes more sense to separate
them.  This moves the Autotest-only compatibility macros into an Autotest
specific file.

Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Add Autoconf 2.63 compatibility support for AS_VAR_APPEND.
Ben Pfaff [Fri, 26 Feb 2016 20:46:48 +0000 (12:46 -0800)]
tests: Add Autoconf 2.63 compatibility support for AS_VAR_APPEND.

Reported-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-northd: Remove info log in extract_lport_addresses().
Han Zhou [Fri, 26 Feb 2016 07:35:35 +0000 (23:35 -0800)]
ovn-northd: Remove info log in extract_lport_addresses().

When a lport is with address "unknown", the function will complain
and print misleading logs. There is no need to print the log.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agorhel: provide our own SELinux custom policy package
Ansis Atteka [Tue, 19 Jan 2016 17:59:12 +0000 (09:59 -0800)]
rhel: provide our own SELinux custom policy package

CentOS, RHEL and Fedora distributions ship with their own Open vSwitch
SELinux policy that is too strict and prevents Open vSwitch to work
normally out of the box.

As a solution, this patch introduces a new package which will "loosen"
up "openvswitch_t" SELinux domain so that Open vSwitch could operate
normally.

Intended use-cases of this package are:
1. to allow users to install newer Open vSwitch on already released Fedora,
RHEL and CentOS distributions where the default Open vSwitch SELinux policy
that shipped with the corresponding Linux distribution is not up to date
and did not anticipate that a newer Open vSwitch version might need to
invoke new system calls or need to access certain system resources that
it did not before; And
2. to provide alternative means through which Open vSwitch developers
can proactively fix SELinux related policy issues without waiting for
corresponding Linux distribution maintainers to update their central
Open vSwitch SELinux policy.

This patch was tested on Fedora 23 and CentOS 7. I verified that now
on Fedora 23 Open vSwitch can create a NetLink socket; and that I did
not see following error messages:

vlog|INFO|opened log file /var/log/openvswitch/ovs-vswitchd.log
ovs_numa|INFO|Discovered 2 CPU cores on NUMA node 0
ovs_numa|INFO|Discovered 1 NUMA nodes and 2 CPU cores
reconnect|INFO|unix:/var/run/openvswitch/db.sock: connecting...
reconnect|INFO|unix:/var/run/openvswitch/db.sock: connected
netlink_socket|ERR|fcntl: Permission denied
dpif_netlink|ERR|Generic Netlink family 'ovs_datapath' does not exist.
                 The Open vSwitch kernel module is p robably not loaded.
dpif|WARN|failed to enumerate system datapaths: Permission denied
dpif|WARN|failed to create datapath ovs-system: Permission denied

I did not test all Open vSwitch features so there still could be some
OVS configuration that would get "Permission denied" errors.

Since, Open vSwitch daemons on Ubuntu 15.10 by default run under "unconfined"
SELinux domain, then there is no need to create a similar debian package
for Ubuntu, because it works on default Ubuntu installation.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Acked-by: Flavio Leitner <fbl@sysclose.com>
8 years agodpif-netdev: Fix double inclusion of cmap.h
Ilya Maximets [Thu, 25 Feb 2016 07:51:01 +0000 (10:51 +0300)]
dpif-netdev: Fix double inclusion of cmap.h

Also, all headers sorted lexicographically.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
8 years agoovn-northd: Allow lport 'addresses' to store multiple ips in each set
Numan Siddique [Mon, 22 Feb 2016 10:29:37 +0000 (15:59 +0530)]
ovn-northd: Allow lport 'addresses' to store multiple ips in each set

If a logical port has two ipv4 addresses and one ipv6 address
it will be stored as ["MAC IPv41 IPv42 IPv61"] instead of
["MAC IPv41", "MAC IPv42", "MAC IPv61"].

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
[blp@ovn.org made changes to comments and ovn.at]
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoAdd useful information to ovn E2E test
RYAN D. MOATS [Fri, 19 Feb 2016 17:25:07 +0000 (11:25 -0600)]
Add useful information to ovn E2E test

Make test 2002 "ovn -- 3 HVs, 1 LS, 3 lports/HV" output the OF flows from
all three hypervisors to help in case something goes wrong.

Signed-off-by: RYAN D. MOATS <rmoats@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Add a section on containers in OVN Tutorial
Numan Siddique [Fri, 19 Feb 2016 14:31:53 +0000 (20:01 +0530)]
ovn: Add a section on containers in OVN Tutorial

Signed-Off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Add a TODO item for GARP generation.
Russell Bryant [Thu, 25 Feb 2016 19:57:02 +0000 (14:57 -0500)]
ovn: Add a TODO item for GARP generation.

Reported-at: https://bugs.launchpad.net/networking-ovn/+bug/1545897
Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Gracefully terminate daemons in OVN tests
Lance Richardson [Thu, 25 Feb 2016 15:57:28 +0000 (10:57 -0500)]
tests: Gracefully terminate daemons in OVN tests

Daemons started in OVN tests are currently killed (via "on_exit kill"
in start_daemon()). This is problematic for tools (such as gcov) that
rely on exit() being called.

Fix by using "ovs-appctl ... exit" to gracefully terminate the daemons.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoxlate: Always recirculate after an MPLS POP to a non-MPLS ethertype.
Jarno Rajahalme [Thu, 25 Feb 2016 00:10:42 +0000 (16:10 -0800)]
xlate: Always recirculate after an MPLS POP to a non-MPLS ethertype.

So far we have tried to optimize MPLS POP action not to recirculate
unless later matching actually needs the inner headers.  This made the
code complex and error-prone.  Also the cases where this optimization
would have been useful seem rare, as one would typically want to do
something else with the inner packet than blindly send it to some
output port.

With this change multiple consecutive MPLS POPs do not need
recirculation in between, so even if the blind output case is now
little bit less optimal, the multiple POP case is correspondingly
faster with this change.

Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoodp-util: Format and scan multiple MPLS labels.
Jarno Rajahalme [Thu, 25 Feb 2016 00:10:42 +0000 (16:10 -0800)]
odp-util: Format and scan multiple MPLS labels.

So far we have been limited to including only one MPLS label in the
textual datapath flow format.  Allow upto 3 labels to be included so
that testing with multiple labels becomes easier.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Fix MPLS tests.
Jarno Rajahalme [Thu, 25 Feb 2016 00:10:42 +0000 (16:10 -0800)]
tests: Fix MPLS tests.

Some MPLS tests used non-MPLS ethertype for popping a label from a
multi-label stack.  Also, reveal actions in some MPLS tests.  This
will make later patches more easily understandable.

Fix the mpls-xlate banner and remove '-generate' option from MPLS
tests as it is no longer needed to create recirculation state.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb: avoid unnecessary call to ovsdb_monitor_get_update()
Andy Zhou [Mon, 22 Feb 2016 08:35:28 +0000 (00:35 -0800)]
ovsdb: avoid unnecessary call to ovsdb_monitor_get_update()

Optimizing ovsdb_jsonrpc_mintor_flush_all() by avoiding calling
ovsdb_monitor_get_update() on monitors that do not have any
unflushed updates.  This change saves CPU cycles on ovsdb-server's
main loop, but should not introduce any client visible changes.

Reported-by: Liran Schour <lirans@il.ibm.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Liran Schour <lirans@il.ibm.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb: rename variables in ovsdb_monitor_get_update()
Andy Zhou [Mon, 22 Feb 2016 08:31:03 +0000 (00:31 -0800)]
ovsdb: rename variables in ovsdb_monitor_get_update()

'prev_txn' and 'next_txn" are more confusing than 'unflushed' and
'unflushed_next'. Rename them.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Liran Schour <lirans@il.ibm.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb: Fix one off error in tracking monitor changes
Andy Zhou [Mon, 22 Feb 2016 08:24:06 +0000 (00:24 -0800)]
ovsdb: Fix one off error in tracking monitor changes

dbmon's changes should be stored with the next transaction number,
rather than the current transaction number.  This bug causes the
changes of a transaction stored in a monitor to be unnoticed by
the jsonrpc connections that is responsible for flush the monitor
content.

However, the bug was not noticed until it was exposed by a later
optimization patch: "avoid unnecessary call to ovsdb_monitor_get_update()."
The lack of optimization means that the update is still generated
when 'unflushed' equals to n_transactions + 1, which should have
indicated the monitor has been flushed already.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Liran Schour <lirans@il.ibm.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotravis: Automatically recheck failed tests.
Ben Pfaff [Tue, 9 Feb 2016 19:44:40 +0000 (11:44 -0800)]
travis: Automatically recheck failed tests.

This should make the automatic testsuite more reliable on Travis.  It's
better to fix tests to be more reliable, of course, but in practie it's
difficult to make all of them 100% reliable.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agotests: Add ability to automatically rerun failed tests.
Ben Pfaff [Wed, 24 Feb 2016 23:42:24 +0000 (15:42 -0800)]
tests: Add ability to automatically rerun failed tests.

A lot of packaging was doing this already, so this simplifies their
implementation.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoINSTALL.DPDK: Add notes regarding vhost multiq configuration.
Ian Stokes [Wed, 24 Feb 2016 17:30:57 +0000 (17:30 +0000)]
INSTALL.DPDK: Add notes regarding vhost multiq configuration.

Linux kernel network devices in a guest should have the number of
multi-purpose channels configured when used with DPDK multiqueue on the host.
This commit adds an example of how this can be done. Also add QEMU 2.5
requirements for multiqueue with DPDK in NEWS.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agonetdev-dpdk: vhost-user: Fix sending packets to queues not enabled by guest.
Ilya Maximets [Wed, 24 Feb 2016 14:14:43 +0000 (17:14 +0300)]
netdev-dpdk: vhost-user: Fix sending packets to queues not enabled by guest.

Currently virtio driver in guest operating system have to be configured
to use exactly same number of queues. If number of queues will be less,
some packets will get stuck in queues unused by guest and will not be
received.

Fix that by using new 'vring_state_changed' callback, which is
available for vhost-user since DPDK 2.2.
Implementation uses additional mapping from configured tx queues to
enabled by virtio driver. This requires mandatory locking of TX queues
in __netdev_dpdk_vhost_send(), but this locking was almost always anyway
because of calling set_multiq with n_txq = 'ovs_numa_get_n_cores() + 1'.

OVS_VHOST_MAX_QUEUE_NUM = 1024 chosen based on the fact that this is
the maximum number of queues supported by QEMU.

Fixes: 4573fbd38fa1 ("netdev-dpdk: Add vhost-user multiqueue support")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agoImplement OFPT_TABLE_STATUS Message.
Saloni Jain [Thu, 18 Feb 2016 10:24:26 +0000 (15:54 +0530)]
Implement OFPT_TABLE_STATUS Message.

On change in a table state, the controller needs to be informed with
the OFPT_TABLE_STATUS message. The message is sent with reason
OFPTR_VACANCY_DOWN or OFPTR_VACANCY_UP in case of change in remaining
space eventually crossing any one of the threshold.

Signed-off-by: Saloni Jain <saloni.jain@tcs.com>
Co-authored-by: Rishi Bamba <rishi.bamba@tcs.com>
Signed-off-by: Rishi Bamba <rishi.bamba@tcs.com>
[blp@ovn.org added vacancy event initialization and tests
 and updated NEWS]
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoconfigure: Fix checking of six library for Python 3.
Ilya Maximets [Wed, 24 Feb 2016 15:04:57 +0000 (18:04 +0300)]
configure: Fix checking of six library for Python 3.

Copied from python 2 checker but not corrected.

Fixes: 8fb7d02686ed ("configure: Check for presence of Python 3.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoflow: add miniflow_pad_from_64
Simon Horman [Wed, 20 Jan 2016 06:15:01 +0000 (15:15 +0900)]
flow: add miniflow_pad_from_64

Provide leading padding to allow pushing a value to a miniflow where
the value is not aligned to 64 bytes and no value has already been
pushed to the same word.

This will be used by a follow-up patch to allow layer 3 packet - that is
packets without an ethernet header - to be represented in flows.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoflow: add miniflow_push_uint8
Simon Horman [Wed, 20 Jan 2016 06:15:00 +0000 (15:15 +0900)]
flow: add miniflow_push_uint8

The motivation is to allow pushing single bytes in
a manner to that already used for 16, 32 and 64 bit integers.

This will be used by a follow-up patch to allow layer 3 packet -
that is packets without an ethernet header - to be represented in flows.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agonetdev-dpdk: Do not add vhost-user ports with '/' or '\' in name.
Daniele Di Proietto [Wed, 3 Feb 2016 01:24:32 +0000 (17:24 -0800)]
netdev-dpdk: Do not add vhost-user ports with '/' or '\' in name.

This check prevents an obvious way for a vhost-user socket to escape the
intended directory.

There might be other ways to escape the directory (none comes to mind at
the moment), but this is a problem that should be properly solved by
mandatory access control.

A similar check is done for a bridge name, since that name is used as
part of a socket as well.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
8 years agotests/dpdk/ring_client: extend range of supported dpdkr ports
Mauricio Vásquez [Tue, 23 Feb 2016 22:06:38 +0000 (23:06 +0100)]
tests/dpdk/ring_client: extend range of supported dpdkr ports

Current implementation of the ring_client test only supports until the
dpdkr255 port, this patch extends it to support the full range of possible
dpdkr ports.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agolib/netdev-dpdk: make device name parsing more robust
Mauricio Vásquez [Tue, 23 Feb 2016 22:06:37 +0000 (23:06 +0100)]
lib/netdev-dpdk: make device name parsing more robust

Current implementation of dpdk_dev_parse_name does not perform a robust
error handling, port names as "dpdkr" and "dpdkr1x" are considered valid.

With this patch only positive port numbers in decimal notation are considered
valid.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agovtep: Add error messages for logical router support
Dennis Sam [Tue, 23 Feb 2016 21:43:46 +0000 (13:43 -0800)]
vtep: Add error messages for logical router support

Documents error codes that a Hardware Switch Controller can publish to the NVC
to indicate errors related to the provisioning of logical routers.

Signed-off-by: Dennis Sam <dsam@arista.com>
Acked-by: Anupam Chanda <achandra@vmware.com>
Signed-off-by: Justin Pettit <jpettit@ovn.org>
8 years agoovs-ofctl.8: Clarify conntrack documentation.
Joe Stringer [Tue, 23 Feb 2016 21:26:29 +0000 (13:26 -0800)]
ovs-ofctl.8: Clarify conntrack documentation.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agolib: Fix netbsd compilation error.
Lance Richardson [Mon, 15 Feb 2016 15:08:51 +0000 (10:08 -0500)]
lib: Fix netbsd compilation error.

NetBSD requires <netinet/in.h> to be included before <netinit/ip6.h>.
Without this fix we have:

In file included from lib/netdev-vport.c:25:0:
/usr/include/netinet/ip6.h:82:18: error: field 'ip6_src' has incomplete type
/usr/include/netinet/ip6.h:83:18: error: field 'ip6_dst' has incomplete type

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agolib/netdev-dpdk: increase ring name length for dpdkr ports
Mauricio Vásquez [Sun, 24 Jan 2016 03:20:13 +0000 (22:20 -0500)]
lib/netdev-dpdk: increase ring name length for dpdkr ports

A ring name length of 10 characters is not enough for dpdkr ports
starting from dpdkr10, then it is increased to RTE_RING_NAMESIZE
characters.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agoMakefile.am: Clean flake8-check too.
Ben Pfaff [Mon, 22 Feb 2016 23:47:06 +0000 (15:47 -0800)]
Makefile.am: Clean flake8-check too.

Found by "make distcheck".

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agoofproto-dpif-xlate: Fix crash when using multicast snooping.
Thadeu Lima de Souza Cascardo [Wed, 17 Feb 2016 14:43:56 +0000 (12:43 -0200)]
ofproto-dpif-xlate: Fix crash when using multicast snooping.

The revalidator thread may set may_learn and call xlate_actions with no packet
data. If the revalidated flow is IGMPv3 or MLD, vswitchd will crash when trying
to access the NULL packet.

Only process IGMP and MLD flows when there is a packet. This is a similar
behavior than what we have for other special packets.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Reported-by: Yi Ba <yby.developer@yahoo.com>
Reported-at: http://openvswitch.org/pipermail/discuss/2016-January/020023.html
Fixes: 06994f879c9d ("mcast-snooping: Add Multicast Listener Discovery support")
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agorhel: Add missing ovn bugtool files
Flavio Leitner [Tue, 23 Feb 2016 03:26:39 +0000 (00:26 -0300)]
rhel: Add missing ovn bugtool files

Fixes: 981cbd52c942 ("ovs-bugtool: Create OVN plugin and add output.")
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodpif-netdev: Move rxq management into functions.
Ilya Maximets [Mon, 8 Feb 2016 15:30:30 +0000 (18:30 +0300)]
dpif-netdev: Move rxq management into functions.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agodpif-netdev: Reload each thread only once in do_add_port.
Ilya Maximets [Mon, 8 Feb 2016 15:30:29 +0000 (18:30 +0300)]
dpif-netdev: Reload each thread only once in do_add_port.

While adding of pmd interface with multiple queues several queues
may be assigned to one thread and this thread will be reloaded
one time for each added queue.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agodpif-netdev: Add dpif-netdev/pmd-rxq-show appctl command.
Ilya Maximets [Mon, 8 Feb 2016 07:38:47 +0000 (10:38 +0300)]
dpif-netdev: Add dpif-netdev/pmd-rxq-show appctl command.

This command can be used to check the port/rxq assignment to
pmd threads. For each pmd thread of the datapath shows list
of queue-ids with port names.

Additionally log message from pmd_thread_main() extended with
queue-id, and type of this message changed from INFO to DBG.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agobuild-windows: Enable parallel jobs for msbuild
Alin Serdean [Thu, 11 Feb 2016 03:09:32 +0000 (03:09 +0000)]
build-windows: Enable parallel jobs for msbuild

This patch enables parallel build from the command line.

If vstudio_config is defined change from:
make ovsext_make to make ovsext and also update the dependecy for it,
since the project requires OvsDpInterface.h to be built.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-bugtool: Create OVN plugin and add output.
William Tu [Sat, 6 Feb 2016 04:04:14 +0000 (20:04 -0800)]
ovs-bugtool: Create OVN plugin and add output.

Create a new ovn/utilities/bugtool directory, add ovn.xml to bugtool
plugins, and add ovn-nbctl show, ovn-sbctl show, and ovn-sbctl
lflow-list.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoNEWS: Claim support for Python 3.
Russell Bryant [Fri, 18 Dec 2015 19:53:32 +0000 (14:53 -0500)]
NEWS: Claim support for Python 3.

Also update the Python ovs package info to note that both Python 2 and 3
are supported.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agovlog.at: Run tests for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 19:14:22 +0000 (14:14 -0500)]
vlog.at: Run tests for Python 2 and 3.

Update these Python tests to run with both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agounixctl-py.at: Run tests for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 19:00:25 +0000 (14:00 -0500)]
unixctl-py.at: Run tests for Python 2 and 3.

Update these Python tests to run with both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodaemon-py.at: Run tests with Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 18:24:57 +0000 (13:24 -0500)]
daemon-py.at: Run tests with Python 2 and 3.

Update these Python tests to run with both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoreconnect.at: Run tests for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 15:56:28 +0000 (10:56 -0500)]
reconnect.at: Run tests for Python 2 and 3.

Update the reconnect tests to use both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agojsonrpc-py.at: Run tests with Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 15:52:31 +0000 (10:52 -0500)]
jsonrpc-py.at: Run tests with Python 2 and 3.

Convert these Python tests to run with both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agolibrary.at: Run tests for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 15:38:53 +0000 (10:38 -0500)]
library.at: Run tests for Python 2 and 3.

Update Python tests to run for both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb-idl.at: Run tests with both Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 15:29:32 +0000 (10:29 -0500)]
ovsdb-idl.at: Run tests with both Python 2 and 3.

Update Python tests to run for both Python 2 and Python 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb.at: Run Python tests for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 13:33:30 +0000 (08:33 -0500)]
ovsdb.at: Run Python tests for Python 2 and 3.

ovsdb.at includes some macros for running some identical test cases for
both C and Python.  Update these macros to run the test case for both
Python 2 and 3.  Retain the existing behavior for the direct use of the
_PY versions of these macros to only run against Python 2 without any
changes needed.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agojson.at: Run for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 01:55:18 +0000 (20:55 -0500)]
json.at: Run for Python 2 and 3.

Run json.at tests for both Python 2 and 3 if available.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoconfigure: Check for presence of Python 3.
Russell Bryant [Fri, 18 Dec 2015 00:58:33 +0000 (19:58 -0500)]
configure: Check for presence of Python 3.

The configure script already checked for Python 2 (>=2.7).  Add another
check for Python 3 (>=3.4).  This will be used later for automatically
running tests with Python 3 as well if available.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Deal with Python output differences.
Russell Bryant [Thu, 17 Dec 2015 17:22:31 +0000 (12:22 -0500)]
tests: Deal with Python output differences.

This test checks the output based on Python's string representation of
an array of two unicode strings.  These strings have a "u" prefix in
Python 2, but not Python 3.  In Python 3, all strings are unicode.

Use sed on the output to strip the "u" from Python 2 output when
checking for the expected result.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agogcc: Fix compile errors due to anonymous union initilization.
William Tu [Thu, 18 Feb 2016 02:00:22 +0000 (18:00 -0800)]
gcc: Fix compile errors due to anonymous union initilization.

gcc 4.4.7 lets you initialize named fields, and assign to anonymous union members,
but cannot statically initialize a named member of an anonymous union. This causes
errors when doing make:
fproto/fail-open.c: In function ‘send_bogus_packet_ins’:
ofproto/fail-open.c:130: error: unknown field ‘pin’ specified in initializer
ofproto/fail-open.c:131: error: unknown field ‘up’ specified in initializer
ofproto/fail-open.c:132: error: unknown field ‘packet’ specified in initializer
ofproto/fail-open.c:132: warning: missing braces around initializer
ofproto/fail-open.c:132: warning: (near initialization for ‘am.<anonymous>.pin.up’)
ofproto/fail-open.c:134: error: extra brace group at end of initializer

Examaple: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42875
We can either assign a name to the union or, in this patch, remove the unnecessary union.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoINSTALL.md: Fix shell command line formatting.
Jarno Rajahalme [Fri, 29 Jan 2016 23:18:14 +0000 (15:18 -0800)]
INSTALL.md: Fix shell command line formatting.

Some shell command lines were quoted inconsistently from others.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Better tolerate file system restriction on file name length.
Ben Pfaff [Tue, 16 Feb 2016 19:13:35 +0000 (11:13 -0800)]
tests: Better tolerate file system restriction on file name length.

ecryptfs on Linux restricts file names to 143 bytes, but these two tests
used a 150-byte name.  This commit fixes the specific problem on ecryptfs
by reducing the name it test to 143 bytes.  It also fixes the more general
problem of name length restrictions by skipping the test, rather than
failing it, if a directory with the 143-byte name cannot be created, since
the most likely problem is that the name is too long for the file system.

Reported-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agohmap: Add extra build-time iteration checks for types derived from hmap.
Ben Pfaff [Tue, 9 Feb 2016 00:52:45 +0000 (16:52 -0800)]
hmap: Add extra build-time iteration checks for types derived from hmap.

Some of our data structures derived from hmap use the same member names.
This means it's possible to confuse them in iteration, e.g. to iterate a
shash with SIMAP_FOR_EACH.  Of course this will crash at runtime, but it
seems even better to catch it at compile time.

An alternative would be to use unique member names, e.g. shash_map and
simap_map instead of just map.  I like short names, though.

It's kind of nasty that we need support from the hmap code to do this.
An alternative would be to insert the build assertions as statements before
the for loop.  But that would cause nasty surprises if someone forgets the
{} around a block of statements; even though the OVS coding style requires
them in all cases, I suspect that programmers doing debugging, etc. tend
to omit them sometimes.

It's not actually necessary to have multiple variants of these macros,
e.g. one can write a C99-compliant HMAP_FOR_EACH that accepts 3 or 4 or
more arguments.  But such a macro is harder to read, so I don't know
whether this is a good tradeoff.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoofp-actions: Introduce macro for padding struct members.
Ben Pfaff [Thu, 18 Feb 2016 18:12:04 +0000 (10:12 -0800)]
ofp-actions: Introduce macro for padding struct members.

An upcoming commit will add another case where it's desirable to ensure
that a variable-length array is aligned on an 8-byte boundary.  This macro
makes that a little easier.

Signed-off-by: Ben Pfaff <blp@ovn.org>
CC: Joe Stringer <joe@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
8 years agopinctrl: Fix header guard.
Ben Pfaff [Thu, 18 Feb 2016 16:10:42 +0000 (08:10 -0800)]
pinctrl: Fix header guard.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoImplement serializing the state of packet traversal in "continuations".
Ben Pfaff [Sat, 20 Feb 2016 00:10:06 +0000 (16:10 -0800)]
Implement serializing the state of packet traversal in "continuations".

One purpose of OpenFlow packet-in messages is to allow a controller to
interpose on the path of a packet through the flow tables.  If, for
example, the controller needs to modify a packet in some way that the
switch doesn't directly support, the controller should be able to
program the switch to send it the packet, then modify the packet and
send it back to the switch to continue through the flow table.

That's the theory.  In practice, this doesn't work with any but the
simplest flow tables.  Packet-in messages simply don't include enough
context to allow the flow table traversal to continue.  For example:

    * Via "resubmit" actions, an Open vSwitch packet can have an
      effective "call stack", but a packet-in can't describe it, and
      so it would be lost.

    * A packet-in can't preserve the stack used by NXAST_PUSH and
      NXAST_POP actions.

    * A packet-in can't preserve the OpenFlow 1.1+ action set.

    * A packet-in can't preserve the state of Open vSwitch mirroring
      or connection tracking.

This commit introduces a solution called "continuations".  A continuation
is the state of a packet's traversal through OpenFlow flow tables.  A
"controller" action with the "pause" flag, which is newly implemented in
this commit, generates a continuation and sends it to the OpenFlow
controller in a packet-in asynchronous message (only NXT_PACKET_IN2
supports continuations, so the controller must configure them with
NXT_SET_PACKET_IN_FORMAT).  The controller processes the packet-in,
possibly modifying some of its data, and sends it back to the switch with
an NXT_RESUME request, which causes flow table traversal to continue.  In
principle, a single packet can be paused and resumed multiple times.

Another way to look at it is:

    - "pause" is an extension of the existing OFPAT_CONTROLLER
      action.  It sends the packet to the controller, with full
      pipeline context (some of which is switch implementation
      dependent, and may thus vary from switch to switch).

    - A continuation is an extension of OFPT_PACKET_IN, allowing for
      implementation dependent metadata.

    - NXT_RESUME is an extension of OFPT_PACKET_OUT, with the
      semantics that the pipeline processing is continued with the
      original translation context from where it was left at the time
      it was paused.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofp-prop: Add support for putting and parsing nested properties.
Ben Pfaff [Fri, 19 Feb 2016 23:56:52 +0000 (15:56 -0800)]
ofp-prop: Add support for putting and parsing nested properties.

It hadn't occurred to me before that any special support was actually
necessary or useful for nested properties, but the functions introduced in
this commit are nice wrappers to deal with the extra 4-byte padding that
ensures that the nested properties begin on 8-byte boundaries just like
the outer properties.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoSupport userdata in NXT_PACKET_IN2.
Ben Pfaff [Fri, 19 Feb 2016 23:53:26 +0000 (15:53 -0800)]
Support userdata in NXT_PACKET_IN2.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofp-util: Rename struct ofputil_packet_in member 'len' to 'packet_len'.
Ben Pfaff [Wed, 17 Feb 2016 08:31:11 +0000 (00:31 -0800)]
ofp-util: Rename struct ofputil_packet_in member 'len' to 'packet_len'.

An upcoming commit will introduce another member that has a length, and
it seems weird that bare 'len' would be one or the other.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoImplement new packet-in format NXT_PACKET_IN2.
Ben Pfaff [Fri, 19 Feb 2016 23:31:37 +0000 (15:31 -0800)]
Implement new packet-in format NXT_PACKET_IN2.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofp-util: Remove 'const' from struct ofputil_packet_in's 'packet' member.
Ben Pfaff [Wed, 17 Feb 2016 21:14:26 +0000 (13:14 -0800)]
ofp-util: Remove 'const' from struct ofputil_packet_in's 'packet' member.

It's not const in all cases so it doesn't entirely make sense to mark
it const here.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofpbuf: New function ofpbuf_const_initializer().
Ben Pfaff [Thu, 18 Feb 2016 23:13:09 +0000 (15:13 -0800)]
ofpbuf: New function ofpbuf_const_initializer().

A number of times I've looked at code and thought that it would be easier
to understand if I could write an initializer instead of
ofpbuf_use_const().  This commit adds a function for that purpose and
adapts a lot of code to use it, in the places where I thought it made
the code better.

In theory this could improve code generation since the new function can
be inlined whereas ofpbuf_use_const() isn't.  But I guess that's probably
insignificant; the intent of this change is code readability.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoINSTALL.DPDK.md: Correct mergeable buffers parameter.
Ian Stokes [Wed, 10 Feb 2016 10:50:54 +0000 (10:50 +0000)]
INSTALL.DPDK.md: Correct mergeable buffers parameter.

Update the mergeable buffers paramaters in performance tuning
to the correct parameter mrg_rxbuf.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agoINSTALL.DPDK: Update details of XL710 restrictions for DPDK 2.2.
Ian Stokes [Tue, 9 Feb 2016 14:48:47 +0000 (14:48 +0000)]
INSTALL.DPDK: Update details of XL710 restrictions for DPDK 2.2.

DPDK 2.2 removes restrictions related to maximum number of TX
queues for XL710 devices. Update documentation to reflect these
changes.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agotypes: Fix defined but not used warning.
William Tu [Fri, 19 Feb 2016 21:35:55 +0000 (13:35 -0800)]
types: Fix defined but not used warning.

warning: ‘OVS_BE128_MAX’ defined but not used [-Wunused-const-variable]
Found using CentOS 6.6 with gcc 6.0.0.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Add mirror-related keywords to all the mirroring tests.
Ben Pfaff [Fri, 5 Feb 2016 23:30:26 +0000 (15:30 -0800)]
tests: Add mirror-related keywords to all the mirroring tests.

Autotest isn't too smart, so if you try to use "mirroring" as a keyword
before this commit it doesn't select most of the tests due to the comma in
the test names.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofproto-dpif-xlate: Don't consider mirrors used when excluded by VLAN.
Ben Pfaff [Sat, 6 Feb 2016 03:16:01 +0000 (19:16 -0800)]
ofproto-dpif-xlate: Don't consider mirrors used when excluded by VLAN.

Mirrors can be configured to select packets for mirroring on the basis
of multiple criteria: input ports, output ports, and VLANs.  A packet P
is to be mirrored if there exists a mirror M such that either:

    - P ingresses on an input port selected by M, or

    - P egresses on an output port selected by M

AND P is in a VLAN selected by M.

In addition, every mirror has a destination, which can be an output port
or an output VLAN.  Either way, if a packet is mirrored to a particular
destination, it is done only once, even if different mirrors both select
a packet and have the same destination.

Since commit efbc3b7c4006c (ofproto-dpif-xlate: Rewrite mirroring to better
fit flow translation.), these requirements have been implemented
incorrectly: if a packet satisfies one of the bulleted requirements
above for mirror M1, but not the VLAN selection requirement for M1,
then it was not sent to M's destination, but it was still considered
as having been sent to M1's destination for the purpose of avoid output
duplication.  Thus, if P satisfied *all* of the requirements for a
second mirror M2, if M1 and M2 had the same destination, the packet was
still not mirrored.  This commit fixes that problem.

(The issue only occurred if M1 happened to have a smaller index than
M2 in OVS's internal data structures.  That's just a matter of luck.)

Reported-by: Huanle Han <hanxueluo@gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2016-January/064531.html
Fixes: 7efbc3b7c4006c (ofproto-dpif-xlate: Rewrite mirroring to better fit flow translation.)
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofp-msgs: Move most OpenFlow header definitions here.
Ben Pfaff [Wed, 27 Jan 2016 23:50:00 +0000 (15:50 -0800)]
ofp-msgs: Move most OpenFlow header definitions here.

This code was the only user for OpenFlow header definitions other than
struct ofp_header itself.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofp-msgs: Add support for ONF extension messages.
Ben Pfaff [Wed, 27 Jan 2016 23:46:41 +0000 (15:46 -0800)]
ofp-msgs: Add support for ONF extension messages.

ONF introduced a number of "standard extensions" that use its own
vendor (experimenter) ID.  This commit adds support for such extensions to
ofp-msgs.

These extensions were already half-supported, so there's barely any change
to build-aux/extract-ofp-msgs.

This isn't fully tested, since nothing adds support for such a message yet.

Requested-by: Jarno Rajahalme <jarno@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agodatapath: lisp: Relax MTU constraints.
Joe Stringer [Sat, 13 Feb 2016 12:47:13 +0000 (04:47 -0800)]
datapath: lisp: Relax MTU constraints.

Currently, even if the entire path supports jumbo frames, the LISP netdev
limits the path MTU to 1500 bytes, and cannot be configured otherwise.
Relax the constraints on modifying the device MTU, and set it to the
maximum by default.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: stt: Relax MTU constraints.
Joe Stringer [Sat, 13 Feb 2016 12:32:36 +0000 (04:32 -0800)]
datapath: stt: Relax MTU constraints.

Currently, even if the entire path supports jumbo frames, the STT netdev
limits the path MTU to 1500 bytes, and cannot be configured otherwise.
Relax the constraints on modifying the device MTU, and set it to the
maximum by default.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: geneve: Refine MTU limit.
David Wragg [Thu, 18 Feb 2016 17:43:29 +0000 (17:43 +0000)]
datapath: geneve: Refine MTU limit.

Upstream commit:
    Calculate the maximum MTU taking into account the size of headers
    involved in GENEVE encapsulation, as for other tunnel types.

    Changes in v3:
    - Correct comment style
    Changes in v2:
    - Conform more closely to ip_tunnel_change_mtu
    - Exclude GENEVE options from max MTU calculation

Signed-off-by: David Wragg <david@weave.works>
Acked-by: Jesse Gross <jesse@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: aeee0e66c6b4 ("geneve: Refine MTU limit")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: Set a large MTU on tunnel devices.
David Wragg [Wed, 10 Feb 2016 00:05:58 +0000 (00:05 +0000)]
datapath: Set a large MTU on tunnel devices.

Upstream commit:
    Prior to 4.3, openvswitch tunnel vports (vxlan, gre and geneve) could
    transmit vxlan packets of any size, constrained only by the ability to
    send out the resulting packets.  4.3 introduced netdevs corresponding
    to tunnel vports.  These netdevs have an MTU, which limits the size of
    a packet that can be successfully encapsulated.  The default MTU
    values are low (1500 or less), which is awkwardly small in the context
    of physical networks supporting jumbo frames, and leads to a
    conspicuous change in behaviour for userspace.

    Instead, set the MTU on openvswitch-created netdevs to be the relevant
    maximum (i.e. the maximum IP packet size minus any relevant overhead),
    effectively restoring the behaviour prior to 4.3.

Signed-off-by: David Wragg <david@weave.works>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 7e059158d57b ("vxlan, gre, geneve: Set a large MTU on ovs-created
tunnel devices")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: geneve: Relax MTU constraints.
David Wragg [Wed, 10 Feb 2016 00:05:57 +0000 (00:05 +0000)]
datapath: geneve: Relax MTU constraints.

Upstream commit:
    Allow the MTU of geneve devices to be set to large values, in order to
    exploit underlying networks with larger frame sizes.

    GENEVE does not have a fixed encapsulation overhead (an openvswitch
    rule can add variable length options), so there is no relevant maximum
    MTU to enforce.  A maximum of IP_MAX_MTU is used instead.
    Encapsulated packets that are too big for the underlying network will
    get dropped on the floor.

Signed-off-by: David Wragg <david@weave.works>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 55e5bfb53cff ("geneve: Relax MTU constraints")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: vxlan: Relax MTU constraints.
David Wragg [Wed, 10 Feb 2016 00:05:55 +0000 (00:05 +0000)]
datapath: vxlan: Relax MTU constraints.

Upstream commit:
    Allow the MTU of vxlan devices without an underlying device to be set
    to larger values (up to a maximum based on IP packet limits and vxlan
    overhead).

    Previously, their MTUs could not be set to higher than the
    conventional ethernet value of 1500.  This is a very arbitrary value
    in the context of vxlan, and prevented vxlan devices from being able
    to take advantage of jumbo frames etc.

    The default MTU remains 1500, for compatibility.

Signed-off-by: David Wragg <david@weave.works>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 72564b59ffc4 ("vxlan: Relax MTU constraints")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agoovn: Reorganize action parsing test.
Ben Pfaff [Fri, 4 Dec 2015 22:26:47 +0000 (14:26 -0800)]
ovn: Reorganize action parsing test.

It seems easier to understand if all of the tests for a given action
are grouped together.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agoexpr: Generalize wording of error message in expand_symbol().
Ben Pfaff [Fri, 4 Dec 2015 22:12:05 +0000 (14:12 -0800)]
expr: Generalize wording of error message in expand_symbol().

The existing wording was very specific to the actual operation being
performed.  While this is nice for users, it becomes difficult to maintain
as more and more operations are added.  This commit makes the wording less
specific, because a third operation will start using this function in an
upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agoofproto-dpif-xlate: Distinguish "freezing" from "recirculation".
Ben Pfaff [Tue, 16 Feb 2016 18:51:58 +0000 (10:51 -0800)]
ofproto-dpif-xlate: Distinguish "freezing" from "recirculation".

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofproto-dpif-xlate: Break recirculation actions out from action_set.
Ben Pfaff [Fri, 29 Jan 2016 01:11:19 +0000 (17:11 -0800)]
ofproto-dpif-xlate: Break recirculation actions out from action_set.

In my opinion, this is less confusing in multiple ways.  I now understand
the code better myself.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofproto-dpif-xlate: New helper function ctx_cancel_recirculation().
Ben Pfaff [Fri, 29 Jan 2016 00:35:11 +0000 (16:35 -0800)]
ofproto-dpif-xlate: New helper function ctx_cancel_recirculation().

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofproto-dpif-xlate: Improve recirc_unroll_actions() interface.
Ben Pfaff [Fri, 29 Jan 2016 00:27:32 +0000 (16:27 -0800)]
ofproto-dpif-xlate: Improve recirc_unroll_actions() interface.

This interface is still straightforward and easier for the client.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofpbuf: Make ofpbuf_put_hex() accept period between hex bytes also.
Ben Pfaff [Wed, 10 Feb 2016 23:54:43 +0000 (15:54 -0800)]
ofpbuf: Make ofpbuf_put_hex() accept period between hex bytes also.

This makes it accept the same syntax as parse_NOTE(), so that that function
can be simplified.  In an upcoming commit a second action will also be
able to take advantage of the same feature.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agodynamic-string: Make ds_chomp() return true if it removed a character.
Ben Pfaff [Wed, 10 Feb 2016 04:54:03 +0000 (20:54 -0800)]
dynamic-string: Make ds_chomp() return true if it removed a character.

This will be used in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agotunneling: Disable IPv6 tunnel
Pravin B Shelar [Thu, 11 Feb 2016 09:05:16 +0000 (01:05 -0800)]
tunneling: Disable IPv6 tunnel

There are multiple issues in IPv6 userspace tunnel
implementation. Even the kernel module that ships with
2.5 does not support IPv6 tunneling. There is not
enough time to get all fixes in branch-2.5. So it make
sense to disable the support on 2.5.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agoopenflow-common: Describe length and padding rules for OpenFlow properties.
Ben Pfaff [Tue, 16 Feb 2016 23:33:42 +0000 (15:33 -0800)]
openflow-common: Describe length and padding rules for OpenFlow properties.

I keep having to rediscover these from the code.  This is easier.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
8 years agodatapath-windows: Enable multiprocessor compilation on solution
Alin Serdean [Thu, 11 Feb 2016 02:30:32 +0000 (02:30 +0000)]
datapath-windows: Enable multiprocessor compilation on solution

Visual Studio defines by default the maximum number of concurrent jobs.

This patch allows the parallel built of the solution.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>