Alex Wang [Fri, 21 Feb 2014 22:03:50 +0000 (14:03 -0800)]
dpif-netdev: Call ovs_refcount_destroy() before free().
This commit makes dp_netdev_flow_unref() and dp_netdev_actions_unref()
invoke the ovs_refcount_destroy() before freeing the corresponding
pointer.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 21 Feb 2014 20:40:00 +0000 (12:40 -0800)]
ofproto-dpif: Fix segfault removing port when STP is enabled.
Reported-by: Sridhar Samudrala <samudrala.sridhar@gmail.com>
Tested-by: Sridhar Samudrala <samudrala.sridhar@gmail.com>
Signed-off-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>
Ben Pfaff [Fri, 21 Feb 2014 16:45:03 +0000 (08:45 -0800)]
FAQ: Describe how to add new OpenFlow messages.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Gurucharan Shetty [Wed, 19 Feb 2014 20:41:04 +0000 (12:41 -0800)]
socket-util: af_inet_ioctl() for Windows.
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>
Gurucharan Shetty [Wed, 19 Feb 2014 19:33:09 +0000 (11:33 -0800)]
socket-util: Describe fd for Windows.
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>
Gurucharan Shetty [Wed, 19 Feb 2014 17:11:04 +0000 (09:11 -0800)]
socket-util: getsockopt for Windows.
Windows defines the 'optval' argument as char * instead of void *.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Wed, 19 Feb 2014 16:47:56 +0000 (08:47 -0800)]
socket-util: fsync directory for Windows.
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>
Gurucharan Shetty [Tue, 18 Feb 2014 23:09:18 +0000 (15:09 -0800)]
socket-util: closesocket() for Windows.
For Windows sockets, one has to call closesocket() to
close the sockets.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Tue, 18 Feb 2014 17:26:27 +0000 (09:26 -0800)]
socket-util: getaddrinfo return values for Windows.
Couple of return values need changes.
* EAI_NODATA is the same as EAI_NONAME. So we prevent duplicate cases.
* Windows does not have a EAI_SYSTEM.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Tue, 18 Feb 2014 15:43:26 +0000 (07:43 -0800)]
socket-util: set_nonblocking for Windows.
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>
Gurucharan Shetty [Tue, 18 Feb 2014 18:25:13 +0000 (10:25 -0800)]
socket-util: Move sock_errno() to socket-util.
And add more users.
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.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reported-by: Vasu Dasari <vdasari@gmail.com>
Tested-by: Vasu Dasari <vdasari@gmail.com>
YAMAMOTO Takashi [Thu, 20 Feb 2014 02:11:00 +0000 (11:11 +0900)]
ofp-util: Avoid gcc warning on NetBSD
Avoid the following warning caused by the combination
of NetBSD's htons implementation and gcc bug.
Now --enable-Werror build succeeds on NetBSD-6.
lib/ofp-util.c: In function 'ofputil_match_from_ofp10_match':
lib/ofp-util.c:174:15: error: integer overflow in expression
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
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>
Joe Stringer [Tue, 18 Feb 2014 17:39:12 +0000 (09:39 -0800)]
ofproto-provider: Update documentation.
This wording was in ofproto.c, but missing from ofproto-provider.h.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Wed, 12 Feb 2014 19:20:29 +0000 (11:20 -0800)]
FAQ: Mention hairpinning under actions=in_port.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Pravin [Wed, 19 Feb 2014 22:29:39 +0000 (14:29 -0800)]
datapath: Fix build failure.
Defines RCU_INIT_POINTER() for compatibility.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Romain Lenglet [Wed, 19 Feb 2014 22:23:39 +0000 (14:23 -0800)]
ipfix: add SCTP, ICMP, and ICMPv6 flow reporting
Signed-off-by: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Fri, 14 Feb 2014 22:07:34 +0000 (14:07 -0800)]
process: Make changes for Windows.
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>
Gurucharan Shetty [Fri, 14 Feb 2014 19:12:41 +0000 (11:12 -0800)]
ovs-vswitchd: Get rid of call to process_init().
It is not needed as we don't use any other process_* calls.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Romain Lenglet [Tue, 11 Feb 2014 23:21:08 +0000 (15:21 -0800)]
ipfix: fix upcall cookie size checks to support 8 byte cookies
Commit
96ed775f resizes all userspace metadata to be 8 bytes minimum.
Fix the upcall size checks accordingly.
Signed-off-by: Romain Lenglet <rlenglet@vmware.com>
Signed-off-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.
Issue: 1191997
Reported-by: Spiro Kourtessis <spiro@nicira.com>
Signed-Off-By: Ansis Atteka <aatteka@nicira.com>
Ben Pfaff [Sat, 18 Jan 2014 01:49:55 +0000 (17:49 -0800)]
configure: Fix bug report email address.
Reported-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
Simon Horman [Wed, 12 Feb 2014 07:31:03 +0000 (16:31 +0900)]
packet: Make set_ethertype() static
Make set_ethertype() static as it is not used outside of packet.c
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
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.
[1] http://osrg.github.io/ryu-certification/switch/ovs
Cc: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
YAMAMOTO Takashi [Mon, 17 Feb 2014 08:14:17 +0000 (17:14 +0900)]
tests/run-ryu: Fix setup for Ryu tests
Tweak our configuration to match with Ryu tests' single-bridge assumption.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Tested-by: Simon Horman <horms@verge.net.au>
YAMAMOTO Takashi [Mon, 17 Feb 2014 08:14:16 +0000 (17:14 +0900)]
tests/run-ryu: Fix log file names
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Tested-by: Simon Horman <horms@verge.net.au>
kmindg [Wed, 19 Feb 2014 13:45:46 +0000 (21:45 +0800)]
ofp-util: Fix a typo in ofputil_decode_ofp11_port
Signed-off-by: kmindg <kmindg@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Perches [Wed, 19 Feb 2014 19:08:50 +0000 (11:08 -0800)]
datapath: Use ether_addr_copy
It's slightly smaller/faster for some architectures.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Ben Pfaff [Wed, 19 Feb 2014 16:29:29 +0000 (08:29 -0800)]
OPENFLOW-1.1+: Update status of a few items.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
Ben Pfaff [Wed, 19 Feb 2014 18:29:43 +0000 (10:29 -0800)]
OPENFLOW-1.1+: Remove "rework tag order" and MPLS BoS matching from OF1.3.
OpenFlow 1.3.4 is going to revert the tag order change made by OpenFlow
1.3.
MPLS BoS matching is implemented.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
Jarno Rajahalme [Tue, 18 Feb 2014 17:07:03 +0000 (09:07 -0800)]
datapath: Per NUMA node flow stats.
Keep kernel flow stats for each NUMA node rather than each (logical)
CPU. This avoids using the per-CPU allocator and removes most of the
kernel-side OVS locking overhead otherwise on the top of perf reports
and allows OVS to scale better with higher number of threads.
With 9 handlers and 4 revalidators netperf TCP_CRR test flow setup
rate doubles on a server with two hyper-threaded physical CPUs (16
logical cores each) compared to the current OVS master. Tested with
non-trivial flow table with a TCP port match rule forcing all new
connections with unique port numbers to OVS userspace. The IP
addresses are still wildcarded, so the kernel flows are not considered
as exact match 5-tuple flows. This type of flows can be expected to
appear in large numbers as the result of more effective wildcarding
made possible by improvements in OVS userspace flow classifier.
Perf results for this test (master):
Events: 305K cycles
+ 8.43% ovs-vswitchd [kernel.kallsyms] [k] mutex_spin_on_owner
+ 5.64% ovs-vswitchd [kernel.kallsyms] [k] __ticket_spin_lock
+ 4.75% ovs-vswitchd ovs-vswitchd [.] find_match_wc
+ 3.32% ovs-vswitchd libpthread-2.15.so [.] pthread_mutex_lock
+ 2.61% ovs-vswitchd [kernel.kallsyms] [k] pcpu_alloc_area
+ 2.19% ovs-vswitchd ovs-vswitchd [.] flow_hash_in_minimask_range
+ 2.03% swapper [kernel.kallsyms] [k] intel_idle
+ 1.84% ovs-vswitchd libpthread-2.15.so [.] pthread_mutex_unlock
+ 1.64% ovs-vswitchd ovs-vswitchd [.] classifier_lookup
+ 1.58% ovs-vswitchd libc-2.15.so [.] 0x7f4e6
+ 1.07% ovs-vswitchd [kernel.kallsyms] [k] memset
+ 1.03% netperf [kernel.kallsyms] [k] __ticket_spin_lock
+ 0.92% swapper [kernel.kallsyms] [k] __ticket_spin_lock
...
And after this patch:
Events: 356K cycles
+ 6.85% ovs-vswitchd ovs-vswitchd [.] find_match_wc
+ 4.63% ovs-vswitchd libpthread-2.15.so [.] pthread_mutex_lock
+ 3.06% ovs-vswitchd [kernel.kallsyms] [k] __ticket_spin_lock
+ 2.81% ovs-vswitchd ovs-vswitchd [.] flow_hash_in_minimask_range
+ 2.51% ovs-vswitchd libpthread-2.15.so [.] pthread_mutex_unlock
+ 2.27% ovs-vswitchd ovs-vswitchd [.] classifier_lookup
+ 1.84% ovs-vswitchd libc-2.15.so [.] 0x15d30f
+ 1.74% ovs-vswitchd [kernel.kallsyms] [k] mutex_spin_on_owner
+ 1.47% swapper [kernel.kallsyms] [k] intel_idle
+ 1.34% ovs-vswitchd ovs-vswitchd [.] flow_hash_in_minimask
+ 1.33% ovs-vswitchd ovs-vswitchd [.] rule_actions_unref
+ 1.16% ovs-vswitchd ovs-vswitchd [.] hindex_node_with_hash
+ 1.16% ovs-vswitchd ovs-vswitchd [.] do_xlate_actions
+ 1.09% ovs-vswitchd ovs-vswitchd [.] ofproto_rule_ref
+ 1.01% netperf [kernel.kallsyms] [k] __ticket_spin_lock
...
There is a small increase in kernel spinlock overhead due to the same
spinlock being shared between multiple cores of the same physical CPU,
but that is barely visible in the netperf TCP_CRR test performance
(maybe ~1% performance drop, hard to tell exactly due to variance in
the test results), when testing for kernel module throughput (with no
userspace activity, handful of kernel flows).
On flow setup, a single stats instance is allocated (for the NUMA node
0). As CPUs from multiple NUMA nodes start updating stats, new
NUMA-node specific stats instances are allocated. This allocation on
the packet processing code path is made to never block or look for
emergency memory pools, minimizing the allocation latency. If the
allocation fails, the existing preallocated stats instance is used.
Also, if only CPUs from one NUMA-node are updating the preallocated
stats instance, no additional stats instances are allocated. This
eliminates the need to pre-allocate stats instances that will not be
used, also relieving the stats reader from the burden of reading stats
that are never used.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Jarno Rajahalme [Tue, 18 Feb 2014 17:07:03 +0000 (09:07 -0800)]
datapath: Remove 5-tuple optimization.
The 5-tuple optimization becomes unnecessary with a later per-NUMA
node stats patch. Remove it first to make the changes easier to
grasp.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Jiri Pirko [Sun, 16 Feb 2014 01:30:23 +0000 (17:30 -0800)]
datapath: fix dp check in ovs_dp_reset_user_features
This fixes crash when userspace does "ovs-dpctl add-dp dev" where dev is
existing non-dp netdevice.
Introduced by:
commit
94358dcffbec33cbcfd425e925139fd7e9d6153f
"openvswitch: Drop user features if old user space attempted to create datapath"
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Ben Pfaff [Fri, 14 Feb 2014 18:34:58 +0000 (10:34 -0800)]
tests: Add support for automatically running Ryu tests against OVS.
The Ryu controller comes with an extensive library of OpenFlow tests, but
it doesn't seem so easy to me to run all of them against a development
version of Open vSwitch. This commit introduces a Makefile target so that
one can run all the Ryu tests with a simple "make check-ryu".
This commit adds documentation for the new target to INSTALL. It also
moves the documentation for the "check-oftest" target and the
--enable-coverage configure option into INSTALL.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Gurucharan Shetty [Fri, 14 Feb 2014 16:12:32 +0000 (08:12 -0800)]
util: Pre-allocate buffer for ovs_lasterror_to_string().
This lets us call ovs_lasterror_to_string() and not having
to do an extra call of LocalFree() on the returned string.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Thu, 13 Feb 2014 18:50:00 +0000 (10:50 -0800)]
lockfile: Implementation for Windows platform.
Start with a simple implementation that does not support
symbolic links.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Thu, 13 Feb 2014 18:34:39 +0000 (10:34 -0800)]
util: follow_symlinks() for windows.
Start with not supporting symbolic links for windows.
This is useful for an upcoming commit.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Thu, 13 Feb 2014 18:26:03 +0000 (10:26 -0800)]
string: strerror_r() for windows.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Thu, 13 Feb 2014 18:21:04 +0000 (10:21 -0800)]
util: Make xreadlink a static function.
It is only used in util.c
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Wed, 12 Feb 2014 17:27:11 +0000 (09:27 -0800)]
ofproto-dpif: Use adaptive mutex for stats.
Stats critical sections are held for very short time, so it makes
sense to spin on them for a while rather than sleeping immediately.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Tue, 4 Feb 2014 23:47:39 +0000 (15:47 -0800)]
ovs-thread: Add support for pthread adaptive mutex
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Tue, 11 Feb 2014 23:34:39 +0000 (15:34 -0800)]
datapath: Fix race.
ovs_vport_cmd_dump() did rcu_read_lock() only after getting the
datapath, which could have been deleted in between. Resolved by
taking rcu_read_lock() before the get_dp() call.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Jarno Rajahalme [Tue, 11 Feb 2014 17:49:30 +0000 (09:49 -0800)]
ofproto: Move 'rule->used' to the provider.
Rule's 'used' timestamp is updated at the same time with the other
stats. So far the 'used' has been updated without proper protection,
which may lead to 'tearing' in 32-bit architectures, resulting in an
incorrect 'used' timestamp. While in practice this is highly
improbable, it is still better to handle this correctly.
This is resolved by moving the 'used' field to the provider's stats,
so that whatever protection is used for updating packet and byte
counts, can be also used for both reading and writing of the 'used'
timestamp.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 7 Feb 2014 19:34:02 +0000 (11:34 -0800)]
ofproto: Optimize the case of a repeated learn action execution.
When the target flow exists already as intended, only the 'modified'
time needs to be updated. Allow modification without taking the
'ofproto_mutex' by always using the 'rule->mutex' when accessing the
'modified' time.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 7 Feb 2014 19:34:01 +0000 (11:34 -0800)]
ofproto: Lock for vlan splinters only if have them.
Reading the hmap count for determining if it is empty or not is thread
safe, so avoid locking when not necessary.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Sat, 8 Feb 2014 01:25:42 +0000 (17:25 -0800)]
netdev-dummy: Reduce reconnect back off timeout
netdev-dummy will mostly be used for testing and debugging over fairly
reliable connection. Reduce reconnect back off timeout in case the first
connect attempt failed.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Andy Zhou [Fri, 7 Feb 2014 22:45:14 +0000 (14:45 -0800)]
netdev-dummy: Fix reconnecting.
The netdev-dummy unit test ran into the reconnect condition on Jarno's
machine. With his test environment, we found and fixed the bugs in
handling reconnect.
Co-authored-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Jarno Rajahalme [Fri, 7 Feb 2014 19:34:02 +0000 (11:34 -0800)]
meta-flow: Fix setting MFF_IP_FRAG.
mf_set_flow_value() was not setting 'flow->nw_frag' properly.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Ben Pfaff [Tue, 11 Feb 2014 23:13:56 +0000 (15:13 -0800)]
tunnel: Support all combinations of flow-based and specific tunnel matches.
There are 12 possible ways to specify a tunnel (2 * 2 * 3 == 12):
- Specific in_key or flow-based (2 choices).
- Specific ip_dst or flow-based (2 choices).
- Specific ip_src, wildcarded, or flow-based (3 choices).
Until now, only 6 of the 12 possibilities have been supported. We
have had a couple of requests to add another. This commit adds all the
possibilities, so that we won't have to add the other 6 one by one.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Requested-by: Thomas Morin <thomas.morin@orange.com>
Acked-by: pritesh <pritesh.kothari@cisco.com>
Alex Wang [Thu, 6 Feb 2014 23:46:05 +0000 (15:46 -0800)]
bond: Change the way of assigning bond slave for unassigned bond entry.
Before this commit, ovs randomly selects a slave for unassigned
bond entry. If the selected slave is not enabled, the active slave
is chosen instead. In this commit, the slave is selected from the
list of all enabled slaves in a round-robin fashion. This helps
improve the consistency of bond behavior when new flows are added.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Sat, 8 Feb 2014 00:39:54 +0000 (16:39 -0800)]
tests: Fix MPLS test cases.
The "userspace" MPLS test case was checking the same things as the
"drop" test case, rather than checking to see that packets were being
sent to userspace. This patch makes the testsuite consistent with itself.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Sat, 8 Feb 2014 00:39:53 +0000 (16:39 -0800)]
flow: Copy MPLS label on mpls_push.
OpenFlow 1.3.3 spec (and earlier) specify that the default value for an
MPLS label should be copied from the outer header.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Sat, 8 Feb 2014 00:39:52 +0000 (16:39 -0800)]
tests: Add basic MPLS push test.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Thu, 6 Feb 2014 15:57:12 +0000 (07:57 -0800)]
stream-ssl: Add support for Windows platform.
This commit creates events and through poll_fd_wait_event()
associates them with socket file descriptors to get woken up
from poll_block().
Some other changes:
* Windows does not have sys/fcntl.h but has a fcntl.h
On Linux, there is fctnl.h too.
* include <openssl/applink.c> to handle different C-Runtime linking
of OVS and openssl libraries as suggested at
https://www.openssl.org/support/faq.html#PROG2
The above include will not be needed if we compile Open vSwitch with
/MD compiler option.
* SHUT_RDWR is equivalent to SD_BOTH on Windows.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Thu, 6 Feb 2014 03:50:10 +0000 (19:50 -0800)]
socket-util: error number to string for sockets.
For winsock2 functions, error number has to be converted to string
using FormatMessage().
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Wed, 5 Feb 2014 18:10:10 +0000 (10:10 -0800)]
poll-loop: Make poll_fd_wait_event() cross-platform.
This is helpful if we want to wait either on 'fd' for POSIX or
events for Windows.
For Windows, if both 'fd' and 'wevent' is specified, we associate
that event with the 'fd' using WSAEventSelect() in poll_block().
So any 'events' on that 'fd' will wake us up from WaitForMultipleObjects().
WSAEventSelect() does not understand POLLIN, POLLOUT etc. Instead the
macros it understands are FD_READ, FD_ACCEPT, FD_CONNECT, FD_CLOSE etc.
So we need to make that transition.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 10 Feb 2014 18:57:08 +0000 (10:57 -0800)]
tests: Add missing banner.
Reported-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 11 Feb 2014 16:24:16 +0000 (08:24 -0800)]
ofproto-dpif-xlate: Make flows that match ICMP fields revalidate correctly.
ICMPv4 and ICMPv6 have 8-bit "type" and "code" fields. struct flow
uses the low 8 bits of the 16-bit tp_src and tp_dst members to
represent these fields. The datapath interface, on the other hand,
represents them with just 8 bits each. This means that if the high 8
bits of the masks for these fields somehow become set (meaning to
match on the nonexistent "high bits" of these fields) during
translation, then they will get chopped off by a round trip through
the datapath, and revalidation will spot that as an inconsistency and
delete the flow. This commit avoids the problem by making sure that
only the low 8 bits of either field can be unwildcarded for ICMP.
This seems like the minimal fix for this problem, appropriate for
backporting to earlier branches. The root of the issue is that these high
bits can get set in the match at all. I have some leads on that, but they
require more invasive changes elsewhere.
Bug #23320.
Reported-by: Krishna Miriyala <miriyalak@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Tue, 4 Feb 2014 17:01:16 +0000 (09:01 -0800)]
pcap-file: Allow capturing TCP streams where the SYN is not seen.
Until now, the tcp_stream() code has ignored any TCP packets that don't
correspond to a stream that began with a TCP SYN. This commit changes the
code so that any TCP packet that contains a payload starts a new stream.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reported-by: Vasu Dasari <vdasari@gmail.com>
Joe Stringer [Thu, 6 Feb 2014 17:49:19 +0000 (09:49 -0800)]
upcall: Add appctl call to set flow_limit.
This should assist testing of datapath performance, as it allows us to
skip "warming up" the flow limit value.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Mon, 10 Feb 2014 16:52:25 +0000 (08:52 -0800)]
datapath: Read tcp flags only then the tranport header is present.
Only the first IP fragment can have a TCP header, check for this.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Joe Stringer [Fri, 7 Feb 2014 23:38:07 +0000 (15:38 -0800)]
tests: Don't rely on strace for IPv6 IDL testcases.
This would cause testsuite failures if someone runs the testsuite
without strace installed.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Fri, 7 Feb 2014 20:50:17 +0000 (12:50 -0800)]
netdev-dummy: disable periodic probing
netdev-dummy is mostly useed over reliable link for testing. Periodic
probing over those links seem overkill.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Tue, 4 Feb 2014 23:16:01 +0000 (15:16 -0800)]
ofproto: Update documentation
'cls' is no longer a parameter to this function.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 6 Feb 2014 23:05:04 +0000 (15:05 -0800)]
collectors: Improve log message to better describe errors.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 7 Feb 2014 01:06:00 +0000 (17:06 -0800)]
ovs-thread: Add a comment.
Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 7 Feb 2014 16:02:24 +0000 (08:02 -0800)]
FAQ: Correct typo.
Reported-by: Pasi Kärkkäinen <pasik@iki.fi>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 7 Feb 2014 05:30:42 +0000 (21:30 -0800)]
FAQ: Describe the state of MPLS in Open vSwitch.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Simon Horman <horms@verge.net.au>
Simon Horman [Wed, 5 Feb 2014 00:45:37 +0000 (09:45 +0900)]
tests: Add MPLS + VLAN tests.
Originally part of "odp: Allow VLAN actions after MPLS actions"
by Joe Stringer.
Co-authored-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 4 Feb 2014 20:39:37 +0000 (12:39 -0800)]
Always insert MPLS labels after VLAN tags.
OpenFlow 1.1 and 1.2 always inserted MPLS labels after VLAN tags.
OpenFlow 1.3 and 1.4 insert MPLS labels before VLAN tags.
OpenFlow 1.3.4 and 1.5, both in preparation, recognize that the change in
1.3 was an error and revert it. This commit implements that reversion
in Open vSwitch.
EXT-457.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Simon Horman <horms@verge.net.au>
YAMAMOTO Takashi [Wed, 5 Feb 2014 10:08:12 +0000 (19:08 +0900)]
ofproto-dpif.at: Avoid races in "ofproto-dpif - dummy interface"
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
YAMAMOTO Takashi [Wed, 5 Feb 2014 10:08:10 +0000 (19:08 +0900)]
netdev-bsd: Fix tx/rx stats for type=tap netdev
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Arun Sharma [Fri, 7 Feb 2014 00:04:05 +0000 (16:04 -0800)]
Add IPv6 support for OpenFlow, OVSDB, NetFlow, and sFlow.
Does not add IPv6 support for in-band control.
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Nandan Nivgune <nandan.nivgune@calsoftinc.com>
Signed-off-by: Abhijit Bhopatkar <abhijit.bhopatkar@calsoftinc.com>
Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Wed, 5 Feb 2014 05:58:03 +0000 (21:58 -0800)]
datapath: Fix kernel style issues.
Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
YAMAMOTO Takashi [Fri, 24 Jan 2014 01:31:14 +0000 (10:31 +0900)]
ofproto-dpif.at: Avoid races by sleeping
And add a comment.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
YAMAMOTO Takashi [Fri, 24 Jan 2014 01:31:13 +0000 (10:31 +0900)]
daemon.at: Fix stderr races
When spawning ovsdb-server in background, redirect stderr to /dev/null.
Otherwise, the banner output (eg. "ovsdb-server (Open vSwitch) 2.1.90")
can mess stderr of the following commands and make these tests fail.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
YAMAMOTO Takashi [Fri, 24 Jan 2014 01:31:12 +0000 (10:31 +0900)]
ofproto-dpif.at: Workaround races in megaflow tests
Avoid races in megaflow tests by sprinkling "sleep 1".
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
YAMAMOTO Takashi [Fri, 24 Jan 2014 01:31:11 +0000 (10:31 +0900)]
ofprot-dpif.at: Fix races
Fix races in "ofproto-dpif - controller" test.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
YAMAMOTO Takashi [Fri, 24 Jan 2014 06:50:41 +0000 (15:50 +0900)]
packets: Fix userland implementation of set-field ipv6 addresses
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 4 Feb 2014 18:32:35 +0000 (10:32 -0800)]
Enhance userspace support for MPLS, for up to 3 labels.
This commit makes the userspace support for MPLS more complete. Now
up to 3 labels are supported.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Co-authored-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Simon Horman <horms@verge.net.au>
Gurucharan Shetty [Fri, 17 Jan 2014 18:43:03 +0000 (10:43 -0800)]
daemon-windows: Add users for windows services.
Start with ovs-vswitchd and ovsdb-server.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Gurucharan Shetty [Fri, 17 Jan 2014 00:16:24 +0000 (16:16 -0800)]
daemon-windows: Ability to handle windows service calls.
The following code does not add any users yet.
The visioned workflow that this piece of code should work with is:
* Create a windows service through a startup script with
a tool like 'sc'
ex: sc create ovsdb-server binpath=
"C:\openvswitch\usr\sbin\ovsdb-server.exe -vconsole:off
-vsyslog:off -vfile:info --remote=ptcp:6632:127.0.0.1 --log-file
--service-monitor --service"
* Start the service from the startup script.
ex: sc start ovsdb-server
* Terminate the service during shutdown process.
ex: sc stop ovsdb-server
* Abrupt termination will restart the service.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 4 Feb 2014 16:07:45 +0000 (08:07 -0800)]
dpif-netdev: Make a log message more detailed.
This would have helped me track down a bug I was hunting just now.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Joe Perches [Tue, 4 Feb 2014 01:27:41 +0000 (17:27 -0800)]
datapath: flow_netlink: Use pr_fmt to OVS_NLERR
Add "openvswitch: " prefix to OVS_NLERR output
to match the other OVS_NLERR output of datapath.c
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Joe Perches [Tue, 4 Feb 2014 01:26:52 +0000 (17:26 -0800)]
datapath: Use net_ratelimit in OVS_NLERR
Each use of pr_<level>_once has a per-site flag.
Some of the OVS_NLERR messages look as if seeing them
multiple times could be useful, so use net_ratelimit()
instead of pr_info_once.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Ben Pfaff [Tue, 4 Feb 2014 01:15:03 +0000 (17:15 -0800)]
AUTHORS: Add Ken Ajiro.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ken Ajiro [Tue, 28 Jan 2014 01:20:43 +0000 (01:20 +0000)]
ovs-vsctl: Update will be discarded when multiple ovs-vsctl are executed
When two ovs-vsctl update map type column at same time, one ovs-vsctl's
update will be discarded although all ovs-vsctl succeeded. This patch
fixes this issue.
Signed-off-by: Ken Ajiro <ajiro@mxw.nes.nec.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Daniele Di Proietto [Fri, 24 Jan 2014 18:00:06 +0000 (19:00 +0100)]
dpif-linux: remove useless includes
Signed-off-by: Daniele Di Proietto <daniele.di.proietto@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Daniele Di Proietto [Fri, 24 Jan 2014 18:00:05 +0000 (19:00 +0100)]
m4: remove useless include from netlink check
linux/types.h is already included from linux/netlink.h (in every
linux version). This will ease FreeBSD porting
Signed-off-by: Daniele Di Proietto <daniele.di.proietto@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 29 Jan 2014 06:13:19 +0000 (15:13 +0900)]
ofproto-dpif-xlate: Remove unused fitnessp pararameter from xlate_receive
Some functions pass a non-NULL value as this parameter
but none of those function uses the value xlate_receive()
returns there. So simply remove the parameter all together.
Also remove the now unused key_fitness field of struct flow_miss.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Daniele Di Proietto [Thu, 23 Jan 2014 22:26:42 +0000 (23:26 +0100)]
datapath: Added (unsigned long long) cast in printf
This is necessary, since u64 is not unsigned long long
in all architectures: u64 could be also uint64_t.
Signed-off-by: Daniele Di Proietto <daniele.di.proietto@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Daniele Di Proietto [Thu, 23 Jan 2014 22:26:05 +0000 (23:26 +0100)]
datapath: avoid cast-qual warning in vport_priv
This function must cast a const value to a non const value.
By adding an uintptr_t cast the warning is suppressed.
To avoid the cast (proper solution) several function signatures
must be changed.
Signed-off-by: Daniele Di Proietto <daniele.di.proietto@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Daniele Di Proietto [Thu, 23 Jan 2014 22:25:37 +0000 (23:25 +0100)]
datapath: avoid warnings in vport_from_priv
This change, firstly, avoids declaring the formal parameter const,
since it is treated as non const. (to avoid -Wcast-qual)
Secondly, it cast the pointer from void* to u8*, since it is used
in arithmetic (to avoid -Wpointer-arith)
Signed-off-by: Daniele Di Proietto <daniele.di.proietto@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Andy Zhou [Fri, 31 Jan 2014 23:47:58 +0000 (15:47 -0800)]
datapth: Suppress error messages on megaflow updates
With subfacets, we'd expect megaflow updates message to carry
the original micro flow. If not, EINVAL is returned and kernel
logs an error message. Now that the user space subfacet layer is
removed, it is expected that flow updates can arrive with a
micro flow other than the original. Change the return code to
EEXIST and remove the kernel error log message.
Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>