Ben Pfaff [Thu, 23 Jan 2014 23:35:22 +0000 (15:35 -0800)]
Makefile: Compile Linux-specific files based on __linux__ macro.
We want to conditionally compile several files based on whether we're
building for a Linux host, so we need some Automake conditional for that.
Previously this was based on whether Netlink is available and we're not
on ESX (since ESX has Netlink but isn't Linux), but it's more
straightforward to just test for Linux directly.
CC: Luigi Rizzo <rizzo@iet.unipi.it> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 23 Jan 2014 23:33:25 +0000 (15:33 -0800)]
Use __linux__ instead of LINUX_DATAPATH in C code.
The LINUX_DATAPATH C preprocessor symbol was originally meant to be used as
a signal for whether the Linux datapath module could be used, but it was
used as a proxy for a lot of other stuff that is really just Linux
specific. This commit switches all of these users to just test for
__linux__, which is more straightforward and should have the same result.
CC: Luigi Rizzo <rizzo@iet.unipi.it> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Sun, 2 Mar 2014 01:15:00 +0000 (17:15 -0800)]
tunnel: Do not set padding bits in tunnel mask.
On most architectures other than 32-bit x86, struct flow_tnl ends with 4
padding bytes. Until now, tnl_xlate_init() set those bytes to nonzero
values in the wildcard mask. When the wildcard mask passed through Netlink
attributes and back to userspace, the padding bytes of course became zero
again, which caused a wildcard mask mismatch and premature deletion of the
flow in revalidation. This commit fixes the problem.
Bug #1192516. Reported-by: Krishna Miriyala <miriyalak@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
Ben Pfaff [Sun, 2 Mar 2014 01:11:02 +0000 (17:11 -0800)]
odp-util: Include tun_id when nonzero even if "key" flag not set.
When a flow_tnl is being translated to Netlink attributes, the tun_id field
was included only if the FLOW_TNL_F_KEY flag was set. This meant that for
a mask, where one would not necessarily expect that flag to be set even if
there were a key, the tun_id could be omitted even if it were nonzero.
This led to kernel flows that did not match on a field that was required
to be matched (possibly causing incorrect treatment of packets) and
premature deletion of kernel flows due to mask mismatch. This commit
fixes the problem.
Bug #1192516. Reported-by: Krishna Miriyala <miriyalak@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
Ben Pfaff [Sat, 1 Mar 2014 00:20:17 +0000 (16:20 -0800)]
vconn: Fix vconn_get_status() return value when connection in progress.
When a connection takes a few rounds of the state machine to complete,
'error' gets filled with EAGAIN until that completes. This didn't match
the vconn_get_status() documentation, which says that it only returns a
positive errno value if there was an error. One could fix the problem
by updating the documentation (and the callers) or by updating the
implementation. I decided that the latter was the way to go because
the distinction between the TCP connection being in progress or complete
isn't visible to the client; what is visible to the client is the OpenFlow
negotiation being complete.
This problem is difficult to find in the unit tests because TCP connections
to localhost complete immediately.
Bug introduced by commit accaecc419cc57d (rconn: Discover errors in
rconn_run() even if rconn_recv() is never called.)
Reported-by: Anuprem Chalvadi <achalvadi@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Thu, 27 Feb 2014 02:08:04 +0000 (18:08 -0800)]
lib: simplify flow_extract() API
Change the flow_extract() API to accept struct pkt_metadata,
instead of individual metadata fields. It will make the API more
logical and easier to maintain when we need to expand metadata
down the road.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>¬
Ben Pfaff [Fri, 28 Feb 2014 21:12:04 +0000 (13:12 -0800)]
datapath: Correctly report flow used times for first 5 minutes after boot.
The kernel starts out its "jiffies" timer as 5 minutes below zero, as
shown in include/linux/jiffies.h:
/*
* Have the 32 bit jiffies value wrap 5 minutes after boot
* so jiffies wrap bugs show up earlier.
*/
#define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ))
The loop in ovs_flow_stats_get() starts out with 'used' set to 0, then
takes any "later" time. This means that for the first five minutes after
boot, flows will always be reported as never used, since 0 is greater than
any time already seen.
Bug #1192516. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Joe Stringer [Thu, 27 Feb 2014 22:13:10 +0000 (14:13 -0800)]
dpif: New function flow_dump_next_may_destroy_keys().
This new function allows callers to determine whether previously
returned keys will be modified or reallocated on the next call to
dpif_flow_dump_next(). This will be used in a future commit to allow
batched flow deletion by revalidator threads.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Thu, 27 Feb 2014 22:13:09 +0000 (14:13 -0800)]
dpif: Don't synchronize flow_dump_next() status.
Recent changes to the flow_dump_next() interface have made it the
responsibility of the dpif implementation to track error status over a
flow dump operation.
This patch removes status tracking from 'struct dpif_flow_dump', allowing
multiple threads to call dpif_flow_dump_next() and track their status
independently. Even if one thread finishes processing flows for a given
iterator and state, it will not prevent other callers from processing
the remaining flows in their buffers.
After this patch, the error code that dpif_flow_dump_next() returns is
only significant for the current state and buffer. As before, the status
of the entire flow dump operation can be obtained by calling
dpif_flow_dump_done().
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Thu, 27 Feb 2014 22:13:08 +0000 (14:13 -0800)]
dpif: Make dpif_flow_dump_next() thread-safe.
This patch makes it the caller's responsibility to initialize a
per-thread 'state' object and pass it down to the dpif_flow_dump_next()
implementation. The implementation can expect to be called from multiple
threads with the same 'iter' and different 'state' objects.
When flow_dump_next() returns non-zero, the implementation must ensure
that subsequent calls with the same arguments also return non-zero.
Subsequent calls with the same 'iter' and different 'state' may return
zero, but should make progress towards returning non-zero.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Thu, 27 Feb 2014 22:13:07 +0000 (14:13 -0800)]
dpif: Separate local and shared flow dump state.
This patch separates the structures for thread-local flow dump state
("state") from the shared flow dump state ("iter") in dpif-linux and
dpif-netdev. Future patches will make use of this to allow multiple
threads to dump flows from the same flow dump operation.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Thu, 27 Feb 2014 22:13:06 +0000 (14:13 -0800)]
netlink: Make nl_dump_next() thread-safe.
This patch modifies 'struct nl_dump' and nl_dump_next() to allow
multiple threads to share the same nl_dump. These changes are targeted
around synchronizing dump status between multiple callers, and
allowing callers to fully process their existing buffers before
determining whether to stop fetching flows.
The 'status' field of 'struct nl_dump' becomes atomic, so that multiple
threads may check and/or update it to communicate when there is an error
or the netlink dump is finished. The low bit holds whether the final
message was seen, while the higher bits hold an errno value.
nl_dump_next() will now read all messages from the given buffer before
checking the shared error status and attempting to fetch more. Multiple
threads may call this with the same nl_dump, but must provide
independent buffers. As previously, the final dump status can be
determined by calling nl_dump_done() from a single thread.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Thu, 27 Feb 2014 22:13:05 +0000 (14:13 -0800)]
netlink: Remove buffer from 'struct nl_dump'.
This patch makes all of the users of 'struct nl_dump' allocate their own
buffers to pass down to nl_dump_next(). This paves the way for allowing
multithreaded flow dumping.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 27 Feb 2014 19:06:30 +0000 (11:06 -0800)]
rconn: Discover errors in rconn_run() even if rconn_recv() is never called.
rconn_recv() calls vconn_recv(), which will report a connection error and
cause rconn_recv() to disconnect the rconn. Most rconn users regularly
call rconn_recv(), so that disconnection happens promptly. However,
the lswitch code only calls rconn_recv() after the connection negotiates an
OpenFlow version, so a connection that failed before negotiation would
never be detected as failed. This commit fixes the problem by making
rconn_run() also detect and handle connection errors.
The lswitch code is only used by the test-controller program, so this is
not an important bug fix.
Reported-by: Vasu Dasari <vdasari@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 27 Feb 2014 19:18:31 +0000 (11:18 -0800)]
tests: Re-fix a race.
Patch bf06c4fe (tests/ofproto-dpif.at: Workaround a race.), fixed a
race condition which patch 0a8763f (ofproto-dpif-upcall: Hardcode
max_idle to 1500ms.) unfixed.
Signed-off-by: Ethan Jackson <ethan@nicira.com> Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: Ben Pfaff <blp@nicira.com>
Flavio Leitner [Thu, 27 Feb 2014 12:16:34 +0000 (09:16 -0300)]
ovs-lib: allow non-root users to check service status
It tries to log the status operation, so although non-root
users can see the current status, the lack of permission
to write to the log results in an error message.
This changes to log only if the user has the permission to
write to the log file.
Joe Stringer [Wed, 26 Feb 2014 21:22:35 +0000 (13:22 -0800)]
dpif-linux: Lookup netdev to get netdev type string.
When creating tap ports in dpif-linux, the "tap" type is treated the
same as "system", and the type is discarded. When dumping datapath
port types, this would cause "tap" type to be reported as a "system"
type.
Each time we see a port of the wrong type in bridge_reconfigure(), we
remove it and add a port with the correct configuration. This would
always occur for tap ports, causing deletion and re-creation of all tap
ports each time the bridge was reconfigured.
This patch makes dpif-linux use netdev to look up port types if the
datapath reports that they are of type OVS_VPORT_TYPE_NETDEV.
Reported-by: James Schmidt <jschmidt@vmware.com> Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ctrl+C signals are a special case for Windows and can
be handled by registering a handle through
SetConsoleCtrlHandler() routine. This is only useful
when we run it directly on console and not as services in
the background.
Once we get a Ctrl+C signal, we call the cleanup functions
and then exit.
One thing to know here is that MinGW terminal handles
Ctrl+C signal differently (and looks a little buggy. I see
it exiting the handler midway with some sort of timeout).
So this implementation is only useful when run on Windows
terminal. Since we only use MinGW for compilation and
eventually to run unit tests, it should be okay. (The unit
tests would ideally use windows services and not expect
Ctrl+C)
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Windows does have pipes (the interface is a little different).
We mostly use pipes in Linux to synchronize between parent and
children and also to handle fatal signals and then wake from poll_loop().
For Windows, we are using events for the same purpose. So don't
implement pipes for Windows.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Windows does not have a SIGHUP or SIGALRM. It does have
a SIGINT and SIGTERM. The documentation at msdn says that
SIGINT is not supported for win32 applications because
WIN32 operating systems generate a new thread to specifically
handle Ctrl+C.
This commit handles SIGTERM for Windows. The documentation also
states that nothing generates SIGTERM in Windows, but one can
use raise(SIGTERM) to manage it. The idea for handling SIGTERM
for Windows is to just have a place holder if there is need to
raise() a signal for some other purpose.
We use SIGALRM in timeval.c if we wake up from a sleep after
'deadline'. For Windows, print an error message and then
use SIGTERM.
There is an atexit() function for Windows, so we can call cleanup
functions during exit.
An upcoming commit separately handles Ctrl+C so that we can call
clean up functions for that use case.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
I have not seen a use case where the "lib" prefix is needed.
In my tests, I see that adding the additional "lib" prefix
causes libraries to not be recognized.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 26 Feb 2014 19:12:57 +0000 (11:12 -0800)]
ofproto: Send port status message for port-mods, right away.
Until now, when it processes OFPT_PORT_MOD message, Open vSwitch has waited
for ports to notify it that their status has changed before it sends a
port status update to controllers.
Also, Open vSwitch never sent port config updates at all for port
modifications other than OFPPC_PORT_DOWN. I guess that this is a relic
from the era when there was only one controller, since presumably the
controller already knew that it changed the port configuration. But in the
multi-controller world, it makes sense to send such port status updates,
and I couldn't quickly find anything in OF1.3 or OF1.4 that said they
shouldn't be sent.
EXT-338. Signed-off-by: Ben Pfaff <blp@nicira.com> Reported-by: Kmindg G <kmindg@gmail.com>
YAMAMOTO Takashi [Mon, 24 Feb 2014 02:46:59 +0000 (11:46 +0900)]
socket-util: Fix set_dscp for IPv6
Try IPPROTO_IPV6/IPV6_TCLASS socket option as well as IPPROTO_IP/IP_TOS
so that this can work for IPv6 sockets.
IPPROTO_IP/IP_TOS socket option is, as it's SOL indicates, for IPv4.
What happens when it's used for IPv6 sockets? On Linux, it seems to
be forwarded to IPv4 code and affects IPv4 part of the socket.
(e.g. non-V6ONLY case) But it doesn't seem to be the intention of
this function. On other platforms including NetBSD, it just fails
with ENOPROTOOPT.
Probably this function should take the address family but passing
it around lib/*stream*.c would be a bigger change.
Joe Stringer [Tue, 11 Feb 2014 21:55:36 +0000 (13:55 -0800)]
upcall: Remove datapath flows when setting n-threads.
Previously, we would delete all ukeys when changing the number of
threads, but leave all flows in the datapath. This would cause
double-counting of stats for any flows that remain in the datapath. This
patch fixes the issue by ensuring that all flows are deleted from the
datapath before changing the number of threads.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Tue, 11 Feb 2014 21:55:35 +0000 (13:55 -0800)]
upcall: Delete flows that were not recently dumped.
Previously, we would clean up the ukeys whose flow was not seen in the
most recent dump, while leaving the flow in the datapath. In the
unlikely case that the datapath fails to dump a flow that still exists
in the datapath, this would cause double-counting of those flow stats.
This is currently very rare to see due to batching of datapath flow
deletion, but is more easily observable with upcoming patches which
modify the batch size based on dpif implementation.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Tue, 11 Feb 2014 21:55:33 +0000 (13:55 -0800)]
upcall: Defer ukey deletion until after pushing stats.
It is possible for a datapath to dump the same flow twice, for instance
if the flow is the last in a batch of flows to be dumped, then a new
flow is inserted into the same bucket before the flow dumper fetches
another batch.
In this case, datapath flow stats may be duplicated: The revalidator
records the stats from the first flow, using the ukey to get the stats
delta. The ukey is deleted, then the revalidator reads the second
(duplicate) flow and cannot lookup the ukey for the delta. As such, it
will push the stats as-is.
This patch reduces the likelihood of such stats duplications by
deferring ukey deletion until after stats are pushed for deleted flows.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 25 Feb 2014 16:01:01 +0000 (08:01 -0800)]
ofproto-dpif: Complete all packet translations before freeing an ofproto.
The following scenario can occur:
1. Handler thread grabs a pointer to an ofproto in handle_upcalls().
2. Main thread removes ofproto and destroys it in destruct().
3. Handler thread uses pointer to ofproto and accesses freed memory.
BOOM!
Each individual step above happens under the xlate_rwlock, but the ofproto
pointer is retained from step 1 to step 3, hence the problem. This commit
fixes the problem by ensuring that after an ofproto is removed but before
it is destroyed, all packet translations get pushed all the way through
the upcall handler pipeline. (No new packet translations can get a pointer
to the removed ofproto.)
Bug #1200351. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
We are registering an interest in SIGHUP to reopen
log files. But there is an 'ovs-appctl vlog/reopen'
command that does the same and is used in the
logrotate config for the distributions.
So remove the redundant functionality.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 21 Feb 2014 18:53:49 +0000 (10:53 -0800)]
ovs-thread: Use fair (but nonrecursive) rwlocks on glibc.
glibc supports two kinds of rwlocks:
- The default kind of rwlock always allows recursive read-locks to
succeed, but threads blocked on acquiring the write-lock are treated
unfairly, causing them to be delayed indefinitely as long as new
readers continue to come along.
- An alternative "writer nonrecursive" rwlock allows recursive
read-locks to succeed only if there are no threads waiting for the
write-lock. Otherwise, recursive read-lock attempts deadlock in
the presence of blocking write-lock attempts. However, this kind
of rwlock is fair to writer.
POSIX allows the latter behavior, which essentially means that any portable
pthread program cannot try to take read-locks recursively. Since that's
true, we might as well use the latter kind of rwlock with glibc and get the
benefit of fairness of writers.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
Ben Pfaff [Sat, 22 Feb 2014 00:27:00 +0000 (16:27 -0800)]
ofproto-dpif-xlate: Avoid recursively taking read side of ofgroup rwlock.
With glibc, rwlocks by default allow recursive read-locking even if a
thread is blocked waiting for the write-lock. POSIX allows such attempts
to deadlock, and it appears that the libc used in NetBSD, at least, does
deadlock. ofproto-dpif-xlate could take the ofgroup rwlock recursively if
an ofgroup's actions caused the ofgroup to be executed again. This commit
avoids that issue by preventing recursive translation of groups (the same
group or another group). This is not the most user friendly solution,
but OpenFlow allows this restriction, and we can always remove the
restriction later (probably requiring more complicated code) if it
proves to be a real problem to real users.
Found by inspection.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
get_null_fd() is only called from daemon.c.
It does not need thread safety features anymore as
it is called either through daemonize_start() or
indirectly through daemonize_complete() once.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Also, Windows does not have a MSG_DONTWAIT. Get rid of it
as we always use non-blocking sockets.
Co-authored-by: Linda Sun <lsun@vmware.com> Signed-off-by: Linda Sun <lsun@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
get_max_fds() is used only from process.c. Move it there
along with rlim_is_finite(). Since process_start() can only
be called before any additional threads are created, we
no longer need the thread safety checks in get_max_fds().
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 21 Feb 2014 18:50:56 +0000 (10:50 -0800)]
ovs-thread: Get rid of obsolete sparse wrappers.
These were useful back when we were trying to use the sparse lock balance
annotations, but we removed those in commit 47b52c71232c0 (sparse: Remove
support for thread-safety annotations.) and so they serve no purpose any
longer.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
There is no direct mapping for the ioctl function in
Windows. As of now, af_inet_ioctl() is being used for Linux
and BSD. So, don't try to compile it for Windows.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
In windows there is no clear way to distinguish between a
socket fd and a file fd.
We use the function, describe_fd() mostly for debugging.
For now, return a generic statement.
Co-authored-by: Linda Sun <lsun@vmware.com> Signed-off-by: Linda Sun <lsun@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
There is no corresponding function for Windows.
open() does not work on directories.
There is a function _commit(fd), but that is only meant
for files.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Co-authored-by: Linda Sun <lsun@vmware.com> Signed-off-by: Linda Sun <lsun@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 20 Feb 2014 20:13:26 +0000 (12:13 -0800)]
ofproto: Update only OFPUTIL_PS_LINK_DOWN (not STP) from netdev state.
When a netdev indicates that its state or configuration has changed,
update_port() updates the OpenFlow port to match the changes. However,
this was being taken too far: a netdev does not have an STP state, and a
state change was resetting the STP state of the port. This fixes the
problem.
Simon Horman [Thu, 20 Feb 2014 04:48:10 +0000 (13:48 +0900)]
tests/run-ryu: Correct logfile reporting
$logfile is already prefixed by "$sandbox/" and suffixed by ".log"
so do not duplicate this prefix and suffix combination when appending
$logfile to $logs.
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 15 Jan 2014 20:59:16 +0000 (12:59 -0800)]
netdev: Change netdev_class_rwlock to recursive mutex, for POSIX safety.
With glibc, rwlocks by default allow recursive read-locking even if a
thread is blocked waiting for the write-lock. POSIX allows such attempts
to deadlock, and it appears that the libc used in NetBSD, at least, does
deadlock. The netdev_class_rwlock is in fact acquired recursively in this
way, which is a bug. This commit fixes the problem by switching to a
recursive mutex. This allows for less parallelism, but according to an
existing comment that doesn't matter here anyway.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
As of now, we are using the process subsystem in
ovsdb-server to handle the "--run" command line
option. That particular option is not used often
and till deemed necessary, make it unsupported on
Windows platform.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 12 Feb 2014 01:13:02 +0000 (10:13 +0900)]
packets: Always set ethertype in push_mpls()
There are two different MPLS ethertypes, 0x8847 and 0x8848 and a push MPLS
action applied to an MPLS packet may cause the ethertype to change from one
to the other. To ensure that this happens update the ethertype in
push_mpls() regardless of if the packet is already MPLS or not.
Test based on a similar test by Joe Stringer.
Cc: Joe Stringer <joestringer@nicira.com> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Wed, 12 Feb 2014 01:13:01 +0000 (10:13 +0900)]
tests: Add MPLS push on MPLS test.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Co-Authored-By: Simon Horman <horms@verge.net.au> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ansis Atteka [Tue, 18 Feb 2014 21:19:36 +0000 (13:19 -0800)]
ovs-vsctl: reconnect to the database if connection was dropped
If ovs-vsctl has to wait for ovs-vswitchd to reconfigure itself
according to the new database, then sometimes ovs-vsctl could
end up stuck in the event loop if OVSDB connection was dropped
while ovs-vsctl was still running.
This patch fixes this problem by letting ovs-vsctl to reconnect
to the OVSDB, if it has to wait cur_cfg field to be updated.
Joe Stringer [Wed, 19 Feb 2014 18:26:31 +0000 (10:26 -0800)]
ofproto: Remove 'force-miss-model' configuration.
This configuration item was introduced to assist testing of upcall
handling behaviour with and without facets. Facets were removed in
commit e79a6c833e0d7237, so this patch removes the configuration item.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 19 Feb 2014 12:27:16 +0000 (21:27 +0900)]
ofp-actions: Correct pop MPLS ethtype as consistency test
Correct pop MPLS ethtype consistency check to verify that
the packet has an MPLS ethtype before the pop action rather than after:
an MPLS ethtype is a pre-condition but not a post-condition of pop MPLS.
With this change the consistency check in ofpact_check__()
becomes consistent with that in ofpact_from_nxast().
This was found using Ryu tests via the new make check-ryu target.
It allows all of the "POP_MPLS"[1] tests to pass where they previously
failed.