]> git.proxmox.com Git - ovs.git/log
ovs.git
6 years agodatapath: Check maximum netlink message size
Greg Rose [Fri, 22 Sep 2017 14:44:52 +0000 (07:44 -0700)]
datapath: Check maximum netlink message size

In kernels < 4.9 the maximum netlink message size is 16KB.

See http://www.spinics.net/lists/netdev/msg431592.html

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agolib: Move lib/rconn.h to include/openvswitch
Xiao Liang [Wed, 16 Aug 2017 16:06:24 +0000 (00:06 +0800)]
lib: Move lib/rconn.h to include/openvswitch

Rconn provides useful features over vconn. Make it available to library
users.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agodatapath-windows: Update OvsCompleteNbl argument to match definition
Sairam Venugopal [Tue, 24 Oct 2017 21:51:49 +0000 (14:51 -0700)]
datapath-windows: Update OvsCompleteNbl argument to match definition

Update the OvsCompleteNbl to take in a PVOID and explicitly cast to
POVS_SWITCH_CONTEXT. This is useful when finding declarations in Visual
Studio. The mismatch breaks this functionality.

Found by inspection.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Shashank Ram <rams@vmware.com>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
6 years agosparse: eliminate "duplicate initialization" warning
Lance Richardson [Mon, 28 Aug 2017 15:23:16 +0000 (11:23 -0400)]
sparse: eliminate "duplicate initialization" warning

Sparse version 0.5.1 will be released in the near future. Prepare
for it by eliminating the only new warning (as of 0.5.1-rc5):

ofproto/fail-open.c:134:22: error: Initializer entry defined twice
ofproto/fail-open.c:135:22:   also defined here

MATCH_CATCHALL_INITIALIZER effectively sets all fields of .flow to
zero, which is redundant because according to the C99 semantics for
structure initialization, initializing any single member of a
structure results in all other members being initialized to zero,
and the next line initializes a member of the same structure.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agoAUTHORS: Add Kaige Fu.
Ben Pfaff [Mon, 30 Oct 2017 23:48:40 +0000 (16:48 -0700)]
AUTHORS: Add Kaige Fu.

Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agodpif: Remove duplicated word in comment for dpif_recv()
Kaige Fu [Sat, 26 Aug 2017 02:27:38 +0000 (10:27 +0800)]
dpif: Remove duplicated word in comment for dpif_recv()

Signed-off-by: Kaige Fu <fukaige@huawei.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agoroute-table: Remove netdevs in netdev_hash when deleted
Kaige Fu [Mon, 14 Aug 2017 07:11:55 +0000 (15:11 +0800)]
route-table: Remove netdevs in netdev_hash when deleted

Start a virtual machine with its backend tap device attached to a brought
up linux bridge.  If we delete the linux bridge when vm is still running,
we'll get the following error when trying to create a ovs bridge with
the same name.

The reason is that ovs-router subsystem add the linux bridge into
netdev_shash, but does not remove it when the bridge is deleted in the
situation. When the bridge is deleted, ovs will receive a RTM_DELLINK msg,
take this chance to remove the bridge in netdev_shash.

ovs-vsctl: Error detected while setting up 'br-eth'.  See ovs-vswitchd log for details.

ovs-vswitchd log:
2017-05-11T03:45:25.293Z|00026|ofproto_dpif|INFO|system@ovs-system: Datapath supports recirculation
2017-05-11T03:45:25.293Z|00027|ofproto_dpif|INFO|system@ovs-system: MPLS label stack length probed as 1
2017-05-11T03:45:25.293Z|00028|ofproto_dpif|INFO|system@ovs-system: Datapath supports unique flow ids
2017-05-11T03:45:25.293Z|00029|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_state
2017-05-11T03:45:25.293Z|00030|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_zone
2017-05-11T03:45:25.293Z|00031|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_mark
2017-05-11T03:45:25.293Z|00032|ofproto_dpif|INFO|system@ovs-system: Datapath supports ct_label
2017-05-11T03:45:25.364Z|00001|ofproto_dpif_upcall(handler226)|INFO|received packet on unassociated datapath port 0
2017-05-11T03:45:25.368Z|00033|netdev_linux|WARN|ethtool command ETHTOOL_GFLAGS on network device br-eth failed: No such device
2017-05-11T03:45:25.368Z|00034|dpif|WARN|system@ovs-system: failed to add br-eth as port: No such device
2017-05-11T03:45:25.368Z|00035|bridge|INFO|bridge br-eth: using datapath ID 00002a51cf9f2841
2017-05-11T03:45:25.368Z|00036|connmgr|INFO|br-eth: added service controller "punix:/var/run/openvswitch/br-eth.mgmt"

Signed-off-by: Kaige Fu <fukaige@huawei.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agonetdev-dpdk: Fix mp_name leak on snprintf failure.
Ilya Maximets [Mon, 30 Oct 2017 12:52:38 +0000 (15:52 +0300)]
netdev-dpdk: Fix mp_name leak on snprintf failure.

CC: Robert Wojciechowicz <robertx.wojciechowicz@intel.com>
CC: Antonio Fischetti <antonio.fischetti@intel.com>
Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each port.")
Fixes: 65056fd79694 ("netdev-dpdk: manage failure in mempool name creation.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agorhel: Use python2-sphinx as BuildRequires on Fedora
Timothy Redaelli [Fri, 27 Oct 2017 12:18:43 +0000 (14:18 +0200)]
rhel: Use python2-sphinx as BuildRequires on Fedora

python-* package names are deprecated on Fedora
(https://fedoraproject.org/wiki/Packaging:Naming#Python2_binary_package_naming)
so use python2-sphinx, when available, instead.

CC: Lance Richardson <lrichard@redhat.com>
Fixes: cd6121410b52 ("rhel: add python-sphinx as a build dependency")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agofedora: Use python2-sphinx as dependency instead of python-sphinx
Timothy Redaelli [Fri, 27 Oct 2017 12:03:15 +0000 (14:03 +0200)]
fedora: Use python2-sphinx as dependency instead of python-sphinx

python-* package names are deprecated
(https://fedoraproject.org/wiki/Packaging:Naming#Python2_binary_package_naming)
so use python2-sphinx instead.

CC: Gurucharan Shetty <guru@ovn.org>
Fixes: fc9669525f3f ("rhel, fedora: Add python-sphinx as a dependency.")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovsdb-idl: fix index row setting with references.
Han Zhou [Mon, 30 Oct 2017 19:21:49 +0000 (12:21 -0700)]
ovsdb-idl: fix index row setting with references.

IDL index should be able to be used without having to be in a
transaction. However, current implementation leads to crash if
a reference type column is being set in an index row for querying
purpose when it is not in a transaction. It is because of the
uninitialized arcs and unnecessary updates of the arcs. This patch
fixes it by identifying index rows by a magic uuid, so that when
parsing index row, the arcs are not updated. A new test case is
added to cover this scenario.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn-sbctl: Fix dead assignment.
William Tu [Mon, 30 Oct 2017 17:27:54 +0000 (10:27 -0700)]
ovn-sbctl: Fix dead assignment.

Clang reports value stored to 'sb' is never read.
Fix it by removing it.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoofp-actions: Fix dead assignment.
William Tu [Mon, 30 Oct 2017 17:27:53 +0000 (10:27 -0700)]
ofp-actions: Fix dead assignment.

Clang reports value stored to 'eah' in never read.
Fix it by removing it.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agofaq: Fix header path of ofp-msgs.h.
William Tu [Mon, 30 Oct 2017 17:46:42 +0000 (10:46 -0700)]
faq: Fix header path of ofp-msgs.h.

Replace path 'lib/ofp-msgs.h' with 'include/openvswitch/ofp-msgs.h'

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agofaq: Better document how to add vendor extensions.
Ben Pfaff [Mon, 9 Oct 2017 17:33:15 +0000 (10:33 -0700)]
faq: Better document how to add vendor extensions.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
6 years agotimeval: Check for OS-provided clock_gettime on macOS
Richard Oliver [Sat, 28 Oct 2017 15:38:30 +0000 (16:38 +0100)]
timeval: Check for OS-provided clock_gettime on macOS

[Problem]
Compilation error on newer versions of macOS (Sierra onwards) due to
multiple declarations of clock_gettime.

[Solution]
Have configure check for clock_gettime and check this result in
timeval to avoid incorrectly declaring/defining clock_gettime again.

[Testing]
Source code now successfully builds on macOS.

Signed-off-by: Richard Oliver <richard@richard-oliver.co.uk>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotreewide: Get rid of "echo -n", and add a test to prevent regression.
Ben Pfaff [Mon, 30 Oct 2017 16:44:52 +0000 (09:44 -0700)]
treewide: Get rid of "echo -n", and add a test to prevent regression.

"echo -n" is not POSIX and has spotty support in shells.

CC: Timothy Redaelli <tredaelli@redhat.com>
CC: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoMerge branch 'dpdk_merge' of https://github.com/istokes/ovs into HEAD
Ben Pfaff [Fri, 27 Oct 2017 17:55:31 +0000 (10:55 -0700)]
Merge branch 'dpdk_merge' of https://github.com/istokes/ovs into HEAD

This patchset specifically deals with fixing a bug related to mempool
management for DPDK and vhost ports.

Patchset has been reviewed and Acked by a number of trusted contributors.

Patchset has been validated follows:

Clang/Sparse compilation and analysis.
OVS Unit tests
Vsperf Performance tests for OVS DPDK for p2p, pvp, pvvp,pvpv
Vpserf integration tests for OVS DPDK for p2p, pvp, pvvp.
MTU tests for both physical and vhost DPDK port types.
Multi queue for DPDK and vhost port types with both kernel virtio and DPDK
virtio interfaces in the guest.

Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotimeval: Add functions with microsecond granularity.
Ilya Maximets [Fri, 27 Oct 2017 16:19:45 +0000 (19:19 +0300)]
timeval: Add functions with microsecond granularity.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn: Add LB flows for logical router with gateway port
Numan Siddique [Thu, 21 Sep 2017 15:52:16 +0000 (21:22 +0530)]
ovn: Add LB flows for logical router with gateway port

This patch adds support for associating a load balancer to a
logical router with gateway router port which was missing earlier.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoIntroduce Emeritus Committer status.
Russell Bryant [Thu, 26 Oct 2017 21:33:18 +0000 (14:33 -0700)]
Introduce Emeritus Committer status.

This patch introduces an Emeritus status for OVS committers. An
Emeritus Committer is recognized as having made a significant impact
to the project and having been a committer in the past.  It is
intended as an option for those that do not currently have the time or
interest to fulfill committer responsibilities based on their current
responsibilities.  While in this status, they are not included in
voting for governance purposes.

An emeritus committer may be re-instated as a full committer at any
time.

The OVS committers voted approval of this change.

See documentation contents for full details.

Suggested-by: Ethan J. Jackson <ejj@eecs.berkeley.edu>
Acked-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ethan J. Jackson <ethan@kelda.io>
Signed-off-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agodpif-netdev: Initialize new rxqs in port_reconfigure().
Ben Pfaff [Thu, 26 Oct 2017 23:49:01 +0000 (16:49 -0700)]
dpif-netdev: Initialize new rxqs in port_reconfigure().

valgrind reported use of uninitialized data in port_reconfigure(), which
was due to xrealloc() not initializing the newly added data, combined with
dp_netdev_rxq_set_intrvl_cycles() reading 'intrvl_idx' from the added data.
This avoids the warning.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
6 years agoovs-save: Replace "echo -n" with "printf"
Timothy Redaelli [Mon, 25 Sep 2017 14:44:06 +0000 (16:44 +0200)]
ovs-save: Replace "echo -n" with "printf"

This is neeed since "echo -n" is not POSIX and may not work with some shells.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
6 years agoovs-save: Use a file to restore flows instead of heredoc
Timothy Redaelli [Mon, 25 Sep 2017 14:44:05 +0000 (16:44 +0200)]
ovs-save: Use a file to restore flows instead of heredoc

This patch makes ovs-save to use a file to restore flows instead of using
shell script here-document.
This is needed since eval + here-documents are much slower than reading a file
with the rules directly.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
6 years agoovs-save: Use --bundle to restore flows (on OpenFlow 1.4+)
Timothy Redaelli [Mon, 25 Sep 2017 14:44:04 +0000 (16:44 +0200)]
ovs-save: Use --bundle to restore flows (on OpenFlow 1.4+)

If possible, use OpenFlow 1.4 atomic bundle transaction to restore flows.
The patch uses also the highest enabled OpenFlow version to do the queries.

With the actual implementation, if you have the default OpenFlow version
disabled then ovs-save fails. This patch also fixes that problem.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
6 years agorhel: Add systemd support to delete transient ports only on boot
Timothy Redaelli [Wed, 13 Sep 2017 07:35:34 +0000 (09:35 +0200)]
rhel: Add systemd support to delete transient ports only on boot

Using the dependencies feature of systemd ovs-delete-transient-ports.service
is only started once and so transient ports are only deleted only the first
time after boot.

Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovs-ctl: Add delete-transient-ports command
Timothy Redaelli [Wed, 13 Sep 2017 07:35:33 +0000 (09:35 +0200)]
ovs-ctl: Add delete-transient-ports command

Add a command to delete all ports that have the other_config:transient value
set to true.

Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agonetdev-dpdk: Rename dpdk_mp_put as dpdk_mp_free.
antonio.fischetti@intel.com [Thu, 19 Oct 2017 16:54:08 +0000 (17:54 +0100)]
netdev-dpdk: Rename dpdk_mp_put as dpdk_mp_free.

For readability purposes dpdk_mp_put is renamed as dpdk_mp_free.

CC: Mark B Kavanagh <mark.b.kavanagh@intel.com>
CC: Darrell Ball <dlu998@gmail.com>
CC: Ciara Loftus <ciara.loftus@intel.com>
CC: Kevin Traynor <ktraynor@redhat.com>
CC: Aaron Conole <aconole@redhat.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agonetdev-dpdk: Reword mp_size as n_mbufs.
antonio.fischetti@intel.com [Thu, 19 Oct 2017 16:54:07 +0000 (17:54 +0100)]
netdev-dpdk: Reword mp_size as n_mbufs.

For code readability purposes mp_size is renamed as n_mbufs
in dpdk_mp structure.
This parameter is passed to rte mempool creation functions
and is meant to contain the number of elements inside
the requested mempool.

CC: Ciara Loftus <ciara.loftus@intel.com>
CC: Aaron Conole <aconole@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agonetdev-dpdk: manage failure in mempool name creation.
antonio.fischetti@intel.com [Thu, 19 Oct 2017 16:54:06 +0000 (17:54 +0100)]
netdev-dpdk: manage failure in mempool name creation.

In case a mempool name could not be generated log a message
and return a null mempool pointer to the caller.

CC: Mark B Kavanagh <mark.b.kavanagh@intel.com>
CC: Darrell Ball <dlu998@gmail.com>
CC: Ciara Loftus <ciara.loftus@intel.com>
CC: Kevin Traynor <ktraynor@redhat.com>
CC: Aaron Conole <aconole@redhat.com>
Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each port.")
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agonetdev-dpdk: skip init for existing mempools.
antonio.fischetti@intel.com [Thu, 19 Oct 2017 16:54:05 +0000 (17:54 +0100)]
netdev-dpdk: skip init for existing mempools.

Skip initialization of mempool packet areas if this was already
done in a previous call to dpdk_mp_create.

CC: Darrell Ball <dlu998@gmail.com>
CC: Ciara Loftus <ciara.loftus@intel.com>
CC: Aaron Conole <aconole@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agoFix mempool names to reflect socket id.
antonio.fischetti@intel.com [Thu, 19 Oct 2017 16:54:04 +0000 (17:54 +0100)]
Fix mempool names to reflect socket id.

Create mempool names by considering also the NUMA socket number.
So a name reflects what socket the mempool is allocated on.
This change is needed for the NUMA-awareness feature.

CC: Mark B Kavanagh <mark.b.kavanagh@intel.com>
CC: Aaron Conole <aconole@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reported-by: Ciara Loftus <ciara.loftus@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each port.")
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agonetdev-dpdk: fix management of pre-existing mempools.
antonio.fischetti@intel.com [Thu, 19 Oct 2017 16:54:03 +0000 (17:54 +0100)]
netdev-dpdk: fix management of pre-existing mempools.

Fix an issue on reconfiguration of pre-existing mempools.
This patch avoids to call dpdk_mp_put() - and erroneously
release the mempool - when it already exists.

CC: Mark B Kavanagh <mark.b.kavanagh@intel.com>
CC: Aaron Conole <aconole@redhat.com>
CC: Darrell Ball <dlu998@gmail.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reported-by: Ciara Loftus <ciara.loftus@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
Reported-by: RĂ³bert Mulik <robert.mulik@ericsson.com>
Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each port.")
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
6 years agoAdd dl_type to flow metadata for correct interpretation of conntrack metadata
Daniel Alvarez [Thu, 26 Oct 2017 12:52:22 +0000 (14:52 +0200)]
Add dl_type to flow metadata for correct interpretation of conntrack metadata

When a packet is sent to the controller, dl_type is not stored in the
'ofputil_packet_in_private'. When the packet is resumed, the flow's
dl_type is 0 and this leads to invalid value in ct_orig_tuple in the
pkt_metadata.

This patch adds the dl_type to the metadata so that conntrack
information can be interpreted correctly when packets are resumed.

This is a change from the ordinary practice, since flow_get_metadata() is
only supposed to deal with metadata and dl_type is not metadata.  It is
necessary when ct_state is involved, though, because ct_state only applies
in the case of particular Ethertypes (IPv4 and IPv6 currently), so we need
to add it as a kind of prerequisite.  (This isn't ideal; maybe we didn't
think through the ct_state mechanism carefully enough.)

Reported-by: Daniel Alvarez Sanchez <dalvarez@redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-October/339868.html
Signed-off-by: Daniel Alvarez <dalvarez@redhat.com>
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn-northd: Do not add lflows in lr_in_arp_resolve stage for disabled logical ports
Numan Siddique [Wed, 27 Sep 2017 16:06:18 +0000 (21:36 +0530)]
ovn-northd: Do not add lflows in lr_in_arp_resolve stage for disabled logical ports

ovn-northd is adding the below logical flow for a disabled logical port (with mac M
and IP 'A')

table=6 (lr_in_arp_resolve  ), match=(outport == "lrp-port" && reg0 == 'A'),
action=(eth.dst = 'M'; next;)

In the case of openstack load balancer 'octavia' service, it creates logical
ports 'P1' (M1 IP1) and 'P2' (M2 IP2). It then disables logical port P2 and
adds IP2 to P1 - (M1 IP1 IP2).

When another port tries to reach IP2, it doesn't get delivered to port P1 because
of the above flow.

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoovn pacemaker: Provide the option to configure inactivity probe value
Numan Siddique [Mon, 16 Oct 2017 09:42:07 +0000 (15:12 +0530)]
ovn pacemaker: Provide the option to configure inactivity probe value

In the case of OVN HA deployments with openstack, it has been noticed
that the 5 seconds inactivity probe interval is not enough and ovsdb-servers
do not get the echo reply back from the IDL clients and disconnects the
connections.

This patch
   - providdes an option to configure this value.
   - creates a connection row in NB/SB dbs and sets the target and
     inactivity_probe values when the node is promoted to master.

CC: Andy Zhou <azhou@ovn.org>
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoCheck flow's dl_type before setting ct_orig_tuple in 'pkt_metadata_from_flow()'
Numan Siddique [Wed, 25 Oct 2017 18:03:03 +0000 (23:33 +0530)]
Check flow's dl_type before setting ct_orig_tuple in 'pkt_metadata_from_flow()'

Normally flow's dl_type will be a valid value. However when a packet is sent to
the controller, dl_type is not stored in the 'ofputil_packet_in_private'. When
the controller resumes (OFPRAW_NXT_RESUME) the packet, the flow's dl_type will be
0. If the flow's ct_state has valid value, then the 'pkt_metadata_from_flow'
neither sets the ct_orig_tuple from the flow nor resets it. This results in invalid
value ct_orig_tuple in the pkt_metadata.

This patch handles this situation by checking the dl_type before setting the
ct_orig_tuple. If dl_type is 0, it resets it. It also resets ct_orig_tuple if
dl_type is non zero and other than IPv4 or IPv6.

Reported-by: Daniel Alvarez Sanchez <dalvarez@redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-October/339868.html
Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotests/stp: Use long warps instead of multiple calls.
Ilya Maximets [Wed, 13 Sep 2017 08:46:18 +0000 (11:46 +0300)]
tests/stp: Use long warps instead of multiple calls.

This change fixes constant test failure on RHEL 7 system with
CFLAGS='-march=native':
>---------------------------------------------------------------<
 2222: STP - flush the fdb and mdb when topology changed  FAILED
 ...
 ./stp.at:609: ovs-appctl fdb/show br0
 --- -
 +++ ./tests/testsuite.dir/at-groups/2222/stdout
 @@ -1,2 +1,3 @@
   port  VLAN  MAC                Age
   +LOCAL     1  00:0c:29:a0:27:d1   33
>---------------------------------------------------------------<

Long warps takes threads a chance to perform some work on each
step unlike multiple appctl calls. Also, code looks cleaner and
works faster.

CC: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Fixes: 427e9751f300 ("tests: Add and improve stp tests.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotimeval: Fix misleading function descriptions.
Ilya Maximets [Mon, 28 Aug 2017 07:08:25 +0000 (10:08 +0300)]
timeval: Fix misleading function descriptions.

TIME_UPDATE_INTERVAL was removed long time ago.
Now each call leads to time update via syscall and it's
granularity is system dependent.

Fixes: 31ef9f5178de ("timeval: Remove CACHE_TIME scheme.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotests: Add timeout to OVS_APP_EXIT_AND_WAIT.
Ilya Maximets [Fri, 6 Oct 2017 07:15:42 +0000 (10:15 +0300)]
tests: Add timeout to OVS_APP_EXIT_AND_WAIT.

ovs-appctl can wait indefinitely while executing an exit for a
dead service. Let's add a timeout (10 seconds should be
reasonable) to exit calls to avoid hanging up of the testsuite
in such cases.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agojson: New function json_object_put_format().
Ben Pfaff [Wed, 13 Sep 2017 22:50:25 +0000 (15:50 -0700)]
json: New function json_object_put_format().

This will acquire users in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agojson: New function json_nullable_clone().
Ben Pfaff [Wed, 22 Mar 2017 21:36:57 +0000 (14:36 -0700)]
json: New function json_nullable_clone().

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agouuid: New function uuid_random().
Ben Pfaff [Wed, 22 Mar 2017 21:37:09 +0000 (14:37 -0700)]
uuid: New function uuid_random().

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agotests: Add support for 1-argument 'seq' in emulation.
Ben Pfaff [Wed, 27 Sep 2017 20:50:26 +0000 (13:50 -0700)]
tests: Add support for 1-argument 'seq' in emulation.

The testsuite has an emulation of the common utility 'seq' that only
supported 2- and 3-argument forms.  This commit adds support for the
1-argument form.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agosocket-util: Make parse_bracketed_token() public, as inet_parse_token().
Ben Pfaff [Mon, 18 Sep 2017 18:27:13 +0000 (11:27 -0700)]
socket-util: Make parse_bracketed_token() public, as inet_parse_token().

An upcoming commit will introduce a new user outside socket-util.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agojsonrpc: Increment sequence number when connection actually made.
Ben Pfaff [Thu, 5 Oct 2017 06:38:43 +0000 (23:38 -0700)]
jsonrpc: Increment sequence number when connection actually made.

The purpose of the sequence number is to allow the client to figure out
when the connection status has changed.  The significant event for the
client is when a connection completes, not when a connection attempt
starts.  Thus, this commit changes the code to increment the sequence
number at completion, not at the attempt.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agounixctl: Give better error message for unknown commands.
Ben Pfaff [Sat, 14 Oct 2017 19:47:46 +0000 (12:47 -0700)]
unixctl: Give better error message for unknown commands.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
6 years agoDocumentation: Add document describing RBAC
Mark Michelson [Fri, 20 Oct 2017 14:46:19 +0000 (09:46 -0500)]
Documentation: Add document describing RBAC

Role based access control is a relatively new addition to OVS/OVN, and
aside from the database documentation in ovn-sb(5), there is not much
explaining what RBAC is, how to use it, and the available roles. This
document remedies that situation.

It is hopeful that any new roles added will be added to this document in
the future.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoOVN: Document how to use firewalld service files
Mark Michelson [Tue, 24 Oct 2017 14:10:09 +0000 (09:10 -0500)]
OVN: Document how to use firewalld service files

Firewalld service files for OVN have been in the source for several
months. This adds instructions for how to use these service files with
firewalld.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoDocumentation: Improve formatting and add reference to Faucet tutorial.
Ben Pfaff [Tue, 24 Oct 2017 20:58:57 +0000 (13:58 -0700)]
Documentation: Improve formatting and add reference to Faucet tutorial.

Suggested-by: Stephen Finucane <stephen@that.guru>
Suggested-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoDocumentation: Add Faucet tutorial.
Ben Pfaff [Thu, 19 Oct 2017 18:28:35 +0000 (11:28 -0700)]
Documentation: Add Faucet tutorial.

This is for a talk at the Faucet conference on Oct. 19:
http://conference.faucet.nz/schedule/

Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agotravis: Fix OSX build on travis
William Tu [Mon, 23 Oct 2017 16:39:11 +0000 (09:39 -0700)]
travis: Fix OSX build on travis

Run "brew update" before any installs.
This yields a clean build:
https://travis-ci.org/williamtu/ovs-travis/builds/291616874

Signed-off-by: William Tu <u9012063@gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
6 years agoNEWS: Fix heading.
Ben Pfaff [Mon, 23 Oct 2017 16:34:23 +0000 (09:34 -0700)]
NEWS: Fix heading.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
6 years agovswitch.xml: Fix typo in documentation.
Ben Pfaff [Mon, 23 Oct 2017 16:26:22 +0000 (09:26 -0700)]
vswitch.xml: Fix typo in documentation.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
6 years agoofproto-dpif-xlate: Fix truncate and native tunnnel
William Tu [Sat, 14 Oct 2017 04:33:58 +0000 (21:33 -0700)]
ofproto-dpif-xlate: Fix truncate and native tunnnel

Previous commit a67b337dc281 breaks the truncate and native
tunnel testcase by removing the truncate flag.  The patch fixes
it by putting it back.  Reproduce the error by:
> make check-system-userspace TESTSUITEFLAGS='17'

Fixes: a67b337dc281 ("ofproto-dpif-xlate: Remove assertion for truncated")
Cc: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: William Tu <u9012063@gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
6 years agorhel, fedora: Add python-sphinx as a dependency.
Gurucharan Shetty [Fri, 20 Oct 2017 07:38:33 +0000 (00:38 -0700)]
rhel, fedora: Add python-sphinx as a dependency.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Acked-by: Aaron Conole <aconole@redhat.com>
6 years agoovs-save: Handle different 'ip addr show' output.
Gurucharan Shetty [Thu, 19 Oct 2017 05:38:23 +0000 (22:38 -0700)]
ovs-save: Handle different 'ip addr show' output.

On RHEL 7.4 (with iproute-3.10.0-87), a DHCP provided
ipv4 address has the "dynamic" keyword set. For e.g
"ip addr show breth0 | grep inet" shows:

    inet 10.116.248.91/20 brd 10.116.255.255 scope global dynamic breth0
    inet6 fe80::250:56ff:fea8:fdf0/64 scope link

The keyword "dynamic" (according to 'man ip-address') is only
used for ipv6, but in this case this is not true. Our current
code will skip the ipv4 address restoration because of this.

With this commit, we special case "dynamic" keyword to be valid
in case of ipv4.

VMware-BZ: #1982196
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
6 years agodatapath-windows: Update OvsIPv4TunnelKey flags in geneve decap.
Anand Kumar [Thu, 19 Oct 2017 20:26:17 +0000 (13:26 -0700)]
datapath-windows: Update OvsIPv4TunnelKey flags in geneve decap.

Currently, the OvsLookupFlow fails for the decap packet,
when the Geneve options are present in the packet as the OvsIPv4TunnelKey
flags are not set in the Geneve decap.

Set the OvsIPv4TunnelKey flags OVS_TNL_F_OAM and OVS_TNL_F_CRT_OPT
in OvsDecapGeneve based on the geneve header. Also set OVS_TNL_F_GENEVE_OPT
if the packet has geneve options.

Signed-off-by: Anand Kumar <kumaranand@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
6 years agorhel: fix log directory permissions
Aaron Conole [Fri, 22 Sep 2017 13:44:18 +0000 (09:44 -0400)]
rhel: fix log directory permissions

When the logrotate script runs, and Open vSwitch is running as a non-root
user, the /var/log/openvswitch directory doesn't have other rx bits set.
This means the reopen attempt will fail with "permission denied", even though
the default logrotate configuration creates a new log file with the
appropriate attributes.

This change sets the r/x bits for other on /var/log/openvswitch

Signed-off-by: Aaron Conole <aconole@redhat.com>
Tested-by: Jean Hsiao <jhsiao@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Markos Chandras <mchandras@suse.de>
Acked-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agoovs-atomic: Add C++ compatible implementation.
Ben Pfaff [Tue, 17 Oct 2017 23:51:42 +0000 (16:51 -0700)]
ovs-atomic: Add C++ compatible implementation.

G++ 5 does not implement the _Atomic keyword, which is part of C11 but not
C++11, so the existing <stdatomic.h> based atomic implementation doesn't
work.  This commit adds a new implementation based on the C++11 <atomic>
header.

In this area, C++ is pickier about types than C, so a few of the
definitions in ovs-atomic.h have to be updated to use more precise types
for integer constants.

This updates the code that generates cxxtest.cc to #include <config.h>
(so that HAVE_ATOMIC is defined) and to automatically regenerate when the
program is reconfigured (because otherwise the #include <config.h>) won't
get added without a "make clean" step).

"ovs-atomic.h" is not a public header, but apparently some code was
using it anyway.

Fixes: 9c463631e8145 ("ovs-atomic: Report error for contradictory configuration.")
Reported-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
6 years agodatapath-windows: Remove the workaround in NAT for TCP checksum
Anand Kumar [Fri, 15 Sep 2017 22:04:49 +0000 (15:04 -0700)]
datapath-windows: Remove the workaround in NAT for TCP checksum

When checksum offload is enabled, compute checksum using the
TCP pseudo header.

Signed-off-by: Anand Kumar <kumaranand@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
6 years agoFAQ: State that the userspace datapath implements meters.
Justin Pettit [Fri, 13 Oct 2017 21:55:20 +0000 (14:55 -0700)]
FAQ: State that the userspace datapath implements meters.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoSet release date for 2.8.0.
Ben Pfaff [Thu, 31 Aug 2017 16:33:25 +0000 (09:33 -0700)]
Set release date for 2.8.0.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Justin Pettit <jpettit@ovn.org>
6 years agonetdev: Fix memory leak on error path.
William Tu [Thu, 12 Oct 2017 18:22:45 +0000 (11:22 -0700)]
netdev: Fix memory leak on error path.

Instead of freeing in the error path, move the allocation
after it.  Found by inspection.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agovswitch.xml: Better document patch ports.
Ben Pfaff [Thu, 12 Oct 2017 16:09:35 +0000 (09:09 -0700)]
vswitch.xml: Better document patch ports.

Reported-by: Hui Xiang <xianghuir@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
6 years agoofproto-dpif-xlate: Remove assertion for truncated
IWASE Yusuke [Wed, 4 Oct 2017 13:54:16 +0000 (22:54 +0900)]
ofproto-dpif-xlate: Remove assertion for truncated

Because OpenFlow Spec does not clearly stipulate that "max_len" in
OUTPUT action must be zero when "port" is other than OFPP_CONTROLLER,
it is too strict assertion that confirm "max_len" is not zero, and
"max_len" should be ignored when not used.
Also this assertion causes the lack of the interoperability with some
controller implementations.

This patch removes these redundant assertions of if truncated or not.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
6 years agoutil: Make ovs_assert() always expand so that it should be followed by ;
Ben Pfaff [Tue, 10 Oct 2017 14:58:59 +0000 (07:58 -0700)]
util: Make ovs_assert() always expand so that it should be followed by ;

ovs_assert() is normally invoked like a function call, e.g.:
    ovs_assert(true);
but its expansion was a full statement, so that this ended up expanding to:
    if (!OVS_LIKELY(true)) {                                       \
        ovs_assert_failure(OVS_SOURCE_LOCATOR, __func__, #CONDITION);       \
    };
with both } and ; at the end, which is weird and somewhat risky around 'if'
statements.

This commit fixes the problem, making ovs_assert() expand to an expression.

Reported-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agocheckpatch: Reset line counter.
Ilya Maximets [Thu, 5 Oct 2017 15:32:03 +0000 (18:32 +0300)]
checkpatch: Reset line counter.

Lines should be counted for each file separately.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
6 years agoutil: Fix style in ovs_hex_dump().
Ben Pfaff [Mon, 9 Oct 2017 17:34:55 +0000 (10:34 -0700)]
util: Fix style in ovs_hex_dump().

Reported-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agoofp-print: Avoid trailing white space in OpenFlow dumps.
Ben Pfaff [Fri, 15 Sep 2017 00:01:18 +0000 (17:01 -0700)]
ofp-print: Avoid trailing white space in OpenFlow dumps.

ofp_to_string() sometimes yields a trailing space in its output.  This is
annoying for the test infrastructure, since we have to specially mark the
trailing white space in Autotest with a "@&t@" marker at the end of the
line.  This commit gets rid of the trailing white space and the annoying
"@&t@" markers.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agoutil: Avoid trailing white space in hex dumps.
Ben Pfaff [Fri, 15 Sep 2017 00:00:38 +0000 (17:00 -0700)]
util: Avoid trailing white space in hex dumps.

ovs_hex_dump() sometimes yields a trailing space in its output.  This is
annoying for the test infrastructure, since we have to specially mark the
trailing white space in Autotest with a "@&t@" marker at the end of the
line.  This commit gets rid of the trailing white space and the annoying
"@&t@" markers.

This also gets rid of an occasional trailing hyphen.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agotable: Avoid trailing white space in tables.
Ben Pfaff [Thu, 14 Sep 2017 22:31:48 +0000 (15:31 -0700)]
table: Avoid trailing white space in tables.

Commands that use the table library, such as ovs-vsctl and  "ovsdb-client
dump", print trailing white space in tabular output, to fill out the entire
width of their tabular columns.  This is annoying whenever we use these
commands in the test infrastructure, since we have to specially mark the
trailing white space in Autotest with a "@&t@" marker at the end of the
line.  This commit gets rid of the trailing white space and the annoying
"@&t@" markers.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agodaemon-unix: With --monitor, only close standard fds if --detach also used.
Ben Pfaff [Wed, 30 Aug 2017 16:43:11 +0000 (09:43 -0700)]
daemon-unix: With --monitor, only close standard fds if --detach also used.

Daemons generally should close the standard fds because they don't want to
hold open an SSH session, etc. that is attached to a tty.  But --monitor
without --detach does not daemonize, so do not close fds in that case.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agoreplication: Avoid theoretical use-after-free error in reset_database().
Ben Pfaff [Thu, 31 Aug 2017 22:09:13 +0000 (15:09 -0700)]
replication: Avoid theoretical use-after-free error in reset_database().

Code that calls ovsdb_txn_row_delete() should avoid referencing the
deleted row again, because it might be freed.  In practice this shouldn't
really happen in this case because of the particular circumstances, but it
costs little to be careful.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
6 years agorhel: Skip systemctl redirect.
Gurucharan Shetty [Fri, 6 Oct 2017 11:03:51 +0000 (04:03 -0700)]
rhel: Skip systemctl redirect.

We still use SysV scripts for RHEL. Currently, invoking
/etc/init.d/openvswitch will redirect the calls to
dynamically generated systemd scripts. In the above case when you call
"/etc/init.d/openvswitch-switch start", it inturn calls
"/bin/systemctl start openvswitch-switch.service" and
that inturn again calls "/etc/init.d/openvswitch-switch start"

This patch avoids it.  This is similar to what was done to
Debian in commit 873d85653d8 (debian: Skip systemctl redirect.)

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoovs-ctl.in: Call 'hostname -f' after vswitchd starts.
Gurucharan Shetty [Fri, 6 Oct 2017 10:58:35 +0000 (03:58 -0700)]
ovs-ctl.in: Call 'hostname -f' after vswitchd starts.

Currently we call 'hostname -f' when ovs-vswitchd is not
running. If you are using ovs-vswitchd to provide your
primary networking, then 'hostname -f' will "hang" till it
times out. On the system this issue was discovered, this was
as long as 40 seconds. This is a problem during OVS restarts
or upgrades.

This commit calls 'hostname -f' after ovs-vswitchd has started.

VMware-BZ: #1972026
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agoovs-atomic: Reintroduce atomic_uint64_t and atomic_int64_t.
Ben Pfaff [Fri, 29 Sep 2017 17:10:27 +0000 (10:10 -0700)]
ovs-atomic: Reintroduce atomic_uint64_t and atomic_int64_t.

This is essentially a revert of commit e09d61c41b4f ("ovs-atomic: Remove
atomic_uint64_t and atomic_int64_t.")  My fear that some 32-bit platforms
did not support 64-bit integers seems overblown, because OVS 2.6.x uses
the 64-bit atomic_ullong and it is in Debian, which has tons of
architectures.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Simon Horman <simon.horman@netronome.com>
6 years agoFix a typo in the controller name in the howto
Iman Tabrizian [Mon, 2 Oct 2017 16:58:04 +0000 (20:28 +0330)]
Fix a typo in the controller name in the howto

This commit fixes potential unintended mistake in howto guide of
userspace tunneling.

Submitted-at: https://github.com/openvswitch/ovs/pull/209
Signed-off-by: Iman Tabrizian <tabrizian@outlook.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
6 years agodpif-netdev: Use portable error code for zero rate meter band
Andy Zhou [Wed, 27 Sep 2017 23:53:45 +0000 (16:53 -0700)]
dpif-netdev: Use portable error code for zero rate meter band

'EBADRQC' is only defined on the Linux platform. Without this fix,
The travis MacOS build fails. Switching to using EDOM which is more
portable.

Fixes: 2029ce9ac3a601 (dpif-netdev: Fix a zero-rate bug for meter)
CC: Ali Volkan ATLI <volkan.atli@argela.com.tr>
Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
6 years agoconnmgr: Fix violation of flow monitoring protocol description.
Ben Pfaff [Thu, 28 Sep 2017 16:27:25 +0000 (09:27 -0700)]
connmgr: Fix violation of flow monitoring protocol description.

nicira-ext.h says:

 * 1. OVS sends an NXT_FLOW_MONITOR_PAUSED message to the controller, following
 *    all the already queued notifications.  After it receives this message,
 *    the controller knows that its view of the flow table, as represented by
 *    flow monitor notifications, is incomplete.

The actual implementation could send NXT_FLOW_MONITOR_PAUSED in the middle
of a series of queued notifications.  This fixes it to always send it after
those notifications.  Possibly this confused some controllers, since the
documentation said that NXFME_ADD and NXFME_MODIFIED notifications wouldn't
be sent between "pause" and "resume" messages, but this bug could cause
them to be sent just after "pause".

VMware-BZ: #1919454
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
6 years agoovn/actions: Improve OVN load-balancing performance.
Gurucharan Shetty [Thu, 28 Sep 2017 07:48:08 +0000 (00:48 -0700)]
ovn/actions: Improve OVN load-balancing performance.

Currently, we send the first packet of every new connection
to userspace to figure out the target IP address of load-balancing.

With this patch, we use the selection method of dp_hash to prevent
that situation.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
6 years agodatapath-windows: Fix bugs in cleaner threads
Shashank Ram [Fri, 22 Sep 2017 21:24:51 +0000 (14:24 -0700)]
datapath-windows: Fix bugs in cleaner threads

Conntrack, Conntrack-related, Stt, and IP fragmentation
have cleaner threads that run periodically to clean
up their respective tables. During driver unload,
OvsExtDetach() calls into routines that are meant
for explicitly cleaning these tables up and freeing
the resources associated with these threads.

If during driver unload, these cleaner threads run
immediately after the resources are freed, such as locks
used by these threads, then the cleaner threads result
in a kernel crash since they try to acquire locks
that have already been freed.

For eg, OvsIpFragmentEntryCleaner() caused a kernel
crash because it tried to acquire a lock that was
already freed by OvsCleanupIpFragment().

The fix is to simply exit the cleaner thread if the
lock associated with the thread is not initialized,
because the only way the threads can run when the lock
is invalid is when the lock has been freed up during
driver unload.

Testing done:
Verified that cleaner threads run as expected without
crashing during driver unload.

Signed-off-by: Shashank Ram <rams@vmware.com>
Acked-by: Anand Kumar <kumaranand@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
6 years agodocs: Add references to git-pw
Stephen Finucane [Mon, 4 Sep 2017 13:09:44 +0000 (14:09 +0100)]
docs: Add references to git-pw

Now that Patchwork 2.0 is out, folks can start to take advantage of some
of the new features that it offers. Chief among these is series support,
which is only exposed via the web UI and new REST API and which, in
turn, necessitates using git-pw rather than pwclient. As such, this tool
is slightly documented.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agodpif-netdev: Fix a zero-rate bug for meter
Ali Volkan ATLI [Wed, 27 Sep 2017 15:33:57 +0000 (18:33 +0300)]
dpif-netdev: Fix a zero-rate bug for meter

Open vSwitch daemon crashes (by receiving signal SIGFPE,
Arithmetic exception) when a controller tries to send
a meter-mod message with zero rate.

Signed-off-by: Ali Volkan ATLI <volkan.atli@argela.com.tr>
Signed-off-by: Andy Zhou <azhou@ovn.org>
6 years agoofproto-dpif-xlate: Refactor native tunnel handling logic
Andy Zhou [Fri, 25 Aug 2017 21:39:27 +0000 (14:39 -0700)]
ofproto-dpif-xlate: Refactor native tunnel handling logic

Merge native tunnel handling with patch port handling
as much as possible.

Current native tunnel handling logic inspects the generated actions
to determine if truncate has been applied to the packet. (since if
it is then recirculation should be used).  This logic can be
simplified by passing the 'truncate' boolean argument into
compose_output_action().

Signed-off-by: Andy Zhou <azhou@ovn.org>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agoofproto-dpif-xlate: Rename apply_nested_clone_actions()
Andy Zhou [Thu, 24 Aug 2017 02:29:30 +0000 (19:29 -0700)]
ofproto-dpif-xlate: Rename apply_nested_clone_actions()

Rename apply_nested_clone_actions() To patch_port_output().
The original function name does not make much sense.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agoofproto-dpif-xlate: Refactor xlate_table_actions()
Andy Zhou [Tue, 29 Aug 2017 00:49:28 +0000 (17:49 -0700)]
ofproto-dpif-xlate: Refactor xlate_table_actions()

Allow xlate_table_actions() to generate actions with or without
enclosed in clone().

Signed-off-by: Andy Zhou <azhou@ovn.org>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agoofproto-dpif-xlate: Keep track of the last action
Andy Zhou [Tue, 29 Aug 2017 00:01:28 +0000 (17:01 -0700)]
ofproto-dpif-xlate: Keep track of the last action

When Openflow clone is last action of an action list, it does not
make sense for xlated actions to generate datapath clone action.

This patch attemps to Keep track of last clone action, but not
necessarily for every case.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agoofproto-dpif: Refactor compose_clone()
Andy Zhou [Wed, 23 Aug 2017 23:07:31 +0000 (16:07 -0700)]
ofproto-dpif: Refactor compose_clone()

Add a new function clone_xlate_actions(), which shares the same
signature as do_xlate_actions();  Later patch will make use
of this function.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agoofproto-dpif-xlate: Remove uncessary assignment
Andy Zhou [Tue, 29 Aug 2017 03:02:13 +0000 (20:02 -0700)]
ofproto-dpif-xlate: Remove uncessary assignment

Signed-off-by: Andy Zhou <azhou@ovn.org>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agoofproto-dpif: Unfreeze within clone
Andy Zhou [Thu, 24 Aug 2017 01:48:49 +0000 (18:48 -0700)]
ofproto-dpif: Unfreeze within clone

When translating actions within open flow clone, actions generated
by finish_freezeing() should also be enclosed within the datapath
clone netlink encoding.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
6 years agoconntrack: Minor performance enhancement.
Darrell Ball [Tue, 26 Sep 2017 03:51:46 +0000 (20:51 -0700)]
conntrack: Minor performance enhancement.

Add an OVS_UNLIKELY and reorder a few variable condition
checks.

Acked-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoconntrack: Fix clang static analysis reports.
Darrell Ball [Tue, 26 Sep 2017 03:51:45 +0000 (20:51 -0700)]
conntrack: Fix clang static analysis reports.

These dead assignment warnings do not affect functionality.
In one case, a local variable could be removed and in another
case, the working pointer should be used rather than the start
pointer.

Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.")
Reported-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-September/338515.html
Acked-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoconntrack: Tighten handling of alg reverse conns.
Darrell Ball [Tue, 26 Sep 2017 03:51:44 +0000 (20:51 -0700)]
conntrack: Tighten handling of alg reverse conns.

Close a theoretical race delete/create corner case for alg
reverse conns and add debugging around this that may point to
an intentional exploit, unintentional problem or just a rare
condition. The solution is to keep track of reverse conn via
nat_conn_keys and avoid deleting the reverse conn when it has been
recreated.

Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.")
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoconntrack: Add function ct_print_conn_info().
Darrell Ball [Tue, 26 Sep 2017 03:51:43 +0000 (20:51 -0700)]
conntrack: Add function ct_print_conn_info().

A new debug function is added and used in a
subsequent patch.

Acked-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoconntrack: Create nat_conn_keys_insert().
Darrell Ball [Tue, 26 Sep 2017 03:51:42 +0000 (20:51 -0700)]
conntrack: Create nat_conn_keys_insert().

Create a separate function from existing code, so the
code can be reused in a subsequent patch; no change
in functionality.

Acked-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
6 years agoMerge pull request #207 from darball/dpdk_merge
Ben Pfaff [Mon, 25 Sep 2017 19:36:02 +0000 (12:36 -0700)]
Merge pull request #207 from darball/dpdk_merge

Dpdk merge Sept 22 2017

6 years agoDocumentation: Also define install-man-rst when Sphinx is not available.
Ben Pfaff [Mon, 25 Sep 2017 18:26:56 +0000 (11:26 -0700)]
Documentation: Also define install-man-rst when Sphinx is not available.

"make sandbox" wants to install the ReST manpages, but it failed when
Sphinx wasn't available.  This fixes the problem.

Fixes: 986311be550e ("ovs-sandbox: Install .rst manpages into the sandbox as well.")
Reported-by: Justin Pettit <jpettit@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
6 years agoDebian: Update package dependency
Yi-Hung Wei [Wed, 20 Sep 2017 16:30:50 +0000 (09:30 -0700)]
Debian: Update package dependency

Given that it is libopenvswitch-dev not libopenvswitch that depends on
libssl-dev, this patch updates debian/control file to reflect that
libopenvswitch-dev depends on libssl-dev, and libopenvswitch depends
on openssl.

Tested on Ubuntu 16.04 and 14.04.

VMWare-BZ: #1953215
CC: Ben Warren <ben@skyportsystems.com>
Fixes: c33e9122dbc3 ("Debian: Rework libopenvswitch packages")
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Acked-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
6 years agoovn-controller: pending_ct_zones should be destroyed
00037997 [Mon, 25 Sep 2017 05:24:16 +0000 (13:24 +0800)]
ovn-controller: pending_ct_zones should be destroyed

pending_ct_zones in ovn-controller main should be destroyed when exit.

Signed-off-by: xu rong <xu.rong@zte.com.cn>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>