]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
7 years agoRemove build-time generated files when "make clean" is run.
Justin Pettit [Tue, 14 Feb 2017 01:20:56 +0000 (17:20 -0800)]
Remove build-time generated files when "make clean" is run.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This patch fixes fixes that problem.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

No functional change.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Found by inspection.

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

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

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

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

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

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

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

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

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

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

Close the 'input_file' after data is read.

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

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

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

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

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

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

Found while testing.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agotests windows: change service test
Alin Serdean [Thu, 26 Jan 2017 18:32:56 +0000 (18:32 +0000)]
tests windows: change service test

Skip the test if the service 'ovsdb-server' is already defined.

The arguments of the service are incomplete: in the former state
it will try to create the pidfile and unixctl in the configuration path.
This patch adds those arguments.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Fix alignment in MapTunAttrToFlowPut
Alin Serdean [Tue, 10 Jan 2017 16:48:28 +0000 (16:48 +0000)]
datapath-windows: Fix alignment in MapTunAttrToFlowPut

Found by inspection.

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: Add a wrapper to retreive external vport
Shashank Ram [Tue, 24 Jan 2017 20:37:32 +0000 (12:37 -0800)]
datapath-windows: Add a wrapper to retreive external vport

This wrapper is to simplify readability.

Signed-off-by: Shashank Ram <rams@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Add support for OVS_KEY_ATTR_TCP set action
Alin Serdean [Thu, 26 Jan 2017 23:43:39 +0000 (23:43 +0000)]
datapath-windows: Add support for OVS_KEY_ATTR_TCP set action

This patch adds support for set action with OVS_KEY_ATTR_TCP attribute
(change TCP source or destination port).

If the source or destination TCP port was changed, update the TCP checksum.

A sample flow can look like the following:
set(tcp(src=80,dst=443))

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: Add support for OVS_KEY_ATTR_UDP set action
Alin Serdean [Thu, 26 Jan 2017 23:41:46 +0000 (23:41 +0000)]
datapath-windows: Add support for OVS_KEY_ATTR_UDP set action

This patch adds support for set action with OVS_KEY_ATTR_UDP attribute
(change UDP source or destination port).

If the source or destination UDP port was changed, update the UDP checksum.

A sample flow can look like the following:
set(udp(src=67,dst=68))

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: Add function to get continuous buffer from context
Alin Serdean [Thu, 26 Jan 2017 23:45:16 +0000 (23:45 +0000)]
datapath-windows: Add function to get continuous buffer from context

This patch extracts the code that tries to get a continuous IPv4 header
buffer from the function 'OvsUpdateIPv4Header' and moves it to a new
function 'OvsGetHeaderBySize'.

The new function can be used later when trying to change the UDP/TCP/MPLS
etc., headers.

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: OvsUpdateIPv4Header remove unnecessary addition
Alin Serdean [Thu, 26 Jan 2017 23:38:17 +0000 (23:38 +0000)]
datapath-windows: OvsUpdateIPv4Header remove unnecessary addition

bufferStart can be used directly to access the data of the net buffer.
Add the MDL offset to save unnecessary additions.

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 agoWindows: Fix wmi.c to use count of wchar_t instead of sizeof
Sairam Venugopal [Fri, 27 Jan 2017 07:56:04 +0000 (23:56 -0800)]
Windows: Fix wmi.c to use count of wchar_t instead of sizeof

wcscat_s and wcscpy_s requires number of elements as argument. wchar_t
uses 2 bytes for storage and using sizeof(internal_port_query) causes
access violation error on Windows 2012 R2 (64 bit). This patch introduces
a #define WMI_QUERY_COUNT set to 2048 and uses that instead.

Reported-by: Sairam Venugopal <vsairam@vmware.com>
Reported-at: openvswitch/ovs-issues#121
Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agowindows: WSAPoll broken on windows
Alin Serdean [Fri, 16 Dec 2016 02:50:28 +0000 (02:50 +0000)]
windows: WSAPoll broken on windows

Unfortunately, WSAPoll misbehaves on Windows please view detailed behavior
on: https://github.com/openvswitch/ovs-issues/issues/117

We replace the WSAPoll with select looking only for errors and write events.

Reported-at: https://github.com/openvswitch/ovs-issues/issues/117
Reported-by: Yin Lin <linyi@vmware.com>
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: rewrite redirect-chassis description in ovn-nb.xml
Mickey Spiegel [Fri, 27 Jan 2017 01:31:10 +0000 (17:31 -0800)]
ovn: rewrite redirect-chassis description in ovn-nb.xml

This optional patch addresses offline comments that the documentation
in ovn-nb.xml should not describe southbound constructs or flow
details, since it is user facing documentation.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: ovn-nbctl commands for distributed NAT
Mickey Spiegel [Fri, 27 Jan 2017 01:31:09 +0000 (17:31 -0800)]
ovn: ovn-nbctl commands for distributed NAT

This patch adds the new optional arguments "logical_port" and
"external_mac" to lr-nat-add, and displays that information in
lr-nat-list.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: distributed NAT flows
Mickey Spiegel [Fri, 27 Jan 2017 01:31:08 +0000 (17:31 -0800)]
ovn: distributed NAT flows

This patch implements the flows required in the ingress and egress
pipeline stages in order to support NAT on a distributed logical router.

NAT functionality is associated with the logical router gateway port.
The flows that carry out NAT functionality all have match conditions on
inport or outport equal to the logical router gateway port.  There are
additional flows that are used to redirect traffic when necessary,
using the tunnel key of a "chassisredirect" SB port binding in order to
redirect traffic to the instance of the logical router gateway port on
the centralized "redirect-chassis".

North/south traffic subject to one-to-one "dnat_and_snat" is handled
in a distributed manner, with south-to-north traffic going to the
local instance of the logical router gateway port.  North/south
traffic subject to (possibly one-to-many) "snat" is handled in a
centralized manner, with south-to-north traffic going to the instance
of the logical router gateway port on the "redirect-chassis".
North-to-south traffic is directed to the corresponding chassis by
limiting ARP responses to the appropriate instance of the logical
router gateway port on one chassis.  For centralized NAT rules, this
is the instance on the "redirect-chassis".  For distributed NAT rules,
this is the chassis where the corresponding logical port resides, using
an ethernet address specified in the NB NAT rule to trigger upstream
MAC learning.

East/west NAT traffic is all handled in a centralized manner.  While it
is certainly possible to handle some of this traffic in a distributed
manner, the centralized approach keeps the NAT flows simpler and
cleaner.  The expectation is that east/west NAT traffic is not as
important to optimize as north/south NAT traffic, with most east/west
traffic not requiring NAT.

Automated tests are currently limited to only a single node.  The
single node automated tests cover both north/south and east/west
traffic flows.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: avoid snat recirc only on gateway routers
Mickey Spiegel [Fri, 27 Jan 2017 01:31:07 +0000 (17:31 -0800)]
ovn: avoid snat recirc only on gateway routers

Currently, for performance reasons on gateway routers, ct_snat
that does not specify an IP address does not immediately trigger
recirculation.  On gateway routers, ct_snat that does not specify
an IP address happens in the UNSNAT pipeline stage, which is
followed by the DNAT pipeline stage that triggers recirculation
for all packets.  This DNAT pipeline stage recirculation takes
care of the recirculation needs of UNSNAT as well as other cases
such as UNDNAT.

On distributed routers, UNDNAT is handled in the egress pipeline
stage, separately from DNAT in the ingress pipeline stages.  The
DNAT pipeline stage only triggers recirculation for some packets.
Due to this difference in design, UNSNAT needs to trigger its own
recirculation.

This patch restricts the logic that avoids recirculation for
ct_snat, so that it only applies to datapaths representing
gateway routers.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: move load balancing flows after NAT flows
Mickey Spiegel [Fri, 27 Jan 2017 01:31:06 +0000 (17:31 -0800)]
ovn: move load balancing flows after NAT flows

This will make it easy for distributed NAT to reuse some of the
existing code for NAT flows, while leaving load balancing and defrag
as functionality specific to gateway routers.  There is no intent to
change any functionality in this patch.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodp-packet: Enhance packet batch APIs.
Andy Zhou [Tue, 17 Jan 2017 23:56:58 +0000 (15:56 -0800)]
dp-packet: Enhance packet batch APIs.

One common use case of 'struct dp_packet_batch' is to process all
packets in the batch in order. Add an iterator for this use case
to simplify the logic of calling sites,

Another common use case is to drop packets in the batch, by reading
all packets, but writing back pointers of fewer packets. Add macros
to support this use case.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agonetdev-dummy: Add --len option for netdev-dummy/receive command
Andy Zhou [Wed, 18 Jan 2017 10:30:26 +0000 (02:30 -0800)]
netdev-dummy: Add --len option for netdev-dummy/receive command

Currently, there is no way to specify the packet size when injecting
a packet via "netdev-dummy/receive" with a flow specification. Thus
far, packet size is not important for testing OVS features, but it
becomes useful in writing unit tests for the future patches.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agowindows: Change driver and MSI company name to LF
Alin Serdean [Thu, 26 Jan 2017 22:49:40 +0000 (22:49 +0000)]
windows: Change driver and MSI company name to LF

Until now we used 'Open vSwitch' as the company/organization name.

The project is now under The Linux Foundation ownership.

This patch updates the MSI and driver attributes to reflect that ownership.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agolib: Remove generated ovs-fields.7 manpage on make clean.
Ben Pfaff [Thu, 26 Jan 2017 19:28:32 +0000 (11:28 -0800)]
lib: Remove generated ovs-fields.7 manpage on make clean.

Found by travis.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agolibX.pc: use the correct output directory
Aaron Conole [Thu, 26 Jan 2017 19:07:00 +0000 (14:07 -0500)]
libX.pc: use the correct output directory

When the ovsdb library pkgconfig changes were introduced, they placed
generated output in the src directory.  This is incorrect, however, as
the output files should actually be placed in the build directory.  It
is only seen when running `make distcheck` after enabling shared
libraries (ex: `./configure --enable-shared`).

Fixes: commit e72e07a97e95 ("lib: Add support for pkgconfig for libovsdb.")
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoAdd ovs-fields.7 to lib/.gitignore
Alin Serdean [Thu, 26 Jan 2017 18:37:42 +0000 (18:37 +0000)]
Add ovs-fields.7 to lib/.gitignore

Found by inspection.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotest windows: appctl - route/add with gateway
Alin Serdean [Thu, 26 Jan 2017 17:57:41 +0000 (17:57 +0000)]
test windows: appctl - route/add with gateway

This test passes on Windows, change the test accordingly.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoextract-ofp-fields: Define .TQ directive in nroff output.
Ben Pfaff [Thu, 26 Jan 2017 04:29:48 +0000 (20:29 -0800)]
extract-ofp-fields: Define .TQ directive in nroff output.

This missing directive caused groff warnings and probably some erroneous
output too.

Fixes: 96fee5e0a2a0 ("ovs-fields: New manpage to document Open vSwitch and OpenFlow fields.")
Reported-by: Daniele Di Proietto <diproiettod@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@ovn.org>
7 years agoovs-fields: Eliminate non-ASCII characters from groff input.
Ben Pfaff [Thu, 26 Jan 2017 04:28:06 +0000 (20:28 -0800)]
ovs-fields: Eliminate non-ASCII characters from groff input.

It's difficult to make groff portably accept non-ASCII characters.  It's
easier to replace them by groff escapes for the same characters, which
this commit does.

Fixes: 96fee5e0a2a0 ("ovs-fields: New manpage to document Open vSwitch and OpenFlow fields.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoovn-northd: Add flows in DHCP_OPTIONS pipeline to support renew requests
Numan Siddique [Wed, 25 Jan 2017 07:55:12 +0000 (13:25 +0530)]
ovn-northd: Add flows in DHCP_OPTIONS pipeline to support renew requests

ovn-northd adds the flows to send the DHCPv4 packets to ovn-controller
only with the match ip4.src = 0.0.0.0 and ip4.dst = 255.255.255.255.

When a DHCPv4 lease is about to expire, before sending a DHCPDISCOVER
packet, the client can send a DHCPREQUEST packet to renew its ip
with ip4.src set to its offered ip and ip4.dst set to the DHCP server
ip or broadcast ip.

This patch supports this missing scenario by adding the necessary
flows in DHCP_OPTIONS ingress pipeline.

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agoovs-fields: New manpage to document Open vSwitch and OpenFlow fields.
Ben Pfaff [Wed, 25 Jan 2017 21:58:03 +0000 (13:58 -0800)]
ovs-fields: New manpage to document Open vSwitch and OpenFlow fields.

There is still plenty of opportunity for improvement, but this new
ovs-fields(7) manpage is much more comprehensive than ovs-ofctl(8)
could be.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agonroff: Improve formatting of ASCII diagrams.
Ben Pfaff [Wed, 28 Dec 2016 20:41:31 +0000 (12:41 -0800)]
nroff: Improve formatting of ASCII diagrams.

This makes diagrams in ASCII output look about as good as one might
reasonably expect, so that in ovn-architecture(7), for example, this:

. 9 bits: reserved (0)
. 15 bits: ingress port
. 16 bits: egress port
. 24 bits: datapath

now gets formatted as:

    9          15          16         24
+--------+------------+-----------+--------+
|reserved|ingress port|egress port|datapath|
+--------+------------+-----------+--------+
    0

which isn't perfect but certainly more evocative than a bulleted list.

This will be more useful in upcoming commits that start using diagrams more
frequently.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoxlate: Generate of datapath clone action when supported
Andy Zhou [Fri, 20 Jan 2017 06:40:14 +0000 (22:40 -0800)]
xlate: Generate of datapath clone action when supported

Add logic to detect whether datapath support clone.
Enhance the xlate logic to make use of it.
Added logic to turn on/off clone support for testing.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agodpif-netdev: Add clone action
Andy Zhou [Wed, 11 Jan 2017 02:13:47 +0000 (18:13 -0800)]
dpif-netdev: Add clone action

Add support for userspace datapath clone action.  The clone action
provides an action envelope to enclose an action list.
For example, with actions A, B, C and D,  and an action list:
      A, clone(B, C), D

The clone action will ensure that:

- D will see the same packet, and any meta states, such as flow, as
  action B.

- D will be executed regardless whether B, or C drops a packet. They
  can only drop a clone.

- When B drops a packet, clone will skip all remaining actions
  within the clone envelope. This feature is useful when we add
  meter action later:  The meter action can be implemented as a
  simple action without its own envolop (unlike the sample action).
  When necessary, the flow translation layer can enclose a meter action
  in clone.

The clone action is very similar with the OpenFlow clone action.
This is by design to simplify vswitchd flow translation logic.

Without datapath clone, vswitchd simulate the effect by inserting
datapath actions to "undo" clone actions. The above flow will be
translated into   A, B, C, -C, -B, D.

However, there are two issues:
- The resulting datapath action list may be longer without using
  clone.

- Some actions, such as NAT may not be possible to reverse.

This patch implements clone() simply with packet copy. The performance
can be improved with later patches, for example, to delay or avoid
packet copy if possible.  It seems datapath should have enough context
to carry out such optimization without the userspace context.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agolib: Add nl_msg_end_non_empty_nested()
Andy Zhou [Fri, 13 Jan 2017 01:08:53 +0000 (17:08 -0800)]
lib: Add nl_msg_end_non_empty_nested()

Later patch will make use of nl_msg_end_non_empty_nested()

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agodpif-netdev: Avoid sending probe packets
Andy Zhou [Fri, 20 Jan 2017 06:13:19 +0000 (22:13 -0800)]
dpif-netdev: Avoid sending probe packets

When ofproto probe for datapath features, no packets should actually
be sent to the network. This pactch fixes the userspace by dropping
probe packets before action execution.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agoovn: Document upgrade procedure.
Russell Bryant [Wed, 7 Dec 2016 19:24:45 +0000 (14:24 -0500)]
ovn: Document upgrade procedure.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Remove tutorials/ovn-basics.
Russell Bryant [Thu, 19 Jan 2017 19:11:48 +0000 (14:11 -0500)]
doc: Remove tutorials/ovn-basics.

The only thing worse than a lack of documentation is incorrect or
out-of-date documentation.  Over time, this document has not kept up with
the pace of OVN and is no longer a good current resource.

For a sandbox based tutorial like this, I'd like to start over using
ovn-trace as the basis.

An even more important type of tutorial would be something along the lines
of: http://blog.spinhirne.com/p/blog-series.html

That blog series was fantastic and has been the primary tutorial reference
I have been sending people to since it was written.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoactions: Add new "ct_clear" action.
Ben Pfaff [Fri, 20 Jan 2017 17:06:23 +0000 (09:06 -0800)]
actions: Add new "ct_clear" action.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoactions: Make "next" action able to jump from egress to ingress pipeline.
Ben Pfaff [Sat, 21 Jan 2017 19:03:42 +0000 (11:03 -0800)]
actions: Make "next" action able to jump from egress to ingress pipeline.

This feature is useful for centralized gateways.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoactions: Introduce enum ovnact_pipeline.
Ben Pfaff [Fri, 20 Jan 2017 16:56:19 +0000 (08:56 -0800)]
actions: Introduce enum ovnact_pipeline.

This isn't used yet by the actions code, but an upcoming commit will
introduce a user.  This commit just adjusts ovn-trace to use this common
type instead of its own local type.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>