]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
7 years agotypes: New struct eth_addr64 for EUI-64 identifiers.
Ben Pfaff [Thu, 6 Apr 2017 05:56:17 +0000 (22:56 -0700)]
types: New struct eth_addr64 for EUI-64 identifiers.

This will see its first real user in the following commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agom4: fix use of log fd vs. file in "configure"
Lance Richardson [Fri, 7 Apr 2017 21:05:06 +0000 (17:05 -0400)]
m4: fix use of log fd vs. file in "configure"

Recent Travis builds are failing when making the distcleancheck
target with:
     ERROR: files left in build directory after distclean:
     ./5

Fix by treating log fd as a file descriptor instead of a file.

Fixes: 7777d53d2f4b ("m4: Add hard requirements for python in "configure"")
Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovs-ctl: Expose openvswitch run directory through ovsdb.
Robert Wojciechowicz [Thu, 9 Mar 2017 13:59:51 +0000 (13:59 +0000)]
ovs-ctl: Expose openvswitch run directory through ovsdb.

When using vhost-user client or server mode with OpenStack, Neutron needs
to be able to construct the fully qualified socket path and pass it to
Nova.  While the relative vhost-user socket directory is exposed via the
Open_vSwitch table in other_config:vhost-sock-dir, the openvswitch run
directory that it is relative to is not.  This patch adds it to the
Open_vSwitch table as external_ids:rundir.

Signed-off-by: Robert Wojciechowicz <robertx.wojciechowicz@intel.com>
Acked-by: Sean K Mooney <sean.k.mooney@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Update makefile target for docs
Stephen Finucane [Thu, 6 Apr 2017 13:58:03 +0000 (14:58 +0100)]
doc: Update makefile target for docs

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Describe how docs.openvswitch.org works
Stephen Finucane [Thu, 6 Apr 2017 13:58:02 +0000 (14:58 +0100)]
doc: Describe how docs.openvswitch.org works

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agom4: Add hard requirements for python in "configure"
Timothy Redaelli [Wed, 29 Mar 2017 11:49:42 +0000 (13:49 +0200)]
m4: Add hard requirements for python in "configure"

Since Python 2.7 and python-six are needed to build Open vSwitch,
./configure should return an error if they are missing or if they are too old

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Timothy Redaelli <tredaelli@redhat.com>
Tested-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-April/330565.html

7 years agoAUTHORS: Add wenxu.
Ben Pfaff [Fri, 7 Apr 2017 00:30:51 +0000 (17:30 -0700)]
AUTHORS: Add wenxu.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agobundle: add nw_src/dst hash method
wenxu [Thu, 9 Mar 2017 04:01:02 +0000 (12:01 +0800)]
bundle: add nw_src/dst hash method

Add only nw_src or nw_dst hash feature to bundle and multipath.

Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: enable ssl config via local ovsdb
Lance Richardson [Thu, 6 Apr 2017 16:49:13 +0000 (12:49 -0400)]
ovn-controller: enable ssl config via local ovsdb

Allow ovn-controller to use SSL certificate and key configuration
from local ovsdb. With this change, SSL configuration from the
vswitchd database will be used if present, otherwise configuration
can still be specified from the command line.

If SSL configuration is present in both locations, the configuration
in the local ovsdb has precedence. This is consistent with how
vswitchd is currently implemented.

The existing ovs-vsctl get-ssl/set-ssl/del-ssl commands can be used
to manage the configuration in the vswitchd database.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoroute-table: Fix compatibility with pre-2.6.36 headers.
Ben Pfaff [Fri, 17 Mar 2017 21:21:46 +0000 (14:21 -0700)]
route-table: Fix compatibility with pre-2.6.36 headers.

Reported-by: Timothy Redaelli <tredaelli@redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/329604.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agocheck-structs: struct eth_addr has alignment 2, not 1.
Ben Pfaff [Thu, 6 Apr 2017 05:55:03 +0000 (22:55 -0700)]
check-structs: struct eth_addr has alignment 2, not 1.

It consists of ovs_be16 elements, so it has 16-bit alignment.

(This doesn't make a difference for any actual OpenFlow protocol elements.)

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoutil: New macro ovs_strlcpy_arrays().
Ben Pfaff [Thu, 6 Apr 2017 05:49:27 +0000 (22:49 -0700)]
util: New macro ovs_strlcpy_arrays().

When both arguments to ovs_strlcpy() are character arrays, it makes sense
to just pass the smaller of their sizes as the overall size.  It's
somewhat error-prone and definitely redundant to write that by hand, so
this commit adds a new macro that does it automatically.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoovn-nbctl: include table formatting options in man page
Lance Richardson [Tue, 4 Apr 2017 13:44:51 +0000 (09:44 -0400)]
ovn-nbctl: include table formatting options in man page

Include descriptions of table formatting optiosn in ovn-nbctl
man page.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotable: add xml version of lib/table.man
Lance Richardson [Tue, 4 Apr 2017 13:44:45 +0000 (09:44 -0400)]
table: add xml version of lib/table.man

Add lib/table.xml, translated from lib/table.man for inclusion
in XML man pages (such as ovn-nbctl.8.xml).

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovsdb-client: improve formatting option description in man page
Lance Richardson [Tue, 4 Apr 2017 13:44:39 +0000 (09:44 -0400)]
ovsdb-client: improve formatting option description in man page

Use correct option name for "--no-headings", remove duplicate
"--no-heading" option in synopsis.

Clarify description of "--data=json" option.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotable: provide table formatting option help at runtime
Lance Richardson [Fri, 31 Mar 2017 17:21:03 +0000 (13:21 -0400)]
table: provide table formatting option help at runtime

Show table formatting options with help output from
ovn-nbctl, obn-sbctl, ovs-vsctl, and vtep-ctl commands.
Include "--data" option in ovsdb-client help output.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-nbctl: include db connection options in help
Lance Richardson [Tue, 28 Mar 2017 15:22:33 +0000 (11:22 -0400)]
ovn-nbctl: include db connection options in help

Include db connection options in help text.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agolib: Fix typos in db-ctl-base.{man,xml}
Timothy Redaelli [Mon, 3 Apr 2017 10:17:36 +0000 (12:17 +0200)]
lib: Fix typos in db-ctl-base.{man,xml}

s/exmaple/example/

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoDocumentation: Add a new topic document about ofproto/trace
Timothy Redaelli [Wed, 5 Apr 2017 11:10:47 +0000 (13:10 +0200)]
Documentation: Add a new topic document about ofproto/trace

Add a new document "Tracing packets inside Open vSwitch" that explains
how to use "ofproto/trace" to debug flows inside the vswitch.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto: Use macros to define DPIF support fields
Andy Zhou [Thu, 16 Mar 2017 01:39:57 +0000 (18:39 -0700)]
ofproto: Use macros to define DPIF support fields

When adding a new field in the 'struct dpif_backer_support', the
corresponding appctl show command should be updated to display
the new field. Currently, there is nothing to remind the developer
that to update the show command. This can lead to code maintenance
issues.

Switch to use macros to define those fields. This makes the show
command update automatic.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agoofproto-dpif-mirror: Fix issue of reseting snaplen in mirroring
Zhenyu Gao [Mon, 27 Mar 2017 03:16:11 +0000 (20:16 -0700)]
ofproto-dpif-mirror: Fix issue of reseting snaplen in mirroring

Currently, the mirror code doesn't check new value of snaplen when try
to reconfigure snaplen.
This patch fix this issue and add testings to reconfigure snaplen.

Signed-off-by: Zhenyu Gao <sysugaozhenyu@gmail.com>
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoovn: Gratuitous ARP for distributed NAT rules
Mickey Spiegel [Thu, 30 Mar 2017 18:42:22 +0000 (11:42 -0700)]
ovn: Gratuitous ARP for distributed NAT rules

This patch extends gratuitous ARP support for NAT addresses so that it
applies to distributed NAT rules on a distributed logical router.
Distributed NAT rules have type "dnat_and_snat" and specify
'external_mac' and 'logical_port'.

Gratuitous ARP packets for distributed NAT rules are only generated on
the chassis where the 'logical_port' specified in the NAT rule resides.
Gratuitous ARPs are issued for the 'external_ip' address, resolving to
the 'external_mac'.

Since the MAC address varies for each distributed NAT rule, a separate
'nat_addresses' string must be generated for each distributed NAT rule.
For this reason, in the southbound 'Port_Binding',
'options:nat-addresses' is replaced by a 'nat_addresses' column that
can have an unlimited number of instances.  In order to allow for
upgrades, pinctrl in the ovn-controller can work off either the
'nat_addresses' column (if present), or 'options:nat-addresses'
otherwise.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: Gratuitous ARP for centralized NAT rules on a distributed router
Mickey Spiegel [Thu, 30 Mar 2017 18:42:21 +0000 (11:42 -0700)]
ovn: Gratuitous ARP for centralized NAT rules on a distributed router

This patch extends gratuitous ARP support for NAT addresses so that it
applies to centralized NAT rules on a distributed router, in addition to
the existing gratuitous ARP support for NAT addresses on gateway routers.
Centralized NAT rules have type other than "dnat_and_snat", or have type
"dnat_and_snat" but do not specify external_mac or logical_port.  These
NAT rules apply on the redirect-chassis.

Gratuitous ARP packets for centralized NAT rules on a distributed router
are only generated on the redirect-chassis.  This is achieved by extending
the syntax for "options:nat-addresses" in the southbound database,
allowing the condition 'is_chassis_resident("LPORT_NAME")' to be appended
after the MAC and IP addresses.  This condition is automatically inserted
by ovn-northd when the northbound "options:nat-addresses" is set to
"router" and the peer is a distributed gateway port.

A separate patch will be required to support gratuitous ARP for
distributed NAT rules that specify logical_port and external_mac.  Since
the MAC address differs and the logical port often resides on a different
chassis from the redirect-chassis, these addresses cannot be included in
the same "nat-addresses" string as for centralized NAT rules.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovs-ofctl: Document reset_counts, no_packet_counts, no_byte_counts.
Ben Pfaff [Thu, 30 Mar 2017 15:55:19 +0000 (08:55 -0700)]
ovs-ofctl: Document reset_counts, no_packet_counts, no_byte_counts.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agofaq: Expand on answer about packet buffering removal.
Ben Pfaff [Wed, 29 Mar 2017 18:25:38 +0000 (11:25 -0700)]
faq: Expand on answer about packet buffering removal.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoMakefile: Fix name of coding style guide.
Ben Pfaff [Wed, 29 Mar 2017 19:43:11 +0000 (12:43 -0700)]
Makefile: Fix name of coding style guide.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agoovsdb-server: Drop unnecessary find_db() function.
Ben Pfaff [Mon, 20 Mar 2017 17:56:22 +0000 (10:56 -0700)]
ovsdb-server: Drop unnecessary find_db() function.

'all_dbs' maps from a schema name to its struct db, so there's no need to
iterate the whole thing to find a database by schema name; instead, just
use the shash in the usual way.

Also, a few related but simpler changes elsewhere.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>>
7 years agoovsdb-server: Fix memory leak in update_remote_status() error path.
Ben Pfaff [Sun, 19 Mar 2017 17:22:05 +0000 (10:22 -0700)]
ovsdb-server: Fix memory leak in update_remote_status() error path.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoFix broken link in installation instructions.
Ben Pfaff [Wed, 29 Mar 2017 18:18:56 +0000 (11:18 -0700)]
Fix broken link in installation instructions.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Fixes: 8e3fd39f1edb ("doc: Minor improvements to install instructions.")
7 years agoofproto-dpif-xlate: Don't save pkt_mark in compose_output_action__().
Ben Pfaff [Fri, 17 Mar 2017 17:55:03 +0000 (10:55 -0700)]
ofproto-dpif-xlate: Don't save pkt_mark in compose_output_action__().

Previously, this function could modify the pkt_mark field as part of IPsec
integration.  It no longer does that, so there's no longer any need for it
to save and restore pkt_mark, and this commit removes that.

CC: Ansis Atteka <aatteka@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agodoc: Minor improvements to install instructions.
Ben Pfaff [Fri, 17 Mar 2017 21:40:08 +0000 (14:40 -0700)]
doc: Minor improvements to install instructions.

Clang 3.4 and later should now be widespread, so it's not worth suggesting
where to find it.

OVS needs a variety of shared libraries at runtime and it's not worth
mentioning each one by name.

The Linux kernel datapath module is available from a variety of places, so
don't say you have to use the one you built.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoDocument how to get Open vSwitch source code.
Ben Pfaff [Wed, 29 Mar 2017 17:19:48 +0000 (10:19 -0700)]
Document how to get Open vSwitch source code.

Suggested-by: "Nadathur, Sundar" <sundar.nadathur@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
7 years agoDocumentation: fix typo in documentation-style.rst
Timothy Redaelli [Wed, 29 Mar 2017 14:15:52 +0000 (16:15 +0200)]
Documentation: fix typo in documentation-style.rst

s/indenation/indentation/

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: Fix options:router-port in Gratuitous ARP tests
Mickey Spiegel [Tue, 28 Mar 2017 01:34:03 +0000 (18:34 -0700)]
ovn: Fix options:router-port in Gratuitous ARP tests

In two of the Gratuitous ARP tests, "options:router-port"
is not set correctly.  This does not currently affect
validity of the tests since the next line resets
"options:router-port" to the correct value.

Reported-by: Guruchuran Shetty <guru@ovn.org>
Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoconntrack: Add formatting support for IGMP, DCCP, and UDPLITE.
Jarno Rajahalme [Wed, 29 Mar 2017 00:17:36 +0000 (17:17 -0700)]
conntrack: Add formatting support for IGMP, DCCP, and UDPLITE.

Print names for protocols that are supported by (Linux) conntrack
(DCCP, UDPLITE) and IGMP, which has been seen in logs.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agonetlink-conntrack: Change unsupported IPPROTO log to debug.
Jarno Rajahalme [Wed, 29 Mar 2017 00:17:36 +0000 (17:17 -0700)]
netlink-conntrack: Change unsupported IPPROTO log to debug.

No point littering the logs with messages on an unsupported protocol,
so change the log to debug level.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agosystem-traffic: 802.1ad: Add dot1q-tunnel test case.
Eric Garver [Fri, 17 Mar 2017 20:13:15 +0000 (16:13 -0400)]
system-traffic: 802.1ad: Add dot1q-tunnel test case.

Test case for dot1q-tunnel between two "customer" bridges.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agosystem-traffic: 802.1ad: Add push/pop test cases.
Eric Garver [Fri, 17 Mar 2017 20:13:14 +0000 (16:13 -0400)]
system-traffic: 802.1ad: Add push/pop test cases.

Two test cases to push and pop an outer tag between two "customer"
bridges. One to push/pop 0x88a8. One to push/pop a second 0x8100.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agosystem-traffic: 802.1ad: Add vlan_limit test case.
Eric Garver [Fri, 17 Mar 2017 20:13:13 +0000 (16:13 -0400)]
system-traffic: 802.1ad: Add vlan_limit test case.

Verify that vlan_limit works as expected and preserves legacy dl_type
matching behavior.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agosystem-traffic: 802.1ad: Add conntrack ping tests for CVLANs.
Eric Garver [Fri, 17 Mar 2017 20:13:12 +0000 (16:13 -0400)]
system-traffic: 802.1ad: Add conntrack ping tests for CVLANs.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agosystem-common-macros: Add macro to check for 802.1ad support.
Eric Garver [Fri, 17 Mar 2017 20:13:11 +0000 (16:13 -0400)]
system-common-macros: Add macro to check for 802.1ad support.

Add macro OVS_CHECK_8021AD().

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoofproto-dpif-upcall: Fix flow setup/delete race.
Joe Stringer [Mon, 20 Mar 2017 21:08:19 +0000 (14:08 -0700)]
ofproto-dpif-upcall: Fix flow setup/delete race.

If a handler thread takes a long time to set up a set of flows, it is
possible for one of the installed flows to be dumped and scheduled
for deletion by a revalidator thread before the handler is able to
transition the ukey into an operational state---Between the
dpif_operate() above this function and the ukey lock / transition logic
modified by this patch.

Only transition the ukey for the flow if it wasn't already transitioned
to a later state by a revalidator thread.

Fixes: 54ebeff4c03d ("upcall: Track ukey states.")
Reported-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
Tested-by: Paul Blakey <paulb@mellanox.com>
7 years agosandbox: use ssl for ovn-controller to sb db connection
Lance Richardson [Thu, 23 Mar 2017 16:23:33 +0000 (12:23 -0400)]
sandbox: use ssl for ovn-controller to sb db connection

When SSL support is available, use SSL for the ovn-controller
to southbound database connection. When configured without
SSL, unix socket connections are used.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agostp: Fix stp tests and make them more stable.
nickcooper-zhangtonghao [Thu, 23 Mar 2017 06:36:24 +0000 (23:36 -0700)]
stp: Fix stp tests and make them more stable.

The difference between machines may cause the test to fail.
More importantly, when topology is changed or the root brdige
receives the TCN BPDU, the root bridge will start the topology
change timer. We should wait the topology change timer to stop
after 35s (max age 20 + forward delay 15). After 35s, the root
bridge will stop send CONF BPDU with STP_CONFIG_TOPOLOGY_CHANGE
flag and the topology will be stable. During this time, we should
make time warp (in a second) because the hold timer of stp ports
will stop after 1s. Then the root bridge can send quickly topology
change ack (other bridges may send TCN BPDU to root bridge) for
avoiding root brdige to flush fdb and mdb frequently.

This patch has been tested on centos 7.2 (kernel 3.10.0, python
2.7.5 and gcc 4.8.5), ubuntu 16.04 (kernel 4.4.0, python 3.5.2
and gcc 5.4.0) and ubuntu 16.04 (kernel 4.10.4, python 3.5.2 and
gcc 5.4.0). This patch has been tested for 3 hours. This patch
may make the stp tests more stable.

[Committer notes]

Folded time/warp execution into a for loop.

Fixes: 427e9751f300 ("tests: Add and improve stp tests.")
Reported-at: http://paste.ubuntu.com/24215426
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/330032.html
Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoDocument: Fix default DB in ovn-nbctl/sbctl manpages.
Han Zhou [Mon, 27 Mar 2017 06:50:37 +0000 (23:50 -0700)]
Document: Fix default DB in ovn-nbctl/sbctl manpages.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agometa-flow: Remove metadata prerequisite on ether type.
Jarno Rajahalme [Fri, 24 Mar 2017 18:47:15 +0000 (11:47 -0700)]
meta-flow: Remove metadata prerequisite on ether type.

Conntrack original direction tuple fields depend on the conntrack
state and the type of the packet that was tracked.  These dependencies
were encoded as OpenFlow prerequisites in commit daf4d3c18da4 ("odp:
Support conntrack orig tuple key.").  However, having a prerequisite
from a metadata field to a packet header turned out to be problematic,
since sometimes we are decoding metadata fields alone, so that the
packet type field is not available.

The reason for the packet type dependency is that the IP addresses in
the original direction tuple can be either IPv4 or IPv6 addresses, and
it would be invalid to match on IPv4 original direction tuple
addresses for an IPv6 packet and vica verca.  Upon closer look,
however, allowing this kind of mismatched match only causes the flow
to never match anything, rather than causing more severe problems.

This patch removes the formal prerequisite on the packet type, but
replaces that with an explicit check for the mismatch on flow install.
This way we can still return an error to the controller if it tries to
install a mismatched flow.

Reported-by: Dong Jun <dongj@dtdream.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/330052.html
Fixes: 7befb20d0f70 ("nx-match: Fix oxm decode.")
Fixes: daf4d3c18da4 ("odp: Support conntrack orig tuple key.")
Suggested-by: Numan Siddique <nusiddiq@redhat.com>
Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto-dpif-xlate: Include controller traffic for NetFlow.
Justin Pettit [Wed, 22 Mar 2017 23:45:41 +0000 (16:45 -0700)]
ofproto-dpif-xlate: Include controller traffic for NetFlow.

The code previously did not include packets forwarded to the controller
in NetFlow, as it considered this control traffic.  That is debatable for
deployments where the first packet of every flow is sent to the
controller for a forwarding decision that may eventually be executed on
the switch.

However, we are starting to send more traffic to local controllers for
non-forwarding purposes such as logging.  These packets are already
being forwarded (and only copies are being sent to the controller), so
not accounting for them will incorrectly under-report NetFlow
statistics.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agoofproto-dpif-rid: Update comment for recirc_alloc_id__().
Justin Pettit [Wed, 22 Mar 2017 22:40:21 +0000 (15:40 -0700)]
ofproto-dpif-rid: Update comment for recirc_alloc_id__().

The hash is not recomputed if it is passed in as 0.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agoofproto-dpif: Update handle_action() comment.
Justin Pettit [Fri, 17 Feb 2017 01:11:54 +0000 (17:11 -0800)]
ofproto-dpif: Update handle_action() comment.

The comment didn't mention the SLOW_LLDP and SLOW_ACTION reasons.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agomirror: Allow concurrent lookups.
Jarno Rajahalme [Wed, 22 Feb 2017 02:17:04 +0000 (18:17 -0800)]
mirror: Allow concurrent lookups.

Handler threads use a selection of mirror functions with the
assumption that the data referred to is RCU protected, while the
implementation has not provided for this, which can lead to an OVS
crash.

This patch fixes this by making the mbundle lookup RCU-safe by using
cmap instead of hmap and postponing mbundle memory free, as wells as
postponing the frees of the mirrors and the vlan bitmaps of each
mirror.

Note that mirror stats update is still not accurate if multiple
threads do it simultaneously.

A less complete version of this patch (using cmap and RCU postpone
just for the mbridge itself) was tested by Yunjian Wang and was found
to fix the observed crash when running a script that adds and deletes
a port repeatedly.

Reported-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
7 years agodatapath-windows: Add support for OVS_CT_ATTR_FORCE_COMMIT
Sairam Venugopal [Tue, 21 Mar 2017 07:02:02 +0000 (00:02 -0700)]
datapath-windows: Add support for OVS_CT_ATTR_FORCE_COMMIT

Add support for handling OVS_CT_ATTR_FORCE_COMMIT in Conntrack action.
When this flag is specified, it implicitly means commit and deletes
entries in the reverse direction.

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 agoofproto: Clean up style in ofproto_flow_mod_learn.
Joe Stringer [Tue, 21 Mar 2017 01:09:27 +0000 (18:09 -0700)]
ofproto: Clean up style in ofproto_flow_mod_learn.

It's slightly more cognitive load to read an inverse condition and then
invert it again to understand the 'else' condition.

Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto: Log when learn limit reached.
Joe Stringer [Fri, 17 Mar 2017 18:38:34 +0000 (11:38 -0700)]
ofproto: Log when learn limit reached.

This commit provides more visibility into conditions where learn limits
are reached when the functionality from patch 4c71600d2256
("ofp-actions: Add limit to learn action.") is used.

VMWare-BZ: #1832142
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoAUTHORS: Add Khem Raj.
Ben Pfaff [Mon, 20 Mar 2017 19:45:00 +0000 (12:45 -0700)]
AUTHORS: Add Khem Raj.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotest-ovn: Use literal -1 instead of WAIT_ANY.
Khem Raj [Mon, 20 Mar 2017 19:13:30 +0000 (12:13 -0700)]
test-ovn: Use literal -1 instead of WAIT_ANY.

POSIX does not specify WAIT_ANY and at least MUSL libc does not define it.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotravis: Fix build on Travis by installing new-enough docutils.
Ben Pfaff [Mon, 20 Mar 2017 18:31:22 +0000 (11:31 -0700)]
travis: Fix build on Travis by installing new-enough docutils.

This yields a clean build:
https://travis-ci.org/blp/ovs-reviews/builds/213085784

Suggested-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Lance Richardson <lrichard@redhat.com>
7 years agostp: Add the 'ovs-appctl stp/show' command.
nickcooper-zhangtonghao [Sat, 18 Mar 2017 08:13:56 +0000 (01:13 -0700)]
stp: Add the 'ovs-appctl stp/show' command.

The stp/show command will help users and developers to
get more details about stp. This patch works together with
the previous patch "stp: Change the api for next patch."

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Co-authored-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agostp: Change the api for next patch.
nickcooper-zhangtonghao [Sat, 18 Mar 2017 08:13:55 +0000 (01:13 -0700)]
stp: Change the api for next patch.

This patch changes the stp_port_get_role and removes
the stp_port_get_id, because stp/show has locked the
mutex before calling the stp_port_get_role, and
stp_port_get_id will not be used.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoDocumentation: Fix the ovs-ifup and ovs-ifdown examples in kvm.rst
Timothy Redaelli [Mon, 20 Mar 2017 16:14:49 +0000 (17:14 +0100)]
Documentation: Fix the ovs-ifup and ovs-ifdown examples in kvm.rst

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agobuild: Only re-gen HTML docs when needed.
Russell Bryant [Thu, 16 Mar 2017 17:00:30 +0000 (13:00 -0400)]
build: Only re-gen HTML docs when needed.

When sphinx-build is installed, the docs were being re-generated during
every invocation of "make".  This patch sets up dependencies such that
sphinx-build will only be executed if one of the documentation files has
changed.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoCONTRIBUTING.rst: Fix links.
Joe Stringer [Fri, 17 Mar 2017 18:27:10 +0000 (11:27 -0700)]
CONTRIBUTING.rst: Fix links.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
7 years agoofproto: Add some examples for 'ofproto/trace' in ovs-vswitchd man page
Timothy Redaelli [Mon, 13 Mar 2017 16:43:45 +0000 (17:43 +0100)]
ofproto: Add some examples for 'ofproto/trace' in ovs-vswitchd man page

Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1339097
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add some version prerequisites
Timothy Redaelli [Thu, 9 Mar 2017 16:44:29 +0000 (17:44 +0100)]
doc: Add some version prerequisites

Currently to build ovs, you need the following version:

- GCC 4.6 or later (old GCCs have some bugs with unnamed fields)
- python six library 1.4.0 or later (for six.moves.range)

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoFix format specifier technicalities.
Ben Pfaff [Fri, 17 Mar 2017 20:38:55 +0000 (13:38 -0700)]
Fix format specifier technicalities.

Various printf() format specifiers in the tree had minor technical issues
which the Mac OS build reported, e.g. here:
https://s3.amazonaws.com/archive.travis-ci.org/jobs/208718342/log.txt

These tend to fall into two categories of harmless warnings:

1. Wrong width for types that are all promoted to 'int'.  For example,
both uint8_t and uint16_t are both promoted to 'int' as part of a call
to printf(), but using PRIu8 for a uint16_t causes a warning.

2. Wrong format specifier for type promoted to 'int' due to arithmetic.
For example, if 'x' is a uint8_t, then x >> 1 has type 'int' due to
C's promotion rules, so the correct format specifier is %d and using
PRIu8 will cause a warning.

This commit fixes the warnings.  I didn't see anything that rose to the
level of a bug.

These warnings only showed up on Mac OS X because of differences in the
format specifiers that Mac OS uses for PRI*.

Reported-by: Shu Shen <shu.shen@gmail.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Decrease build requirements to support RHEL7.
Ilya Maximets [Thu, 9 Mar 2017 11:55:24 +0000 (14:55 +0300)]
doc: Decrease build requirements to support RHEL7.

Sphinx 1.1.3 on RHEL7 is able to properly build the documentation.

Discovering fixed because 'sphinx-build v1.1.3' doesn't support
'--version' option.

Acked-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoDocumentation: Remove external dependence on pygments.
Ilya Maximets [Fri, 10 Mar 2017 09:25:52 +0000 (12:25 +0300)]
Documentation: Remove external dependence on pygments.

Current documentation uses syntax highlighting in 'sphinx'
via 'pygments' library. This leads to build failures on the
systems with old version of this library.

In fact that only 'windows.rst' uses highlighting it's a
very simple change. This helps us to avoid build issues
on different systems and allows to remove painful external
dependency.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodebian; Avoid installing ovs-vswitchd.conf.db manpage as "db" language.
Ben Pfaff [Tue, 10 Jan 2017 17:09:48 +0000 (09:09 -0800)]
debian; Avoid installing ovs-vswitchd.conf.db manpage as "db" language.

Usually, when the name of a manpage has a two-letter extension, it means
that the manpage is written in the language designated by that language
code.

Reported-by: Michael Stapelberg <stapelberg@debian.org>
Reported-at: https://bugs.debian.org/850631
Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: nickcooper-zhangtonghao <nic@opencloud.tech>
7 years agotests: Add and improve stp tests.
nickcooper-zhangtonghao [Thu, 9 Mar 2017 11:49:49 +0000 (03:49 -0800)]
tests: Add and improve stp tests.

This patch makes the stp tests more stable and
adds the test for fdb/mdb flushing when topology
is changed.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodebian: Rewrite "ifconfig" to "ip" command.
nickcooper-zhangtonghao [Thu, 9 Mar 2017 04:01:20 +0000 (20:01 -0800)]
debian: Rewrite "ifconfig" to "ip" command.

Some debian distribution may not contain the ifconfig.
We use the ip command instead of ifconfig in debian/ifupdown.sh

Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/329503.html
CC: prochazka <prochazka@cortex.cz>
Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agostp: Send BPDU when STP starts up, instead of waiting a hello time.
nickcooper-zhangtonghao [Tue, 7 Mar 2017 13:11:30 +0000 (05:11 -0800)]
stp: Send BPDU when STP starts up, instead of waiting a hello time.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agostp: Use correct default for BPDU max age.
nickcooper-zhangtonghao [Tue, 7 Mar 2017 13:11:29 +0000 (05:11 -0800)]
stp: Use correct default for BPDU max age.

The default max age should be 20 seconds, but this typo caused it to
default to 2 seconds.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: Modify the DHCPv4 router option to optional
Guoshuai Li [Thu, 9 Mar 2017 02:53:37 +0000 (10:53 +0800)]
ovn: Modify the DHCPv4 router option to optional

Co-authored-by: Dong Jun <dongj@dtdream.com>
Signed-off-by: Dong Jun <dongj@dtdream.com>
Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoAdd new port VLAN mode "dot1q-tunnel"
Eric Garver [Wed, 1 Mar 2017 22:48:00 +0000 (17:48 -0500)]
Add new port VLAN mode "dot1q-tunnel"

 - Example:
     ovs-vsctl set Port p1 vlan_mode=dot1q-tunnel tag=100
   Pushes another VLAN 100 header on packets (tagged and untagged) on
   ingress, and pops it on egress.
 - Customer VLAN check:
     ovs-vsctl set Port p1 vlan_mode=dot1q-tunnel tag=100 cvlans=10,20
   Only customer VLAN of 10 and 20 are allowed.

Co-authored-by: Xiao Liang <shaw.leon@gmail.com>
Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agocompiler: Use C11 build assertions with new enough GCC or Clang.
Ben Pfaff [Thu, 16 Mar 2017 21:04:41 +0000 (14:04 -0700)]
compiler: Use C11 build assertions with new enough GCC or Clang.

Until now, the BUILD_ASSERT and BUILD_ASSERT_DECL macros have used OVS's
home-grown build assertion strategy.  This commit switches them to using
C11 build assertions with compilers that support them.  The semantics are
the same, but C11 build assertions yield clearer error messages when they
fail.

This commit also reorders the definitions a bit to make it easier to
follow.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agoAUTHORS: Add Xiao Liang.
Ben Pfaff [Thu, 16 Mar 2017 22:23:26 +0000 (15:23 -0700)]
AUTHORS: Add Xiao Liang.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoAdd support for 802.1ad (QinQ tunneling)
Eric Garver [Wed, 1 Mar 2017 22:47:59 +0000 (17:47 -0500)]
Add support for 802.1ad (QinQ tunneling)

Flow key handling changes:
 - Add VLAN header array in struct flow, to record multiple 802.1q VLAN
   headers.
 - Add dpif multi-VLAN capability probing. If datapath supports
   multi-VLAN, increase the maximum depth of nested OVS_KEY_ATTR_ENCAP.

Refactor VLAN handling in dpif-xlate:
 - Introduce 'xvlan' to track VLAN stack during flow processing.
 - Input and output VLAN translation according to the xbundle type.

Push VLAN action support:
 - Allow ethertype 0x88a8 in VLAN headers and push_vlan action.
 - Support push_vlan on dot1q packets.

Use other_config:vlan-limit in table Open_vSwitch to limit maximum VLANs
that can be matched. This allows us to preserve backwards compatibility.

Add test cases for VLAN depth limit, Multi-VLAN actions and QinQ VLAN
handling

Co-authored-by: Thomas F Herbert <thomasfherbert@gmail.com>
Signed-off-by: Thomas F Herbert <thomasfherbert@gmail.com>
Co-authored-by: Xiao Liang <shaw.leon@gmail.com>
Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofp-actions: Add limit to learn action.
Daniele Di Proietto [Fri, 10 Mar 2017 23:44:40 +0000 (15:44 -0800)]
ofp-actions: Add limit to learn action.

This commit adds a new feature to the learn actions: the possibility to
limit the number of learned flows.

To be compatible with users of the old learn action, a new structure is
introduced as well as a new OpenFlow raw action number.

There's a small corner case when we have to delete the ukey.  This
happens when:
* The learned rule has expired (or has been deleted).
* The ukey that learned the rule is still in the datapath.
* No packets hit the datapath flow recently.
In this case we cannot relearn the rule (because there are no new
packets), and the actions might depend on the learn execution, so the
only option is to delete the ukey.  I don't think this has big
performance implications since it's done only for ukey with no traffic.

We could also slowpath it, but that will cause an action upcall and the
correct datapath actions will be installed later by a revalidator.  If
we delete the ukey, the next upcall will be a miss upcall and that will
immediatedly install the correct datapath flow.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofp-actions: Factor out decode_LEARN_{common,spec}().
Daniele Di Proietto [Fri, 10 Mar 2017 23:44:39 +0000 (15:44 -0800)]
ofp-actions: Factor out decode_LEARN_{common,spec}().

No functional change, they will be used by next commit.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto-dpif-xlate: Create XC_LEARN entry after learning.
Daniele Di Proietto [Fri, 10 Mar 2017 23:44:38 +0000 (15:44 -0800)]
ofproto-dpif-xlate: Create XC_LEARN entry after learning.

This will be useful in a separate commit, because learning can fail.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoDocumentation: fix 3 typos in testing.rst
Timothy Redaelli [Thu, 16 Mar 2017 17:20:04 +0000 (18:20 +0100)]
Documentation: fix 3 typos in testing.rst

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agocheckpatch.py: Fix false positive on if/when/for
Eric Garver [Thu, 16 Mar 2017 14:22:32 +0000 (10:22 -0400)]
checkpatch.py: Fix false positive on if/when/for

We need to use == instead of the is operator. If you're unlucky it may
fail because they're not exactly the same object, but hold the same
value.

Example false positive:

E(120): Inappropriate bracing around statement

+            if (0 != nl_attr_get_u8(vxlan[IFLA_VXLAN_LEARNING])

Fixes: 30c7ffd5ac46 ("utilities/checkpatch.py: Check for appropriate bracing")
Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agoSet release date for 2.7.0.
Justin Pettit [Tue, 21 Feb 2017 21:58:32 +0000 (13:58 -0800)]
Set release date for 2.7.0.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto: Move tun_table and vl_mff_map deletion.
Yi-Hung Wei [Mon, 13 Mar 2017 18:28:22 +0000 (11:28 -0700)]
ofproto: Move tun_table and vl_mff_map deletion.

In this patch, we move the tun_table and vl_mff_map deletion in
ofproto_destory__() to be in the following order.
    1. Delete all the flows.
    2. Delete vl_mff_map.
    3. Delete tun_table.
The rationale behind this order is that a flow may use a variable length
mf_field, and a variable length mf_field is defined by a TLV mapping
in tun_table.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoofproto: Add ref counting for variable length mf_fields.
Yi-Hung Wei [Mon, 13 Mar 2017 18:28:21 +0000 (11:28 -0700)]
ofproto: Add ref counting for variable length mf_fields.

Currently, a controller may potentially trigger a segmentation fault if it
accidentally removes a TLV mapping that is still used by an active flow.
To resolve this issue, in this patch, we maintain reference counting for each
dynamically allocated variable length mf_fields, so that vswitchd can use this
information to properly remove a TLV mapping, and to return an error if the
controller tries to remove a TLV mapping that is still used by any active flow.

To keep track of the usage of tun_metadata for each flow, two 'uint64_t'
bitmaps are introduce for the flow match and flow action respectively. We use
'uint64_t' as a bitmap since the 64 geneve TLV tunnel metadata are the only
available variable length mf_fields for now. We shall adopt general bitmap when
more variable length mf_fields are introduced. The bitmaps are configured
during the flow decoding process, and vswitchd use these bitmaps to increase or
decrease the ref counting when the flow is created or deleted.

VMWare-BZ: #1768370
Fixes: 04f48a68c428 ("ofp-actions: Fix variable length meta-flow OXMs.")
Suggested-by: Jarno Rajahalme <jarno@ovn.org>
Suggested-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agonx-match: Use vl_mff_map to parse match field.
Yi-Hung Wei [Mon, 13 Mar 2017 18:28:20 +0000 (11:28 -0700)]
nx-match: Use vl_mff_map to parse match field.

vl_mff_map is introduced in commit 04f48a68c428 ("ofp-actions: Fix variable
length meta-flow OXMs") to account variable length mf_field, and it is used
to decode variable length mf_field in ofp_action. In this patch, vl_mff_map
is further used to decode the variable length match field as well.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agonx-match: Fix oxm decode.
Yi-Hung Wei [Mon, 13 Mar 2017 18:27:49 +0000 (11:27 -0700)]
nx-match: Fix oxm decode.

decode_nx_packet_in2() may be used by the switch to parse NXT_RESUME messages,
where we need exact match on the oxm header. Therefore, change
oxm_decode_loose() to oxm_decode() that takes an extra argument to indicate whether
we want strict or loose match.

Fixes: 7befb20d0f70 ("ofp-util: Ignore unknown fields in ofputil_decode_packet_in2()")
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoDocument OVN support in ovs-sandbox.
Russell Bryant [Mon, 13 Mar 2017 20:26:00 +0000 (16:26 -0400)]
Document OVN support in ovs-sandbox.

A previous commit removed the original ovs-sandbox based OVN tutorial
because it became too outdated and difficult to maintain.  However,
the use of ovs-sandbox for basic OVN development and testing is incredibly
useful, so we should provide at least basic documentation on how to use it.

This commit introduces a new and shorter document that shows how to use OVN
in ovs-sandbox.  It provides a single sample configuration, as well as a
sample ovn-trace command.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
7 years agoofproto: Add appctl command to show Datapath features
Andy Zhou [Thu, 9 Mar 2017 02:09:01 +0000 (18:09 -0800)]
ofproto: Add appctl command to show Datapath features

Exporting Datapath runtime detected features can be useful for
both debugging and for writing system unit testing easier.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agometa-flow: Fix conntrack field OVS version.
Jarno Rajahalme [Tue, 14 Mar 2017 22:46:25 +0000 (15:46 -0700)]
meta-flow: Fix conntrack field OVS version.

New conntrack original direction fields did not make it to OVS 2.7, so
change the "since" version to v2.8.

Suggested-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agoofproto-dpif-xlate: Avoid using sample action when nesting level is low
Andy Zhou [Thu, 9 Mar 2017 22:00:34 +0000 (14:00 -0800)]
ofproto-dpif-xlate: Avoid using sample action when nesting level is low

When datapath sample action only allow a small number of nested actions
(i.e. less than 3), do not translate the OpenFlow's 'clone' action
into datapath 'sample' action, since such translation would cause
datapath to reject the flow, with 'EOVERFLOW', when OVS is used to
implement the OVN pipeline, or more generally, when deeper nested
clone are expected.

Reported-by: Numan Siddique <nusiddiq@redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-March/329586.html
Signed-off-by: Andy Zhou <azhou@ovn.org>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agoofproto: Probe for sample nesting level.
Andy Zhou [Thu, 9 Mar 2017 21:14:27 +0000 (13:14 -0800)]
ofproto: Probe for sample nesting level.

Add logics to detect the max level of nesting allowed by the
sample action implemented in the datapath.

Future patch allows xlate code to generate different odp actions
based on this information.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodpif: Refactor dpif_probe_feature()
Andy Zhou [Thu, 9 Mar 2017 19:01:57 +0000 (11:01 -0800)]
dpif: Refactor dpif_probe_feature()

Allow actions to be part of the probe. No functional changes.
Future patch will make use this new API.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agodocs: Use DPDK 16.11.1 stable release.
Ian Stokes [Fri, 10 Mar 2017 11:47:09 +0000 (11:47 +0000)]
docs: Use DPDK 16.11.1 stable release.

DPDK now provides a stable release branch. Modify dpdk docs and travis linux
build script to use the DPDK 16.11.1 stable branch to benefit from most
recent bug fixes.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoovn-controller: Don't bind non-existent interfaces.
Gurucharan Shetty [Wed, 8 Mar 2017 07:06:43 +0000 (23:06 -0800)]
ovn-controller: Don't bind non-existent interfaces.

There are multiple reasons why a interface can exist
in the Open vSwitch database but not exist in the system.
For e.g, a restart of a host after a system crash. Ideally,
whoever added the interface in the Open vSwitch database
should remove those interfaces. But that usually does not
happen in practise. Based on experience, I have observerd
that on any long lasting OVS installation there are always
a couple of stale interfaces.

When a stale interface remains in the Open vSwitch database
and the container/VM initially backing that stale interface
is moved to a different machine, the two ovn-controllers
start over-writing the OVN-SB's port_binding table in a loop.

This situation can be avoided, if ovn-controller only binds
the interfaces that actually have a valid 'ofport'.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agotests: Fix mcast test on slow systems
Alin Serdean [Wed, 8 Mar 2017 14:31:56 +0000 (14:31 +0000)]
tests: Fix mcast test on slow systems

On slow systems(or which start processes slow) the test:
`testing mcast - delete the port mdb when port destroyed`
is influenced by the running time.
i.e.: http://64.119.130.115/ovs/911b7e9b08b9f4f890eeecd228d5124f4ce94d4e/testsuite.dir/2326/testsuite.log.gz

This patches adds a time stop on vswitchd.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodpdk: Redirect DPDK log to OVS logging subsystem.
Ilya Maximets [Mon, 6 Mar 2017 06:49:11 +0000 (09:49 +0300)]
dpdk: Redirect DPDK log to OVS logging subsystem.

This should be helpful for have all the logs in one place.
'ovs-appctl vlog' commands for 'dpdk' module can be used
to configure the log level. Lower bound for DPDK logging
(--log-level) still can be passed through 'dpdk-extra' field.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agonetdev-dpdk: Fix mempool segfault.
Ian Stokes [Thu, 9 Mar 2017 13:57:37 +0000 (13:57 +0000)]
netdev-dpdk: Fix mempool segfault.

The dpdk_mp_get() function can return a NULL pointer which leads to a
segfault when a mempool cannot be created. The lack of a return value
check for the function netdev_dpdk_mempool_configure() when called in
netdev_dpdk_reconfigure() can result in a segfault also as
a NULL pointer for the mempool will be passed to rte_eth_rx_queue_setup().

Fix this by adding appropriate NULL pointer and return value checks to
dpdk_mp_get(), netdev_dpdk_reconfigure() and dpdk_vhost_reconfigure_helper().

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Fixes: 2ae3d542 ("netdev-dpdk: Refactor dpdk_mp_get().")
Fixes: 0072e931 ("netdev-dpdk: add support for jumbo frames")
CC: Daniele Di Proietto <diproiettod@vmware.com>
CC: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agosystem-traffic: Add missing CHECK_CONNTRACK_ALG guards.
Darrell Ball [Thu, 16 Feb 2017 08:47:37 +0000 (00:47 -0800)]
system-traffic: Add missing CHECK_CONNTRACK_ALG guards.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoRevert "ovs-fields.7: Use a more general approach to groff encodings."
Ben Pfaff [Thu, 9 Mar 2017 22:59:05 +0000 (14:59 -0800)]
Revert "ovs-fields.7: Use a more general approach to groff encodings."

This reverts commit 3e45560fb03b433c00117ae691027db61d37367d, which failed
on Windows and Mac OS because they use antique pre-2009 versions of groff.

Fixes: 3e45560fb03b ("ovs-fields.7: Use a more general approach to groff encodings.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agolib: Indicate if netlink message had labels.
Jarno Rajahalme [Thu, 9 Mar 2017 22:09:08 +0000 (14:09 -0800)]
lib: Indicate if netlink message had labels.

Conntrack update events include labels only if they have changed.
Record the presence of labels in the netlink message to OVS internal
representation, so that the user may keep the old labels when an
update does not modify them.

Fixes: 6830a0c0e6bf ("netlink-conntrack: New module.")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>