Kevin Lo [Sat, 18 Apr 2015 17:48:06 +0000 (01:48 +0800)]
configure.ac: Fix pthread linking on FreeBSD.
The configure script checks for the existence of pthread_sigmask.
However, on FreeBSD, libc contains no-op stubs for many of the
pthread_* functions. As a result, the AC_SEARCH_LIBS macro returns
"none required".
As an alternative to checking pthread_sigmask, a solution is to check
pthread_create.
Signed-off-by: Kevin Lo <kevlo@FreeBSD.org> Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Fri, 17 Apr 2015 18:30:18 +0000 (11:30 -0700)]
dkms.conf.in: Install all kernel modules.
With the latest change of separating vports into their own modules,
we need to update the dkms.conf.in and make dkms install all vport
modules. So, this commit modifies the debian/rules to read all
kernel module names and sets the dkms.conf correctly.
When netdev_bsd_get_mtu() failed, it didn't report the error to the caller,
so the caller couldn't work around not knowing the MTU, and ended up using
an uninitialized 'mtu' value.
Found by LLVM scan-build.
Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Kevin Lo <kevlo@FreeBSD.org> Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Ben Pfaff [Thu, 16 Apr 2015 20:44:53 +0000 (13:44 -0700)]
ovs-lldp: Remove unused variable 'lldp_size'.
Doesn't seem to be good for anything.
Found by LLVM scan-build.
Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Kevin Lo <kevlo@FreeBSD.org> Acked-by: Dennis Flynn <drflynn@avaya.com>
Andy Zhou [Thu, 16 Apr 2015 19:52:09 +0000 (12:52 -0700)]
autoconf: check for linux/perf_event.h
Older Linux prior to version 2.6.32 do not support user mode
performance events, They also don't have 'linux/perf_event.h' header
file. Add check for those older Linux to conditionally compile
perf-counter.c
Reported-by: Alex Wang <alexw@nicira.com> Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Ben Pfaff [Thu, 16 Apr 2015 15:52:29 +0000 (08:52 -0700)]
ovs-lldp: Avoid free() of static data in aa_print_element_status_port().
In some cases 'id' could point to the static string "<None>", which was
then passed to free() even though it must not be. This commit fixes the
problem.
Found by LLVM scan-build.
Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com> Acked-by: Dennis Flynn <drflynn@avaya.com>
Ben Pfaff [Wed, 15 Apr 2015 18:13:04 +0000 (11:13 -0700)]
dpctl: Fix error handling and reporting regressions.
Fixes multiple weaknesses in dpctl error reporting:
* dpctl_set_if() didn't stop processing or report to the caller
attempts to change a port type or number.
* dpctl_set_if() didn't report the specifics when netdev_set_config()
reported an error setting port configuration (which can happen even
it returns 0).
* The unixctl handler didn't report errors encountered during command
processing through the JSON-RPC error mechanism, which meant that
ovs-appctl's return code wasn't useful (as ovs-dpctl's return code
is useful) for detecting errors in command execution.
At least the first of these is a regression from OVS 2.3.x.
A followup commit will add tests.
Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
ovs-vswitchd: Don't print supported OpenFlow versions with "-V".
When "-V" was supplied to ovs-vswitchd, it was returning a max supported
OpenFlow version of 1.0, which is no longer true. There are other
methods to determine the supported OpenFlow versions in ovs-vswitchd, so
remove it from the "-V" output.
Reported-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com>
Update ivshmem restrictions to indicate that ivshmem does
not currently support small pages when sharing with a guest
operating system.
Reported-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Mark D. Gray <mark.d.gray@intel.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Fri, 10 Apr 2015 19:53:26 +0000 (12:53 -0700)]
ovs-sandbox: add delay before running ovs-vsctl
When running ovsdb-server under gdb, there is a race that ovs-vsctl
command can be called before ovsdb-server is fully launched. This will
cause ovs-vsctl to fail. This patch fixes this by delay issuing
the ovs-vsctl command until ovsdb-server is fully launched.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 14 Apr 2015 20:47:19 +0000 (13:47 -0700)]
perf-counter: Fix 32-bit build break due to incorrect printf specifiers.
Fixes the following warnings from GCC on 32-bit architectures:
../lib/perf-counter.c: In function 'perf_counter_to_ds':
../lib/perf-counter.c:119:19: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t' [-Werror=format]
../lib/perf-counter.c:119:19: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'uint64_t' [-Werror=format]
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
perf-counter: Lower log level when no perf counter.
Some arches don't support perf counter and an error message
breaks many tests from the testsuite. Since the software still
runs without it, just inform that perf counters are not available
with using INFO level instead.
Signed-off-by: Flavio Leitner <fbl@redhat.com> Acked-by: Russell Bryant <rbryant@redhat.com>
[blp@nicira.com removed unneeded \n from log message] Signed-off-by: Ben Pfaff <blp@nicira.com>
These commands can be used to get packets and cycles counters on a pmd
thread basis. They're useful to get a clearer picture about the
performance of the userspace datapath.
They export these pieces of information:
- A (per-thread) view of the caches hit rate. Hits in the exact match
cache are reported separately from hits in the masked classifier
- A rough cycles count. This will allow to estimate the load of OVS and
the polling overhead.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ethan Jackson <ethan@nicira.com>
Terry Wilson [Fri, 10 Apr 2015 19:57:00 +0000 (14:57 -0500)]
python: Add setuptools for Python lib for PyPI.
This adds very basic support for setuptools so that the OVS Python
lib can be added to PyPI.
This currently uses the Open vSwitch version number and the
generated dirs.py, though there is no real reason to tie the
Python libraries releases or version numbers to the main project's.
Signed-off-by: Terry Wilson <twilson@redhat.com> Acked-by: Russell Bryant <rbryant@redhat.com> Acked-by: Kyle Mestery <mestery@mestery.com>
[blp@nicira.com adjusted automake.mk] Signed-off-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Sat, 21 Mar 2015 07:00:49 +0000 (00:00 -0700)]
ovsdb: integrate perf-counter infrastructure into ovsdb-server
This integration also adds two commands:
ovsdb-server/perf-counters-show -- show all counters
ovsdb-server/perf-counters-clear -- clear all counters
There is no pre-configured sample points. A programmer needs to
added sampling point by changing the source code. However he
does not need to worry about infrastructures such as initialization
or cleaning up memory when ovsdb-server exits.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
Jesse Gross [Tue, 31 Mar 2015 16:19:58 +0000 (09:19 -0700)]
datapath: Update inner offsets when expanding headroom.
skb protocol offsets are relative to the beginning of the
buffer and therefore must be updated if the buffer size is
expanded. Kernel functions do this automatically for existing
fields but obviously not for anything that we backport. This
introduces a wrapper for pskb_expand_head() to update the
inner protocol fields that we have backported.
Without this, a kernel crash can be triggered with tunnel
packets that do not have enough headroom and need to be
segmented. pskb_expand_head() is called in directly through
skb_cow_head() at the beginning of each of the tunnel transmit
routines.
commit 0be55e389d2f1 (INSTALL.Windows: Add documentation about Windows
services.) added documentation about starting Windows services but
provided wrong executable paths. This commit fixes it.
Mark Kavanagh [Wed, 8 Apr 2015 22:30:06 +0000 (23:30 +0100)]
travis: fix errors
Fix two issues observed in travis scripts:
- prepare.sh: add '-E' flag to ensure user environmental variables
(for example, URL of the proxy server) are passed to 'sudo'
- build.sh: add quotes around compiler variable to fix 'unary
operator expected' error
[tgraf: Fixed two additional occurrences of missing "]
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com> Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
We used to count exact match cache hits and masked classifier hits
together. This commit splits the DP_STAT_HIT counter into two.
This change will be used by future commits.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ethan Jackson <ethan@nicira.com>
A read operation from a non atomic shared value (without external
locking) can return incorrect values. Using the atomic semantics
prevents this from happening.
However:
* No memory barriers are used. We don't need that kind of consistency
for statistics (we use relaxed operations).
* The updates are not atomic, just the loads and stores. This is ok
because there's a single writer.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ethan Jackson <ethan@nicira.com>
datapath: Account for "udptunnels: Call handle_offloads after inserting vlan tag."
Upstream commit:
udptunnels: Call handle_offloads after inserting vlan tag.
handle_offloads() calls skb_reset_inner_headers() to store
the layer pointers to the encapsulated packet. However, we
currently push the vlag tag (if there is one) onto the packet
afterwards. This changes the MAC header for the encapsulated
packet but it is not reflected in skb->inner_mac_header, which
breaks GSO and drivers which attempt to use this for encapsulation
offloads.
Fixes: b736a623 ("vxlan: Add tx-vlan offload support.") Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 4aac884d ("udptunnels: Call handle_offloads after inserting vlan tag.") Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
If we receive a packet with an invalid tunnel header, we
should drop the packet without further processing. Currently
we do this by removing any parsed tunnel metadata. However,
this is not sufficient to stop processing - this only results
in the packet getting dropped by chance when something
usually runs across part of the packet that does not make
sense. Since both the packet and its metadata are in an
inconsistent state, it's also possible that the result is
an ovs-vswitchd crash or forwarding of a mangled packet.
Rather than clear the metadata, an alternate solution is to
remove all of the packet data. This guarantees that the
packet gets dropped during the next round of processing.
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
tunneling: Convert tunnel push/pop functions to act on single packets.
The userspace tunneling API for pushing and popping tunnel headers
is currently based on processing batches of packets. However, there
is no obvious way to take advantage of batching for these operations
and so each tunnel operation has a pair of loops to process the
batch. This changes the API to operate on single packets to enable
better code reuse.
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
INSTALL.Windows: Add details about local build and installation.
This commits adds the following.
* Clearly callout to set pthread-win32's dll path in $PATH
* Details about running parallel make and parallel unit tests.
* Installing Open vSwitch locally via 'make install'
* Update the steps to run the user processes by relying on
the previous 'make install'. The steps now run the daemons
in the background with the creation of a logfile and pidfile.
Due to a CVE bug, the patch was modified to not allow following
symlinks out of the workdir. However, this causes a bug when
there is a regular file out of the workdir which breaks the current
testsuite build.
Steps to reproduce:
./boot.sh
mkdir _gcc && cd _gcc
../configure
make
[...]
/bin/sh /home/fleitner/ovs/testsuite/build-aux/missing autom4te
--language=autotest -I '..' -o ../tests/testsuite.tmp
../tests/testsuite.at
patch -p0 ../tests/testsuite.tmp ../tests/testsuite.patch
Invalid file name ../tests/testsuite.tmp -- skipping patch
Makefile:5155: recipe for target '../tests/testsuite' failed
make[2]: *** [../tests/testsuite] Error 1
make[2]: Leaving directory
'/home/fleitner/NetworkingServices/openvswitch/repo/testsuite/_gcc'
Makefile:4087: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Since it's just a temporary file, this patch changes to use the
workdir as the place to put the file.
geneve: Zero header before parsing userspace tunneling action.
When we parse the text representation of the Geneve action the
header is not fully initialized. Besides the obvious potential
to generate an action that the user did not actually specify, this
also causes intermittent unit test failures when an action is
read in and printed out and the result is different.
packet: Avoid array of struct with zero length member.
Windows doesn't like that the Geneve header has an array of
options with each have a zero length member (the variable data).
Nothing is accessing the data now, so just replace the member with
a comment - we can use pointer arithmetic when necessary.
Jesse Gross [Thu, 26 Mar 2015 21:27:19 +0000 (14:27 -0700)]
tunneling: Add UDP checksum support for userspace tunnels.
Kernel based OVS recently added the ability to support checksums
for UDP based tunnels (Geneve and VXLAN). This adds similar support
for the userspace datapath to bring feature parity.
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Jesse Gross [Mon, 30 Mar 2015 19:17:05 +0000 (12:17 -0700)]
packet: Add IP pseudoheader checksum calculation.
As OVS adds userspace support for being the endpoint in protocols
like tunnels, it will need to be able to calculate pseudoheaders
as part of the checksum calculation.
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Jesse Gross [Thu, 26 Mar 2015 20:51:06 +0000 (13:51 -0700)]
tunneling: Add userspace tunnel support for Geneve.
This adds basic userspace dataplane support for the Geneve
tunneling protocol. The rest of userspace only has the ability
to handle Geneve without options and this follows that pattern
for the time being. However, when the rest of userspace is updated
it should be easy to extend the dataplane as well.
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Jesse Gross [Thu, 26 Mar 2015 19:07:02 +0000 (12:07 -0700)]
tunneling: Factor out common UDP tunnel code.
Currently, the userspace VXLAN implementation contains the code
for generating and parsing both the UDP and VXLAN headers. This
pulls out the UDP portion for better layering and to make it
easier to support additional UDP based tunnels and features.
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
The VNI is always present in the VXLAN header, so we should
set the FLOW_TNL_F_KEY flag to indicate this. However, the
userspace implementation of VXLAN currently does not.
Jesse Gross [Sat, 28 Mar 2015 00:51:35 +0000 (17:51 -0700)]
odp-util: Shift VXLAN VNI when printing/parsing.
Currently when printing a userspace tunnel action for VXLAN, the
VNI is treated as a 32 bit field rather than 24 bit. Even if this
is the representation that we use internally, we should still show
the right VNI to avoid confusing people.
Jesse Gross [Fri, 27 Mar 2015 05:55:53 +0000 (22:55 -0700)]
tunneling: Use flow flag for GRE checksum calculation.
The indication to calculate the GRE checksum is currently the port
config rather than the tunnel flow. Currently there is a one to one
mapping between the two so there is no difference. However, the
kernel datapath must use the flow and it is also potentially more
flexible, so this switches how we decide whether to calculate the
checksum.
Jesse Gross [Fri, 27 Mar 2015 00:09:38 +0000 (17:09 -0700)]
tunneling: Fix location of GRE checksums.
The GRE checksum is a 16 bit field stored in a 32 bit option (the
rest is reserved). The current code treats the checksum as a 32-bit
field and places it in the right place for little endian systems but
not big endian. This fixes the problem by storing the 16 bit field
directly.
Jesse Gross [Thu, 26 Mar 2015 23:53:39 +0000 (16:53 -0700)]
tunneling: Add check for GRE protocol is Ethernet.
On receive, the userspace GRE code doesn't check the protocol
field. Since OVS only understands Ethernet packets, this adds a
check that the inner protocol is Ethernet and discards other types
of packets.
Jesse Gross [Fri, 27 Mar 2015 14:39:18 +0000 (07:39 -0700)]
tunneling: Include IP TTL in flow metadata.
The IP TTL is currently omitted in the extracted tunnel information
that is stored in the flow for userspace tunneling. This includes it
so that the same logic used by the kernel also applies.
Alex Wang [Wed, 1 Apr 2015 00:07:03 +0000 (17:07 -0700)]
bridge: Wait for previous stats update transation when it is incomplete.
When ovsdb happens to get blocked for few seconds, the 'stats_timer'
will not be updated due to incompletion of previous transaction.
When the current time passes the 'stats_timer', the call to
poll_timer_wait_until(stats_timer) will keep waking up ovs-vswitchd,
causing 100% cpu utilization.
This commit fixes this issue by making ovs-vswitchd wait on the
previous idl transaction when it is incomplete rather than the
'stats_timer'.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Sun, 5 Apr 2015 19:12:13 +0000 (12:12 -0700)]
rhel: Package vport-*.ko in Fedora kernel package.
Fixes a presumed build break due to unpackaged files. (Only "presumed" at
this point because it is masked in the VMware build system by the similar
XenServer build failure.)
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
Russell Bryant [Fri, 3 Apr 2015 20:04:14 +0000 (16:04 -0400)]
ovs-sandbox: Tell gdb to start the daemon.
The current gdb support launches gdb but doesn't start the daemon.
If you start ovsdb-server with gdb, ovs-sandbox produces an error as
it tries to run ovs-vsctl before ovsdb-server is running. Telling gdb
to start the daemon immediately avoids this error.
There are cases where it's useful to go straight to the gdb prompt,
too. For example, someone may want to set a breakpoint. In that
case, it's easy enough to just kill it, set a breakpoint, and execute
'run' again.
In passing, fix indentation to use spaces instead of tabs.
Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Kevin Lo [Sat, 4 Apr 2015 16:59:26 +0000 (00:59 +0800)]
netdev-bsd: Fix sign extension bug in ifr_flags on FreeBSD.
FreeBSD fills the int return value with ifr_flagshigh in the high
16 bits and ifr_flags in the low 16 bits rather than blindly promoting
ifr_flags to an int, which will preserve the sign.
This commit makes sure the flags returned isn't negative and apply mask
0xffff to flags.
Signed-off-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com>
Thomas Graf [Sat, 4 Apr 2015 06:24:13 +0000 (08:24 +0200)]
datapath: Turn vports with dependencies into separate modules
Upstream commit:
The internal and netdev vport remain part of openvswitch.ko. Encap
vports including vxlan, gre, and geneve can be built as separate
modules and are loaded on demand. Modules can be unloaded after use.
Datapath ports keep a reference to the vport module during their
lifetime.
Allows to remove the error prone maintenance of the global list
vport_ops_list.
Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Also folds in the follow-up commits 9ba559d9ca3 to turned the non-GPL
symbol exports to GPL exports, and fa2d8ff4e35 which fixes a module
reference release bug.
Exports various backwards compat functions linked into the main
openvswitch module as GPL symbols to ensure vport modules can use them.
Some fiddling with the Makefile was needed to work around the fact
that Makefile variables can't contain '-' characters needed to define
'vport-xxx' module sources. Also, Kbuild complains heavily if a
$(module)-y = $(module).o is defined which is actually backed with a .c
file of the same name. Therefore, a new $(build_multi_modules) variable
is defined which lists all module which consist of more than one source
file.
Upstream: 62b9c8d0372 ("ovs: Turn vports with dependencies into separate modules")
Upstream: 9ba559d9ca3 ("openvswitch: Export symbols as GPL symbols.")
Upstream: fa2d8ff4e35 ("openvswitch: Return vport module ref before destruction") Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Ben Pfaff [Fri, 3 Apr 2015 22:10:57 +0000 (15:10 -0700)]
acinclude: Always assume buggy strtok_r() for glibc < 2.8.
Lately our internal build system has been seeing intermittent failures that
I can't explain. With old glibc versions, the "configure" time check will
pass, but the equivalent (almost identical) "make check" test will fail.
One possibility, I guess, is that occasionally address space randomization
will put valid data at the 0xc0ffee address that the test assumes will
segfault, and another is that some change in compiler optimization flags
is making a difference. At any rate, I think it's safe to just always
assume that this strtok_r() bug is present whenever glibc before 2.8 is
in use.
Specifically we've seen this happen intermittently when building against
the XenServer DDK 5.6.100 build 39265, which uses glibc 2.5.
Reported-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Russell Bryant [Thu, 2 Apr 2015 21:51:49 +0000 (17:51 -0400)]
INSTALL.md: Add note about EXTRA_CFLAGS.
Add a note about the use of EXTRA_CFLAGS to provide custom CFLAGS for
the build of the Linux kernel module.
This addition is technically in the "configuring the sources" section
of the document. However, it's the spot where custom CFLAGS is
discussed already, so that seemed like the best place to put it.
Alternatively, it could go in the "Building the Sources" section
instead.
Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Added a new IOCTL in order to retrieve the PID from the kernel datapath.
The new method uses a direct and cleaner way, as opposed to the old way
of using a Netlink transaction, avoiding the unnecessary overhead.
Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/31 Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Wed, 1 Apr 2015 23:11:19 +0000 (16:11 -0700)]
bridge: Execute bridge_run() only after retrieving db contents.
During upgrade of ovs-vswitchd, we do not want to recreate the already
configured kernel interfaces. Especially when IP address is assigned to
the internal port, the recreation will cause the lost of connection.
Therefore, ovs-vswitchd should read current ovsdb content first and then
reuse the existing kernel interfaces that are configured in ovsdb. In
terms of the code language, ovs-vswitchd should only execute bridge_run()
after it finishes reading the ovsdb content.
However, this expected behavior is broken by the recent commit d18e52e
(ovsdb-idl: Tolerate missing tables and columns.) which causes the
execution of bridge_run() before getting the hint of configured interfaces
from ovsdb.
To fix the issue, this commit makes sure that the execution of bridge_run()
happens only after retrieving the ovsdb contents.
Ben Pfaff [Fri, 20 Mar 2015 06:45:42 +0000 (23:45 -0700)]
ovsdb-idl: Tolerate missing tables and columns.
Until now, if ovs-vsctl (or another client of the C ovsdb-idl library) was
compiled against a schema that had a column or table that was not in the
database actually being used (e.g. during an upgrade), and the column or
table was selected for monitoring, then ovsdb-idl would fail to get any
data at all because ovsdb-server would report an error due to a request
about a column or a table it didn't know about.
This commit fixes the problem by making ovsdb-idl retrieve the database
schema from the database server and omit any tables or columns that don't
exist from its monitoring request. This works OK for the kinds of upgrades
that OVSDB otherwise supports gracefully because it will simply make the
missing columns or tables appear empty, which clients of the ovsdb-idl
library already have to tolerate.
VMware-BZ: #1413562 Reported-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Alin Serdean [Tue, 31 Mar 2015 19:16:58 +0000 (19:16 +0000)]
lockfile: Support \-delimited file names in lockfile_name().
Currently paths that have only forward slashes like the following
"C:/package/binaries/conf.db" work seamlessly.
If we try the native windows filepaths i.e. "C:\package\binaries\conf.db" we
will hit the following problem:
2015-03-31T15:54:17Z|00001|lockfile|WARN|.c:\package\binaries\conf.db.~lock~:
failed to open lock file: Invalid argument
2015-03-31T15:54:17Z|00002|lockfile|WARN|.c:\package\binaries\conf.db.~lock~:
failed to lock file: Invalid argument
ovsdb-server: I/O error: c:\package\binaries\conf.db: failed to lock lockfile
(Invalid argument)
In this patch we update the lockfile_name function to also look for
backslashes, and also accommodate if we have a mix of backslashes and forward
slashes.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
[blp@nicira.com simplified the code] Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Sun, 29 Mar 2015 22:49:29 +0000 (15:49 -0700)]
hmap: Don't include ovs-atomic.h unnecessarily.
GNU C++ isn't too happy with ovs-atomic.h. We could fix that (maybe we
should) but the report I received from a C++ user implied to me that it
would be just as useful to just drop the unnecessary #include
"ovs-atomic.h" from hmap.h.
Reported-by: Michael Hu <humichael@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>