]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
8 years agolib: add format_in6_addr and scan_in6_addr
Jiri Benc [Wed, 25 Nov 2015 13:31:10 +0000 (11:31 -0200)]
lib: add format_in6_addr and scan_in6_addr

Add in6_addr counterparts to the existing format and scan functions.
Otherwise we'd need to recast all the time.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto-dpif-xlate: use IPv6 for orig_tunnel_ip_dst
Thadeu Lima de Souza Cascardo [Wed, 25 Nov 2015 13:31:09 +0000 (11:31 -0200)]
ofproto-dpif-xlate: use IPv6 for orig_tunnel_ip_dst

orig_tunnel_ip_dst is replaced by orig_tunnel_ipv6_dst and represents IPv4
addresses as IPv4-mapped IPv6 addresses. Since this is only used in
ofproto-dpif-xlate, this change is well contained.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotunneling: add IPv6 support to netdev_tunnel_config
Jiri Benc [Wed, 25 Nov 2015 13:31:08 +0000 (11:31 -0200)]
tunneling: add IPv6 support to netdev_tunnel_config

Allow configuration of IPv6 tunnel endpoints.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Co-authored-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agosmap: smap_add_ipv6 adds IPv4-mapped addresses as IPv4
Thadeu Lima de Souza Cascardo [Wed, 25 Nov 2015 13:31:07 +0000 (11:31 -0200)]
smap: smap_add_ipv6 adds IPv4-mapped addresses as IPv4

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agopackets: Add ipv6_string_mapped.
Thadeu Lima de Souza Cascardo [Wed, 25 Nov 2015 13:31:06 +0000 (11:31 -0200)]
packets: Add ipv6_string_mapped.

ipv6_string_mapped stores an IPv6 or IPv4 representation of an IPv6 address
into a string. If the address is IPv4-mapped, it's represented in IPv4
dotted-decimal format.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotnl-ports: remove unused tnl-arp-cache.h and include other necessary headers
Thadeu Lima de Souza Cascardo [Wed, 25 Nov 2015 13:31:04 +0000 (11:31 -0200)]
tnl-ports: remove unused tnl-arp-cache.h and include other necessary headers

tnl-ports.c did not use anything from tnl-arp-cache.h besides some other headers
that the latter included, like system string.h and OVS netdev.h.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoAUTHORS: Add Hiteshi Kalra, Saloni Jain, Shashwat Srivastava, Sandeep Kumar.
Ben Pfaff [Mon, 30 Nov 2015 02:30:23 +0000 (18:30 -0800)]
AUTHORS: Add Hiteshi Kalra, Saloni Jain, Shashwat Srivastava, Sandeep Kumar.

Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoVagrantfile: Update to Fedora 22 base box
Mark D. Gray [Tue, 24 Nov 2015 19:39:38 +0000 (19:39 +0000)]
Vagrantfile: Update to Fedora 22 base box

Fedora 20 base box is no longer available at chef/fedora20.

Signed-off-by: Mark D. Gray <mark.d.gray@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoImplement Vacancy Events for OFPMP_TABLE_DESC.
Saloni Jain [Tue, 24 Nov 2015 12:20:22 +0000 (17:50 +0530)]
Implement Vacancy Events for OFPMP_TABLE_DESC.

This patch adds support for vacancy events in table-desc.

ovs-ofctl -O OpenFlow14 dump-tables-desc <switch>
-This command is enhanced to display the Vacancy Event configuration
 of the tables on a <switch>, which is set using the mod-table command.

Signed-off-by: Saloni Jain <saloni.jain@tcs.com>
Co-authored-by: Hiteshi Kalra <hiteshi.kalra@tcs.com>
Signed-off-by: Hiteshi Kalra <hiteshi.kalra@tcs.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoImplement Openflow 1.4 Vacancy Events for OFPT_TABLE_MOD.
Saloni Jain [Tue, 24 Nov 2015 12:19:42 +0000 (17:49 +0530)]
Implement Openflow 1.4 Vacancy Events for OFPT_TABLE_MOD.

OpenFlow 1.4 introduces the ability to turn on vacancy events with an
OFPT_TABLE_MOD message specifying OFPTC_VACANCY_EVENTS. This commit adds
support for the new feature in ovs-ofctl mod-table.
As per the openflow specification-1.4, vacancy event adds a mechanism
enabling the controller to get an early warning based on capacity
threshold chosen by the controller.

With this commit, vacancy events can be configured as:
ovs-ofctl -O OpenFlow14 mod-table <bridge> <table> vacancy:<low,high>
<low,high> specify vacancy threshold values in percentage for vacancy_down
and vacancy_up respectively.

To disable vacancy events, following command should be given:
ovs-ofctl -O OpenFlow14 mod-table <bridge> <table> novacancy

Signed-off-by: Saloni Jain <saloni.jain@tcs.com>
Co-authored-by: Shashwat Srivastava <shashwat.srivastava@tcs.com>
Signed-off-by: Shashwat Srivastava <shashwat.srivastava@tcs.com>
Co-authored-by: Sandeep Kumar <sandeep.kumar16@tcs.com>
Signed-off-by: Sandeep Kumar <sandeep.kumar16@tcs.com>
[blp@ovn.org fixed a few typos]
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-northd: Refactor main loop to use ovsdb_idl_loop_* functions
Numan Siddique [Mon, 23 Nov 2015 07:19:26 +0000 (12:49 +0530)]
ovn-northd: Refactor main loop to use ovsdb_idl_loop_* functions

This patch also addresses the issue reported at
http://openvswitch.org/pipermail/discuss/2015-November/019445.html

Suggested-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoAUTHORS: Add Han Zhou.
Ben Pfaff [Mon, 30 Nov 2015 00:38:32 +0000 (16:38 -0800)]
AUTHORS: Add Han Zhou.

Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: use name instead of uuid as key of logical router ports
Han Zhou [Tue, 24 Nov 2015 23:26:52 +0000 (15:26 -0800)]
ovn: use name instead of uuid as key of logical router ports

Before this patch, logical switch ports were using name as key but
logical router ports using uuid, which confuses user when trouble-
shooting, and names of patch ports unreadable. This patch unifies
it by using "name" field also for logical router ports.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agovtep/vtep.xml: Improve XML source formatting.
Ariel Tubaltsev [Fri, 20 Nov 2015 22:09:47 +0000 (14:09 -0800)]
vtep/vtep.xml: Improve XML source formatting.

This patch contains only cosmetic changes.

Signed-off-by: Ariel Tubaltsev <tubaltzev@gmail.com>
Acked-by: Bruce Davie <bdavie@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agonetdev-linux: Handle flags for 10G and 40G speeds
Simon Horman [Sun, 29 Nov 2015 23:49:04 +0000 (08:49 +0900)]
netdev-linux: Handle flags for 10G and 40G speeds

Handle advertised and supported flags for the following speeds:

* 1G base KX
* 10G base KX4, KR, R
* 40G base KR4, CR4, SR4, LR4

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agonetdev-linux: correctly detect port speed bits beyond 16bit
Simon Horman [Sun, 29 Nov 2015 23:49:03 +0000 (08:49 +0900)]
netdev-linux: correctly detect port speed bits beyond 16bit

This includes bits for:
* Backplane
* 1000 baseKX (full duplex)
* All speeds of 10Gbit and above other than 10000 baseT (full duplex).

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoofp-util: Add "check_overlap" and "reset_counts" to stateful flags.
Ben Pfaff [Sat, 28 Nov 2015 19:55:58 +0000 (11:55 -0800)]
ofp-util: Add "check_overlap" and "reset_counts" to stateful flags.

The OpenFlow specification implies that every flag is part of the flow
state, even though that isn't really meaningful for OFPFF_CHECK_OVERLAP
or OFPFF_RESET_COUNTS.  This commit adds them to the flow state (reported
in flow stats replies).

Found by OFTest.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Co-authored-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
8 years agoINSTALL.SSL.md: Fix arguments to "ovs-pki req" command.
Ben Pfaff [Tue, 3 Nov 2015 21:08:50 +0000 (13:08 -0800)]
INSTALL.SSL.md: Fix arguments to "ovs-pki req" command.

Reported-by: Aaron Rosen <aaronorosen@gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2015-November/061778.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
8 years agoofproto: Fix inserting buckets at the end of an empty group.
Ben Pfaff [Thu, 15 Oct 2015 00:11:09 +0000 (17:11 -0700)]
ofproto: Fix inserting buckets at the end of an empty group.

This caused a segfault.

Reported-by: Ray Li <rayli1107@gmail.com>
Reported-at: http://openvswitch.org/pipermail/discuss/2015-September/018746.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
8 years agoofp-util: Reject bad group type and command with error instead of abort.
Ben Pfaff [Mon, 12 Oct 2015 17:10:21 +0000 (10:10 -0700)]
ofp-util: Reject bad group type and command with error instead of abort.

Reported-by: Manpreet Singh <er.manpreet25@gmail.com>
Reported-at: http://openvswitch.org/pipermail/discuss/2015-October/019048.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
8 years agotests: Add tests for out_port and out_group.
Ben Pfaff [Tue, 8 Sep 2015 22:22:15 +0000 (15:22 -0700)]
tests: Add tests for out_port and out_group.

Open vSwitch has supported these features on flow_mod for a long time, but
it has never included a test.  This commit adds tests for both.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
8 years agoovs-ofctl: Add "out_group" keyword for OF1.1+ matching on output group.
Ben Pfaff [Tue, 8 Sep 2015 22:21:45 +0000 (15:21 -0700)]
ovs-ofctl: Add "out_group" keyword for OF1.1+ matching on output group.

It seems that OVS has never supported this OpenFlow feature in ovs-ofctl,
which makes it hard to test.  This commit adds support.

(Open vSwitch has supported this in OpenFlow for a long time; it's only
ovs-ofctl that didn't.)

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
8 years agoofp-actions: Look inside write_actions for output ports and groups.
Ben Pfaff [Sun, 29 Nov 2015 18:51:25 +0000 (10:51 -0800)]
ofp-actions: Look inside write_actions for output ports and groups.

The out_port and out_group matches only looked at apply_actions
instructions, but my interpretation of the OpenFlow spec is that they
should also look inside write_actions.

This affected the output of (and in one case the correctness of) some
tests, so this updates them.

Reported-by: Gavin Remaley <gavin_remaley@selinc.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
8 years agotests: Make parse_listening_port entirely reliable.
Ben Pfaff [Thu, 26 Nov 2015 21:13:29 +0000 (13:13 -0800)]
tests: Make parse_listening_port entirely reliable.

In test runs, I've occasionally seen mysterious failures in which
parse_listening_port failed to find the listening port even though an
examination of the log file showed that it was there.  I spent some time
trying to figure out what was going wrong.  It seemed like everything was
lined up properly to ensure that a command like "ovs-vsctl set-controller
br0 tcp:127.0.0.1:0" would only return to the command prompt after the
new listener was ready and the proper log message was written.  It was
obviously a very small race because I could only reproduce it with a large
test parallelism (e.g. -j10 on my quad-core laptop).

The problem turned out to be asynchronous logging in ovs-vswitchd.  If I
turned that off, by commenting out the call to vlog_enable_async() in
bridge.c, parse_listening_port became reliable.

This commit works around the problem by making parse_listening_port retry
for a while if necessary.  It also transforms the shell function into an
m4 macro (so that it can use OVS_WAIT_UNTIL) and renames it to
all-uppercase to follow the convention for macros.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
8 years agotests: Make OVS_WAIT_WHILE, OVS_WAIT_UNTIL run even faster in some cases.
Ben Pfaff [Sun, 5 Jul 2015 17:20:35 +0000 (10:20 -0700)]
tests: Make OVS_WAIT_WHILE, OVS_WAIT_UNTIL run even faster in some cases.

Sometimes OVS_WAIT_WHILE and OVS_WAIT_UNTIL are used for conditions that
tend to be true immediately but sometimes take a moment or two.  This
change makes such cases 0.1 seconds faster (which could add up over
hundreds of tests).

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
8 years agotests: Run OVS_WAIT_WHILE, OVS_WAIT_UNTIL in main shell environment.
Ben Pfaff [Sun, 5 Jul 2015 17:19:30 +0000 (10:19 -0700)]
tests: Run OVS_WAIT_WHILE, OVS_WAIT_UNTIL in main shell environment.

AT_CHECK runs its commands in a subshell.  That means that (among other
effects), any variable assignments within its commands will disappear after
the commands' completion.  That doesn't matter for any of the existing
users, which don't do the sorts of things that affect an outer shell
environment anyhow, but an upcoming user wants to make a shell assignment
that persists.  This commit makes that possible, by using AT_CHECK
(actually AT_FAIL_IF but it's moot) only upon failure instead of bracketing
the entire test.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
8 years agoofproto-dpif-xlate: Fix byte-order error in comparison.
Ben Pfaff [Thu, 26 Nov 2015 06:30:21 +0000 (22:30 -0800)]
ofproto-dpif-xlate: Fix byte-order error in comparison.

Found by sparse.

CC: Jarno Rajahalme <jarno@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
8 years agoclassifier-private.h: Whitespace in a comment
YAMAMOTO Takashi [Thu, 15 Oct 2015 04:56:25 +0000 (04:56 +0000)]
classifier-private.h: Whitespace in a comment

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-ofctl.at: Fix a comment typo
YAMAMOTO Takashi [Thu, 15 Oct 2015 04:26:29 +0000 (04:26 +0000)]
ovs-ofctl.at: Fix a comment typo

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto.at: Workaround a race
YAMAMOTO Takashi [Wed, 14 Oct 2015 18:41:41 +0000 (18:41 +0000)]
ofproto.at: Workaround a race

While a barrier serializes requests from the same connection,
it doesn't wait for requests from other connections to the switch.
Replace the barrier with infamous "sleep 1" to workaround the problem.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto.at: Portability improvement
YAMAMOTO Takashi [Wed, 14 Oct 2015 18:24:33 +0000 (18:24 +0000)]
ofproto.at: Portability improvement

== is a bash dialect.  Use = instead.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto-dpif: Remove a debug log
YAMAMOTO Takashi [Wed, 14 Oct 2015 18:19:02 +0000 (18:19 +0000)]
ofproto-dpif: Remove a debug log

The message seems stale and it happens on port-mod.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto-dpif.at: Fix a race
YAMAMOTO Takashi [Wed, 14 Oct 2015 17:59:28 +0000 (17:59 +0000)]
ofproto-dpif.at: Fix a race

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agovtep-ctl.at: Fix a regex
YAMAMOTO Takashi [Wed, 14 Oct 2015 17:51:54 +0000 (17:51 +0000)]
vtep-ctl.at: Fix a regex

} is an ordinary character in "basic" regex.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodpif_dummy_override: Allow overriding a non-existing provider
YAMAMOTO Takashi [Wed, 14 Oct 2015 17:39:40 +0000 (17:39 +0000)]
dpif_dummy_override: Allow overriding a non-existing provider

This allows --enable-dummy=system with a userland-only build.
It's useful for testsuite.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-controller-vtep.at: Fix a race
YAMAMOTO Takashi [Wed, 14 Oct 2015 17:04:40 +0000 (17:04 +0000)]
ovn-controller-vtep.at: Fix a race

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agouse "/usr/bin/env python" for shebangs for python scripts
YAMAMOTO Takashi [Wed, 14 Oct 2015 16:44:11 +0000 (16:44 +0000)]
use "/usr/bin/env python" for shebangs for python scripts

On NetBSD, a typical path of python interpreter is /usr/pkg/bin/python.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto-macros.at: Rename vconn_windows_sub to vconn_sub
YAMAMOTO Takashi [Wed, 14 Oct 2015 15:57:58 +0000 (15:57 +0000)]
ofproto-macros.at: Rename vconn_windows_sub to vconn_sub

This is a preparation to add non-windows stuff.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotest-atomic: Bump test duration for multi-thread tests
YAMAMOTO Takashi [Wed, 14 Oct 2015 15:21:49 +0000 (15:21 +0000)]
test-atomic: Bump test duration for multi-thread tests

This makes tests pass on on my single-cpu NetBSD-7 VM.

How frequently preemption happens depends on the cpu scheduler.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agocompletion.at: Improve portability
YAMAMOTO Takashi [Wed, 14 Oct 2015 06:36:20 +0000 (06:36 +0000)]
completion.at: Improve portability

NetBSD's /bin/sh complains on the syntax of bash array.

While the use of eval might seem overkill, it's tricky to avoid
the error because the generated code will be a part of the surrounding
subshell and the syntax check is done a bit earlier than the execution
of these conditionals.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodaemon_switch_user: Improve portablility
YAMAMOTO Takashi [Wed, 14 Oct 2015 05:42:50 +0000 (05:42 +0000)]
daemon_switch_user: Improve portablility

NetBSD doesn't have [gs]etres[ug]id.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Andy Zhou <azhou@nicira.com>
8 years agoopenvswitch.m4: Portability improvement
YAMAMOTO Takashi [Wed, 14 Oct 2015 05:09:15 +0000 (05:09 +0000)]
openvswitch.m4: Portability improvement

${parameter/pattern/string} substituion is not portable.
Replace them with $SED equivalent.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agonetdev-bsd: Update after eth_addr changes
YAMAMOTO Takashi [Wed, 14 Oct 2015 04:55:26 +0000 (04:55 +0000)]
netdev-bsd: Update after eth_addr changes

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotnl-arp-cache: Fix NetBSD build
YAMAMOTO Takashi [Wed, 14 Oct 2015 04:50:15 +0000 (04:50 +0000)]
tnl-arp-cache: Fix NetBSD build

On NetBSD, netinet/icmp6.h has a few pre-requisite headers.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofp-actions: Define IPPORT_FTP by ourselves
YAMAMOTO Takashi [Wed, 14 Oct 2015 04:41:47 +0000 (04:41 +0000)]
ofp-actions: Define IPPORT_FTP by ourselves

IPPORT_FTP is not always provided by system headers.  (eg. NetBSD, OS X)

This hides the enum on Linux but I don't think it causes a problem.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoextract-odp-netlink-h: Portablitiy improvement
YAMAMOTO Takashi [Wed, 14 Oct 2015 04:30:51 +0000 (04:30 +0000)]
extract-odp-netlink-h: Portablitiy improvement

\t is GNU sed extension.  Use [[:space:]] instead.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-router: Report ovs/route/add errors as errors.
Ben Pfaff [Tue, 24 Nov 2015 04:49:35 +0000 (20:49 -0800)]
ovs-router: Report ovs/route/add errors as errors.

The _error version should be used to report errors.

Also, add missing return in one error case.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
8 years agonetdev-linux: Remove unreachable code in netdev_linux_rx_recv_tap().
Ilya Maximets [Wed, 25 Nov 2015 08:23:50 +0000 (11:23 +0300)]
netdev-linux: Remove unreachable code in netdev_linux_rx_recv_tap().

While splitting netdev_linux_rx_recv() into netdev_linux_rx_recv_sock()
and netdev_linux_rx_recv_tap() in commit
b73c85181df9 ("netdev-linux: Read packet auxdata to obtain vlan_tid")
error handling part was copied 'as is' to both functions.
But in case of netdev_linux_rx_recv_tap(), according to POSIX, the
number of bytes read shall never be greater than 'size'.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodatapath-windows: fix MIN() macro
Nithin Raju [Wed, 25 Nov 2015 20:16:30 +0000 (12:16 -0800)]
datapath-windows: fix MIN() macro

A quick implementation of MIN() didn't take into account operator
precedence as shown in the following example:

 #include <stdio.h>
 #define MYMIN(_a, _b) (_a) > (_b) ? (_b) : (_a)
 int main() {
     if (MYMIN(512, 256) < 14) {
         printf("buggy MYMIN\n");
     }
     return 0;
 }

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoAUTHORS: Add Panu Matilainen.
Ben Pfaff [Thu, 26 Nov 2015 05:52:57 +0000 (21:52 -0800)]
AUTHORS: Add Panu Matilainen.

Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agorpms: %exclude has side-effects, remove the files from buildroot instead
Panu Matilainen [Wed, 25 Nov 2015 14:04:41 +0000 (16:04 +0200)]
rpms: %exclude has side-effects, remove the files from buildroot instead

Due to the way debuginfo package creation is done in existing rpm
versions, its better to physically remove any non-packaged files
from the buildroot, using %exclude for the purposes causes artifacts
like broken symlinks  in the -debuginfo packages.

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1281913
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoconntrack: Add support for NAT.
Jarno Rajahalme [Tue, 24 Nov 2015 23:47:56 +0000 (15:47 -0800)]
conntrack: Add support for NAT.

Extend OVS conntrack interface to cover NAT.  New nested NAT action
may be included with a CT action.  A bare NAT action only mangles
existing connections.  If a NAT action with src or dst range attribute
is included, new (non-committed) connections are mangled according to
the NAT attributes.

This work extends on a branch by Thomas Graf at
https://github.com/tgraf/ovs/tree/nat.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agosystem-tests: Add IPv6 FTP system test.
Jarno Rajahalme [Thu, 26 Nov 2015 00:04:59 +0000 (16:04 -0800)]
system-tests: Add IPv6 FTP system test.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
8 years agosystem-tests: Workaround for pyftpdlib bug handling IPv6 addresses.
Jarno Rajahalme [Wed, 25 Nov 2015 23:19:38 +0000 (15:19 -0800)]
system-tests: Workaround for pyftpdlib bug handling IPv6 addresses.

Hack around a bug in pyftpdlib that rejects EPRT connection due to
mismatching textual representation of the IPv6 address when the
address is not in the normalized format.  This happens when the
control connection is mangled by Linux NAT.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
8 years agopackets: Reorder CS_* flags to remove gap.
Jarno Rajahalme [Wed, 25 Nov 2015 23:19:37 +0000 (15:19 -0800)]
packets: Reorder CS_* flags to remove gap.

This changes the conntrack state flags used in the OpenFlow interface
to match the ones we currently use in the datapath.  While these do
not need to be synced, it is nice to get rid of the gap.

This should be merged before the first OVS release with connection
tracking, or not at all.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Enable in-place modification for recirc actions.
Jarno Rajahalme [Wed, 25 Nov 2015 23:19:37 +0000 (15:19 -0800)]
ofproto: Enable in-place modification for recirc actions.

When modifying an existing datapath flow with recirculation actions,
the references to old (if any) recirculation actions need to be freed,
and references to new recirculation actions need to be stored.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Allow xlate_actions() to fail.
Jarno Rajahalme [Wed, 25 Nov 2015 23:19:37 +0000 (15:19 -0800)]
ofproto: Allow xlate_actions() to fail.

Sometimes xlate_actions() fails due to too deep recursion, too many
MPLS labels, or missing recirculation context.  Make xlate_actions()
clear out the produced odp actions in these cases to make it easy for
the caller to install a drop flow (instead or installing a flow with
partially translated actions).  Also, return a specific error code, so
that the error can be properly propagated where meaningful.

There are may cases in which the NORMAL action decides to drop the
packet.  Most of these are not, however, traslation errors, but just
reactions to malformed input. In these cases it is correct to make the
NORMAL action do nothing, but allow other actions in the pipeline (if
any) to take effect.

Before this patch it was possible that the revalidation installed a
flow with a recirculation ID with an invalid recirc ID (== 0), due to
the introduction of in-place modification in commit 43b2f131a229
(ofproto: Allow in-place modifications of datapath flows).

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
8 years agodatapath-windows: Fix HvUpdateNic() to handle name changes
Nithin Raju [Wed, 25 Nov 2015 20:00:58 +0000 (12:00 -0800)]
datapath-windows: Fix HvUpdateNic() to handle name changes

If the name of an internal or external NIC changes, we need to
disconnect the NIC from OVS since the name is the key. In this
change, we generate a link down event. It is as though we got a
call to HvDisconnectNic() for the old name and got a HvConnectNic()
for the new name.

Also, HvCreateNic() has been cleaned up to remove the code to look
for existing vport. We won't have a vport now since we'd have deleted
the vport in HvDeleteNic().

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: cleanup AssignNicNameSpecial()
Nithin Raju [Wed, 25 Nov 2015 20:00:57 +0000 (12:00 -0800)]
datapath-windows: cleanup AssignNicNameSpecial()

AssignNicNameSpecial() needed to be called outside of a lock and was
moved out in a previous change. But, it was accessing vport structure
outside of the lock which isn't safe. In this change, we take care of
that.

I tried to trigger a call to HvUpdateNic() by renaming the interface
from the GUI and didn't see any callback. Other changes are tested.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: nuke port # argument in IP helper
Nithin Raju [Wed, 25 Nov 2015 20:00:56 +0000 (12:00 -0800)]
datapath-windows: nuke port # argument in IP helper

Port # doesn't make much sense since it has not been computed yet.

Also, get rid of OVS_DEFAULT_PORT_NO and use OVS_DPPORT_NUMBER_INVALID
instead.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: cleanup events code
Nithin Raju [Wed, 25 Nov 2015 20:00:55 +0000 (12:00 -0800)]
datapath-windows: cleanup events code

Turns out that we don't need to generate an event is practically
useful only in case of a port disconnect to let userspace know.
Hence, this event is being posted from HvDisconnectNic().

In case of a new port appearing, it seems that userspace is not
interested in a new port unless it was added by userspace itself.
In my tests, userspce would end up deleting the port when it got
a new port notification, despite the port existing in OVSDB.

The reasoning seems simple enough:
- On Linux, OVS is integrated with the hypervisor (libvirt for eg)
and a port (ie. netdev) gets created in the Linux kernel and then
get added to OVSDB. When vswitchd picks up the port addition in OVSDB,
it adds the port in the OVS kernel DP.
- If the kernel netdev does not exist while OVS userspace tries to
create the port in OVS kernel DP, port addition fails. Moreover, the
only way to re-add the port is to trigger userspace to re-add the port
by deleting the port in OVSDB and re-adding it.

With this patch, I have verified that if a VIF gets disconnected on the
Hyper-V switch, it disappears from the OVS kernel DP as well.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: cleanup InitHvVportCommon()
Nithin Raju [Wed, 25 Nov 2015 20:00:54 +0000 (12:00 -0800)]
datapath-windows: cleanup InitHvVportCommon()

The workflow being implemented is that, we need to assign a special
name to the internal and external NICs, and it it not necessary to do
that from InitHvVportCommon(). The purpose of InitHvVportCommon() is to
insert the vport into the hash tables and update the switch context.

We special case the name assignment in HvCreateNIC() for
internal and external NICs. That seems more meaningful.

Also, reused HvCreatePort() to allocate a Vport for each of the external
NICs with NicIndex != 0. Due to this HvCreatePort() now takes 'nicIndex'
as an additional parameter.

Renamed InitHvVportCommon() to UpdateSwitchCtxWithVport().

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agodatapath-windows: refactor port enumeration code
Nithin Raju [Wed, 25 Nov 2015 20:00:53 +0000 (12:00 -0800)]
datapath-windows: refactor port enumeration code

We already have functions HvCreatePort() and HvCreateNic() to
do the work. Might as well use that during port enumeration.
More refactoring in later patches.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agoAUTHORS: Update email address.
Gurucharan Shetty [Wed, 25 Nov 2015 21:53:40 +0000 (13:53 -0800)]
AUTHORS: Update email address.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agoAUTHORS: Update email address.
Jesse Gross [Mon, 23 Nov 2015 19:06:14 +0000 (11:06 -0800)]
AUTHORS: Update email address.

Signed-off-by: Jesse Gross <jesse@kernel.org>
8 years agoofproto: Correctly reject duplicate bucket ID for OFPGC_INSERT_BUCKET.
Ben Pfaff [Wed, 25 Nov 2015 16:15:04 +0000 (08:15 -0800)]
ofproto: Correctly reject duplicate bucket ID for OFPGC_INSERT_BUCKET.

Otherwise duplicate bucket IDs cause linked list loops and other nastiness
because the ofputil_bucket_find() in the OFPG15_BUCKET_LAST case later in
copy_buckets_for_insert_bucket() will find the new bucket instead of the
old one and the list_splice() call becomes nonsensical.

Reported-by: Ray Li <rayli1107@gmail.com>
Reported-at: http://openvswitch.org/pipermail/discuss/2015-September/018731.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
8 years agodatapath-windows: Support for OVS_KEY_ATTR_SCTP attribute
Sorin Vinturis [Wed, 11 Nov 2015 20:11:16 +0000 (20:11 +0000)]
datapath-windows: Support for OVS_KEY_ATTR_SCTP attribute

This patch adds OVS_KEY_ATTR_SCTP to the OVS flow mechanism.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agostream-ssl: Replace client CA list instead of adding to it.
Liuyongqiang (A) [Mon, 9 Nov 2015 02:37:40 +0000 (02:37 +0000)]
stream-ssl: Replace client CA list instead of adding to it.

SSL_CTX_add_client_CA() appends to the client CA list without replacing any
already on the list, and furthermore wastes memory if the certificate in
the file is already on the list.  This commit thus fixes an effective
memory leak.

Signed-off-by: YongQiangLiu <liu.liuyongqiang@huawei.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agosystem-traffic: Add internal port conntrack tests.
Joe Stringer [Sat, 7 Nov 2015 20:00:00 +0000 (12:00 -0800)]
system-traffic: Add internal port conntrack tests.

Add an additional test that ensures that when receiving packets from
internal ports that reside in a foreign namespace, the conntrack
information is not populated in the flow.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agosystem-traffic: Remove netcat from ICMP test.
Joe Stringer [Sat, 7 Nov 2015 19:59:58 +0000 (11:59 -0800)]
system-traffic: Remove netcat from ICMP test.

Netcat is different on each platform I tried (Debian, Ubuntu, RHEL),
so rather than handling version differences it's better to just do the
same test with some hardcoded packets.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agosystem-tests: Use '--bundle'
Jarno Rajahalme [Tue, 24 Nov 2015 21:33:22 +0000 (13:33 -0800)]
system-tests: Use '--bundle'

Use OpenFlow bundles for setting up flow tables.  This has the benefit
that when debugging test failures, no packet gets processed by
partially set-up flow table, which may seem confusing.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agosystem-tests: Make bridge creation more consistent.
Jarno Rajahalme [Tue, 24 Nov 2015 21:33:22 +0000 (13:33 -0800)]
system-tests: Make bridge creation more consistent.

Create all bridges with the same set of supported OpenFlow protocols
and fail-safe-mode secure, so that each test explicitly specifies flow
handling.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agonx-match: Add nxm_put_128m() function.
Justin Pettit [Sat, 31 Oct 2015 11:28:00 +0000 (04:28 -0700)]
nx-match: Add nxm_put_128m() function.

This allows us to remove nxm_put_ct_label() with something more general.
It will also have other callers later.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agobyte-order: Make hton128() and ntoh128() behave like their counterparts.
Justin Pettit [Sat, 31 Oct 2015 10:12:38 +0000 (03:12 -0700)]
byte-order: Make hton128() and ntoh128() behave like their counterparts.

Instead of taking the source and destination as arguments, make these
functions act like their short and long counterparts.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-router: Use standard libraries in scan_ipv6_route().
Justin Pettit [Tue, 10 Nov 2015 23:45:03 +0000 (15:45 -0800)]
ovs-router: Use standard libraries in scan_ipv6_route().

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agometa-flow: Use standard libraries in mf_from_ipv6_string().
Justin Pettit [Tue, 10 Nov 2015 23:08:43 +0000 (15:08 -0800)]
meta-flow: Use standard libraries in mf_from_ipv6_string().

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agopackets: Add ipv6_parse_masked() function.
Justin Pettit [Sun, 25 Oct 2015 21:59:26 +0000 (14:59 -0700)]
packets: Add ipv6_parse_masked() function.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agopackets: Change IPv6 functions to more closely resemble IPv4 ones.
Justin Pettit [Sun, 25 Oct 2015 20:19:22 +0000 (13:19 -0700)]
packets: Change IPv6 functions to more closely resemble IPv4 ones.

Signed-off-by: Justin Petitt <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoopenflow: Remove OFPG11_*
Jarno Rajahalme [Tue, 24 Nov 2015 18:01:23 +0000 (10:01 -0800)]
openflow: Remove OFPG11_*

Protocol-independent symbols OFPG_* were already defined in
openflow-common.h, so remove the protocol version dependent symbols.

Found by inspection.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn-northd.8: Correct syntax for OVN strings.
Ben Pfaff [Mon, 23 Nov 2015 17:37:19 +0000 (09:37 -0800)]
ovn-northd.8: Correct syntax for OVN strings.

Backslashes are necessary if you put OVN syntax inside a quoted string, but
it's not part of the syntax itself and might confuse readers.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agodatapath: Fix vxlan udp csum of gso packet
Zang MingJie [Mon, 23 Nov 2015 19:18:11 +0000 (11:18 -0800)]
datapath: Fix vxlan udp csum of gso packet

Signed-off-by: Zang MingJie <zealot0630@gmail.com>
Signed-off-by: Jesse Gross <jesse@kernel.org>
8 years agocompat: Explicitly include net/ip.h in net/udp.h.
Joe Stringer [Wed, 11 Nov 2015 21:25:44 +0000 (13:25 -0800)]
compat: Explicitly include net/ip.h in net/udp.h.

The inet_get_local_port_range() function is defined as a 3-parameter
version in the backported net/ip.h, however some versions of RHEL7
kernel use the 2-parameter version in their net/udp.h header. We need to
make sure that our net/ip.h is first included, then undef our overriding
3-parameter version, include the system net/udp.h, then redefine our
overriding 3-parameter version so that it may be used inside OVS code.

This header needs to include net/ip.h here as some files may not include
it prior to net/udp.h, in which case the logic we have to define the
right version while including the system net/udp.h will not work.

Specifically this fixes issues on kernel 3.10.0-229.7.2.el7.x86_64
(perhaps earlier as well; some later versions make this unnecessary).

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
8 years agoovn: Update BFD item in the ovn TODO list.
Russell Bryant [Mon, 23 Nov 2015 16:23:02 +0000 (11:23 -0500)]
ovn: Update BFD item in the ovn TODO list.

Update the BFD todo item to clarify where we might use BFD as it
previously seemed to imply we wanted to enable it for all
hypervisor-to-hypervisor tunnels.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-By: Kyle Mestery <mestery@mestery.com
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoPrevent test failures when there are non Ethernet devices on the system.
Thadeu Lima de Souza Cascardo [Wed, 18 Nov 2015 18:38:28 +0000 (16:38 -0200)]
Prevent test failures when there are non Ethernet devices on the system.

When there are PtP TUN devices on the system or SIT devices, tests will fail
because of a warning that it was not possible to get their Ethernet addresses.
That call comes from the route code adding tunnel ports.

Make that warning an informational message and filter that out during tests.

Also, return EINVAL when trying to get those interface Ethernet addresses, which
will prevent them from being added to the tunnel ports pool and will properly
fail in other places as well.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoxenserver: Add ovsdb_port variable to xapi configuration update plugin.
Sten Spans [Thu, 22 Oct 2015 06:53:18 +0000 (08:53 +0200)]
xenserver: Add ovsdb_port variable to xapi configuration update plugin.

The hardcoded ovsdb port causes problems when hooking up xenserver to
different SDN stacks.  Changing this to a variable at the start of the
script makes it easier to update this when needed (using chef/puppet/etc)

Signed-off-by: Sten Spans <sten@blinkenlights.nl>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb-idl: Add support for change tracking.
Shad Ansari [Tue, 27 Oct 2015 20:55:35 +0000 (13:55 -0700)]
ovsdb-idl: Add support for change tracking.

Ovsdb-idl notifies a client that something changed; it does not track
which table, row changed in what way (insert, modify or delete).
As a result, a client has to scan or reconfigure the entire idl after
ovsdb_idl_run(). This is presumably fine for typical ovs schemas where
tables are relatively small. In use-cases where ovsdb is used with
schemas that can have very large tables, the current ovsdb-idl
notification mechanism does not appear to scale - clients need to do a
lot of processing to determine the exact change delta.

This change adds support for:
 - Table and row based change sequence numbers to record the
   most recent IDL change sequence numbers associated with insert,
   modify or delete update on that table or row.
 - Change tracking of specific columns. This ensures that changed
   rows (inserted, modified, deleted) that have tracked columns, are
   tracked by IDL. The client can directly access the changed rows
   with get_first, get_next operations without the need to scan the
   entire table.
   The tracking functionality is not enabled by default and needs to
   be turned on per-column by the client after ovsdb_idl_create()
   and before ovsdb_idl_run().

     /* Example Usage */

     idl = ovsdb_idl_create(...);

     /* Track specific columns */
     ovsdb_idl_track_add_column(idl, column);
     /* Or, track all columns */
     ovsdb_idl_track_add_all(idl);

     for (;;) {
         ovsdb_idl_run(idl);
         seqno = ovsdb_idl_get_seqno(idl);

         /* Process only the changed rows in Table FOO */
         FOO_FOR_EACH_TRACKED(row, idl) {
             /* Determine the type of change from the row seqnos */
             if (foo_row_get_seqno(row, OVSDB_IDL_CHANGE_DELETE)
                    >= seqno)) {
                 printf("row deleted\n");
             } else if (foo_row_get_seqno(row, OVSDB_IDL_CHANGE_MODIFY)
                           >= seqno))
                 printf("row modified\n");
             } else if (foo_row_get_seqno(row, OVSDB_IDL_CHANGE_INSERT)
                           >= seqno))
                 printf("row inserted\n");
             }
         }

         /* All changes processed - clear the change track */
         ovsdb_idl_track_clear(idl);
    }

Signed-off-by: Shad Ansari <shad.ansari@hp.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb-idl: Support for readonly columns that are fetched on-demand
Shad Ansari [Thu, 22 Oct 2015 21:35:24 +0000 (14:35 -0700)]
ovsdb-idl: Support for readonly columns that are fetched on-demand

There is currently no mechanism in IDL to fetch specific column values
on-demand without having to register them for monitoring. In the case
where the column represent a frequently changing entity (e.g. counter),
and the reads are relatively infrequent (e.g. CLI client), there is a
significant overhead in replication.

This patch adds support in the Python IDL to register a subset of the
columns of a table as "readonly". Readonly columns are not replicated.
Users may "fetch" the readonly columns of a row on-demand. Once fetched,
the columns are not updated until the next fetch by the user. Writes by
the user to readonly columns does not change the value (both locally or
on the server).

The two main user visible changes in this patch are:
  - The SchemaHelper.register_columns() method now takes an optionaly
    argument to specify the subset of readonly column(s)
  - A new Row.fetch(columns) method to fetch values of readonly columns(s)

Usage:
------

    # Schema file includes all columns, including readonly
    schema_helper = ovs.db.idl.SchemaHelper(schema_file)

    # Register interest in columns with 'r' and 's' as readonly
    schema_helper.register_columns("simple", [i, r, s], [r, s])

    # Create Idl and jsonrpc, and wait for update, as usual
    ...

    # Fetch value of column 'r' for a specific row
    row.fetch('r')
    txn.commit_block()

    print row.r
    print getattr(row, 'r')

    # Writing to readonly column has no effect (locally or on server)
    row.r = 3
    print row.r     # prints fetched value not 3

Signed-off-by: Shad Ansari <shad.ansari@hp.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto: Check actions also for packet outs and traces.
Jarno Rajahalme [Fri, 20 Nov 2015 02:20:39 +0000 (18:20 -0800)]
ofproto: Check actions also for packet outs and traces.

Make the packet out and trace processing perform the same actions
checks as flow mod processing does.

This used to be the case before, but at some point these have diverged
to perform different combinations of checks.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoutilities/ovs-ofctl: Fix meter requests.
Jarno Rajahalme [Fri, 20 Nov 2015 02:20:39 +0000 (18:20 -0800)]
utilities/ovs-ofctl: Fix meter requests.

Meter requests should use dump/stats transaction, instead of
transact_noreply, which caused the output to go to stderr and an error
exit.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
8 years agoAUTHORS: Update email address.
Joe Stringer [Fri, 20 Nov 2015 00:38:14 +0000 (16:38 -0800)]
AUTHORS: Update email address.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoAUTHORS: Update Andy Zhou's email address.
Andy Zhou [Thu, 19 Nov 2015 21:24:35 +0000 (13:24 -0800)]
AUTHORS: Update Andy Zhou's email address.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agoAUTHORS: Update email address.
Jarno Rajahalme [Thu, 19 Nov 2015 22:18:41 +0000 (14:18 -0800)]
AUTHORS: Update email address.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoHW VTEP Schema: update Tunnel table definition
Ariel Tubaltsev [Sat, 14 Nov 2015 01:01:11 +0000 (17:01 -0800)]
HW VTEP Schema: update Tunnel table definition

vtep/vtep.xml : Tunnel table definitions were reviewed against
latest OVS schema.
Relevant changes taken into HW VTEP schema.
XML formatting of Tunnel table corrected

Signed-off-by: Ariel Tubaltsev <tubaltzev@gmail.com>
Acked-by: Bruce Davie <bdavie@vmware.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agonetdev-dpdk: assume dpdkr peer can be multi-producer/consumer
Mauricio Vasquez B [Mon, 16 Nov 2015 22:24:47 +0000 (23:24 +0100)]
netdev-dpdk: assume dpdkr peer can be multi-producer/consumer

Although netdev does explicit locking, it is only valid from the ovs
perspective, then only the ring ends used by ovs should be declared as
single producer/consumer.
The other ends that are used by the application should be declared as
multiple producer/consumer that is the most general case.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agovlog: Fix a deadlock bug.
Andy Zhou [Sat, 14 Nov 2015 02:39:37 +0000 (18:39 -0800)]
vlog: Fix a deadlock bug.

Calling VLOG_FATAL() while holding the 'log_file_mutex" may lead to
deadlock since VLOG_FATAL() implementation tries to acquire the
same lock. Fix this by building the error message first, then
call VLOG_FATAL() after the 'log_file_mutex' has been released.

This bug is not likely show up in practice since chown() usually
won't fail. It is still better to have a correct implementation.

Reported-by: Daniele Di Proietto <ddiproietto@vmware.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Daniele Di Proietto <ddiproietto@vmware.com>
8 years agoMerge pull request #89 from zhouyaguo/master
Justin Pettit [Wed, 18 Nov 2015 23:29:27 +0000 (15:29 -0800)]
Merge pull request #89 from zhouyaguo/master

FAQ.md: Fix typo

8 years agoFAQ.md: Fix typo
Yaguo Zhou [Wed, 18 Nov 2015 15:16:31 +0000 (23:16 +0800)]
FAQ.md: Fix typo

typo in FAQ.md: ovs-vcstl

Signed-off-by: Yaguo Zhou <zhouyaguo@unionpay.com>
8 years agoAdd Docker integration for OVN.
Gurucharan Shetty [Mon, 19 Oct 2015 15:18:25 +0000 (08:18 -0700)]
Add Docker integration for OVN.

Docker multi-host networking is now part of
Docker 1.9.

This commit adds two drivers for OVN integration
with Docker. The first driver is a pure overlay driver
that does not need OpenStack integration. The second driver
needs OVN+OpenStack.

The description of the Docker API exists here:
https://github.com/docker/libnetwork/blob/master/docs/remote.md

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agovlog: fix clang warnings
Andy Zhou [Thu, 12 Nov 2015 22:32:49 +0000 (14:32 -0800)]
vlog: fix clang warnings

Make sure clang does not complain about accessing ovs_log_file
outside of log_file_mutex protection.

Signed-off-by: Andy Zhou <azhou@nicira.com>
8 years agoovn-tutorial: Use github instead of relative links.
Russell Bryant [Thu, 12 Nov 2015 19:06:39 +0000 (14:06 -0500)]
ovn-tutorial: Use github instead of relative links.

All of these links when viewing OVN-Tutorial on github, but most of
these links didn't work when viewing OVN-Tutorial.md.html in dist-docs.
Use full github links so that they always work (as long as you have
internet access).

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-By: Kyle Mestery <mestery@mestery.com>