Ben Pfaff [Thu, 25 Jul 2013 16:45:43 +0000 (09:45 -0700)]
util: Set thread name via pthreads in set_subprogram_name().
This makes "top" and "ps" output more readable on FreeBSD at least, and
the names are also visible in debuggers.
Suggested-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Tested-by: Andy Zhou <azhou@nicira.com>
Gurucharan Shetty [Mon, 22 Jul 2013 17:17:53 +0000 (10:17 -0700)]
ovs-bugtool: Increase max size of CAP_HARDWARE_INFO.
Current size feels very low when we are collecting o/p of
'dmidecode' and 'lspci -vv'
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Gurucharan Shetty [Fri, 19 Jul 2013 19:37:03 +0000 (12:37 -0700)]
ovs-bugtool: Separate capability for general network info.
Current situation is that CAP_NETWORK_STATUS has a max size of 50 MB.
When we have around 100,000 openflow flows, we over-run that size
by just running the "ovs-ofctl dump-flows" command. All the openvswitch
commands run through the plugin scripts in this repo won't have its
data stored in the debug bundle in this case as they are part of
CAP_NETWORK_STATUS too. One option to correct this is to increase
the CAP_NETWORK_STATUS max size to a higher number. But CAP_NETWORK_STATUS
also includes a bunch of general network related information collected
by running commands like ethtool, tc etc. and we probably want to limit
the data collected through those commands.
With this commit, we create a new capability called CAP_NETWORK_INFO
and collect general network related information through them. For OVS
related information, we continue to use CAP_NETWORK_STATUS, but remove
the maximum size restriction. One rationale to keep OVS related
information in CAP_NETWORK_STATUS is because xen-bugtool probably expects
OVS information in that capability.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Gurucharan Shetty [Thu, 18 Jul 2013 20:44:51 +0000 (13:44 -0700)]
ovs-bugtool: Remove duplicate bond/show command.
ovs-appctl bond/show is being run through the plugin by
calling the script ovs-bugtool-bond-show.
So remove the redundant code.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Ethan Jackson [Mon, 22 Jul 2013 19:54:09 +0000 (12:54 -0700)]
ofproto-dpif-xlate: Fix invalid memory read on port removal.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Justin Pettit [Tue, 23 Jul 2013 22:06:08 +0000 (15:06 -0700)]
Prepare for post-1.12.0 (1.12.90).
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Justin Pettit [Tue, 23 Jul 2013 22:03:52 +0000 (15:03 -0700)]
Prepare for 1.12.0.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Mon, 22 Jul 2013 22:47:19 +0000 (15:47 -0700)]
clang: Fix the alignment warning.
This commit fixes the warning issued by 'clang' when pointer is casted
to one with greater alignment.
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 19 Jul 2013 21:51:32 +0000 (14:51 -0700)]
dpif-linux: Add some internal "const" qualifiers.
This makes it a little easier to see what functions actually need to modify
members of struct dpif_linux.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 15 Jul 2013 20:13:17 +0000 (13:13 -0700)]
vlog: Mark vlog_module_ptr_* as const.
This makes them more obviously thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 9 May 2013 17:54:04 +0000 (10:54 -0700)]
fatal-signal: Make thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 26 Apr 2013 20:28:33 +0000 (13:28 -0700)]
command-line: Make proctitle changing commands thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 26 Apr 2013 20:20:30 +0000 (13:20 -0700)]
netdev-vport: Make pid checking in set_tunnel_config() thread-safe
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Fri, 26 Apr 2013 20:07:33 +0000 (13:07 -0700)]
ofp-msgs: Make alloc_xid() thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Fri, 26 Apr 2013 19:58:14 +0000 (12:58 -0700)]
netdev-dummy: Make counter thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Fri, 26 Apr 2013 18:25:00 +0000 (11:25 -0700)]
ovsdb-idlc: Ensure that initialization occurs single-threaded.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Fri, 26 Apr 2013 18:22:19 +0000 (11:22 -0700)]
ofp-parse: Make parse_ofp_str() thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Mon, 29 Apr 2013 21:34:57 +0000 (14:34 -0700)]
netdev-linux: Work on thread safety.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Tue, 23 Apr 2013 23:37:44 +0000 (16:37 -0700)]
uuid: Make uuid_generate() thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Tue, 23 Apr 2013 23:19:21 +0000 (16:19 -0700)]
socket-util: Make get_max_fds() and get_null_fd() thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Tue, 23 Apr 2013 22:03:57 +0000 (15:03 -0700)]
packets: Make eth_addr_is_reserved() thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Tue, 23 Apr 2013 22:02:13 +0000 (15:02 -0700)]
ovsdb-types: Make ovsdb_base_type_get_enum_type() thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Alex Wang [Tue, 23 Jul 2013 01:15:49 +0000 (18:15 -0700)]
vlan-splinter: Fix inverted logic bug.
When "other-config:enable-vlan-splinters=true" is set, the existing
vlans with ip address must be retained. The bug actually does the
opposite and retains the vlans without ip address. This commit fixes
it.
Reported-by: Roman Sokolkov <rsokolkov@gmail.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Mon, 22 Jul 2013 22:08:00 +0000 (15:08 -0700)]
datapath: remove RCU annotation from flow->mask
After a mask is assigned to a flow, it will not change for the life of
the flow. Since flow access is protected by RCU lock, access to
flow->mask after getting a flow is always safe.
Suggested-by: Jesse Gross <jesse@nicira.com>
Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Ben Pfaff [Mon, 22 Jul 2013 20:30:01 +0000 (13:30 -0700)]
sparse: Avoid sparse warnings for additional pthread initializers.
Reported-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 22 Jul 2013 20:38:25 +0000 (13:38 -0700)]
configure: Remove -Wno-override-init, add -Wextra to compile options.
The build is clean against -Wextra at least with GCC 4.4.
(-Wextra includes -Woverride-init.)
Suggested-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Alex Wang [Mon, 22 Jul 2013 16:19:57 +0000 (09:19 -0700)]
clang: Fix the "expression result unused" warning.
This commit makes macro function "ASSIGN_CONTAINER()" evaluates
to "(void)0". This is to avoid the 'clang' warning: "expression
result unused", since most of time, the final evaluated value
is not used.
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Mon, 22 Jul 2013 16:19:56 +0000 (09:19 -0700)]
clang: Fix segfault in unit tests.
It seems that 'clang' compiler applies strict protection on pointer
dereference. And it causes unexpected execution in macro functions
like "HMAP_FOR_EACH()" and unit test failures. This commit fixes
this issue and pass all unit tests.
Co-authored-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 23 Apr 2013 22:00:06 +0000 (15:00 -0700)]
ovsdb-data: Make ovsdb_atom_default() thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 23 Apr 2013 21:35:29 +0000 (14:35 -0700)]
dpif: Serialize initialization.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 23 Apr 2013 21:04:54 +0000 (14:04 -0700)]
dirs: Make thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 23 Apr 2013 20:21:07 +0000 (13:21 -0700)]
xenserver: Make thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 15 Apr 2013 22:30:03 +0000 (15:30 -0700)]
meta-flow: Make thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 15 Apr 2013 22:10:47 +0000 (15:10 -0700)]
memory: Add note about threaded usage to comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 15 Apr 2013 22:05:19 +0000 (15:05 -0700)]
lockfile: Make thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 15 Apr 2013 21:35:18 +0000 (14:35 -0700)]
jsonrpc: Make thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 19 Jun 2013 18:41:06 +0000 (11:41 -0700)]
ofp-msgs: Make thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 19 Jun 2013 18:10:57 +0000 (11:10 -0700)]
dpif-netdev: Make 'max_mtu' a per-dp feature, for thread safety.
This ensures that an external lock around a dpif_netdev will allow
thread-safe access to it.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Kyle Mestery [Mon, 22 Jul 2013 14:38:13 +0000 (10:38 -0400)]
datapath: Conditionally define skb_unclone in datapath compat code
Recent versions of Fedora have skb_unclone included in their
kernels. This patch adds a conditional check into the compat directory so as
not to error out by defining it twice. This allows the latest OVS kernel
module to build on Fedora 19.
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Mon, 1 Jul 2013 21:38:33 +0000 (14:38 -0700)]
datapath: Restructure vxlan tunneling.
Following patch restructures vxlan tunneling so that it is more
in sync with upstream vxlan tunneling code.
Signed-off-by: Pravin Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Mon, 1 Jul 2013 21:36:51 +0000 (14:36 -0700)]
datapath: Improve net-namespace compat code.
Following patch improves compat net-namespace code which is mostly
targeted for 2.6.32 kernel. upcoming vxlan restructuring patch
needs this patch.
Signed-off-by: Pravin Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Andy Zhou [Fri, 19 Jul 2013 18:11:24 +0000 (11:11 -0700)]
datapath: Add mask check during flow lookup
A mega flow matches when the masked key matches and the mask applied
is the same as the mask used to create the mega flow.
This patch adds the implementation of the second match condition
mentioned above. Without this fix, mega flow lookup may result false
match.
Bug #18584
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Ethan Jackson [Fri, 19 Jul 2013 19:59:51 +0000 (12:59 -0700)]
bond: Support null argument to bond_ref().
This is consistent with the other ref functions, and was causing
segmentation faults in some test cases.
Reported-by: Mukesh Hira <mhira@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Pavithra Ramesh [Fri, 19 Jul 2013 07:00:26 +0000 (07:00 +0000)]
ovs-vswitchd: Document the ovs-appctl bfd/* commands.
Added man-page entries for bfd/show and bfd/set-forwarding commands.
Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Linda Sun [Fri, 19 Jul 2013 17:04:47 +0000 (10:04 -0700)]
Avoid designated initializers and static decls of arrays of unknown size.
MSVC can't handle either one.
Signed-off-by: Linda Sun <lsun@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 25 Apr 2013 23:42:04 +0000 (16:42 -0700)]
system-stats: Move into separate thread.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 17 Jul 2013 18:42:10 +0000 (11:42 -0700)]
vlog: Make thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 10 Jul 2013 18:43:46 +0000 (11:43 -0700)]
vlog: Use async I/O.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 18 Jul 2013 22:48:33 +0000 (15:48 -0700)]
ofp-util: Un-"inline" should_send_version_bitmap().
There is no reason to mark this function as inline. Let the compiler do
its job.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
Ben Pfaff [Wed, 10 Jul 2013 18:40:28 +0000 (11:40 -0700)]
async-append: New library to allow asynchronous appending to a log file.
This will be hooked into the vlog library in an upcoming commit.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 18 Jul 2013 21:52:02 +0000 (14:52 -0700)]
netlink: Avoid designated initializers because MSVC does not support them.
CC: Linda Sun <lsun@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 19 Jun 2013 18:39:11 +0000 (11:39 -0700)]
netlink-socket: Make thread-safe.
The uses of vlog in this module are not thread-safe, because vlog itself
is not yet thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 29 Apr 2013 20:57:50 +0000 (13:57 -0700)]
netlink-socket: Simplify use of transactions and dumps.
This disentangles "struct nl_dump" from "struct nl_sock", clearing the way
to make the use of either one thread-safe in an obviously correct manner.
Signed-off-by: Ben Pfaff <blp@nicira.com>
ZhengLingyun [Thu, 18 Jul 2013 08:08:06 +0000 (16:08 +0800)]
netdev-linux: avoid negative value cast to non-negative in comparison
I am using a userspace OVS, there is a constant ERR message in log:
"dpif_netdev|ERR|error receiving data from ovs-netdev: Message too long"
Check the code and find there is a comparison between ssize_t and size_t type in
netdev_rx_linux_recv(). It makes the negative "retval" greater than the "size".
Change the sequence of comparison to avoid negative return value cast to
a positive and become greater then a non-negative value.
Signed-off-by: ZhengLingyun <konghuarukhr@163.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 28 Jun 2013 20:41:53 +0000 (13:41 -0700)]
ofp-msgs: Consistently include "STATS" in the names of stats messages.
This is the convention that I've meant to maintain, but missed a number of
messages. This corrects them.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Justin Pettit [Wed, 17 Jul 2013 07:19:49 +0000 (00:19 -0700)]
ofproto-dpif: Make "ovs-appctl dpif/dump-flows" megaflow-aware.
The "ovs-appctl dpif/dump-flows" command wasn't updated to print
megaflows, so the output would not include wildcards even though the
datapath may, so the output was inconsistent and confusing.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Wed, 17 Jul 2013 06:05:10 +0000 (23:05 -0700)]
ofproto-dpif: Expire fin_timeout actions when no previous timeout set.
Commit
e503cc199 (ofproto: Optimise OpenFlow flow expiry) optimized
OpenFlow flow expiration by putting expirable flows on a list. However,
the list is only configured at rule creation time. If the rule is
created without a timeout, but is later set by the fin_timeout action,
it will never expire. This commit adds the rule to the list when the
action is triggered.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 25 Apr 2013 18:18:10 +0000 (11:18 -0700)]
util: New macros ROUND_UP_POW2, ROUND_DOWN_POW2.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Linda Sun [Wed, 17 Jul 2013 19:08:25 +0000 (12:08 -0700)]
Make attribute packed equivalent for MSC compilers.
Signed-off-by: Linda Sun <lsun@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 25 Apr 2013 17:48:03 +0000 (10:48 -0700)]
byteq: Make the queue size variable instead of fixed at BYTEQ_SIZE bytes.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 24 Apr 2013 21:00:13 +0000 (14:00 -0700)]
vlog: Make VLOG_ONCE thread-safe.
Of course, the code it calls into isn't thread-safe itself yet.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 16 Jul 2013 17:06:27 +0000 (10:06 -0700)]
bfd: Use htonll() instead of htonl() for tunnel ID constant.
This is not a real bug, since htonl(0) and htonll(0) have the same value
although not the same type.
Found by sparse.
CC: Pavithra Ramesh <paramesh@vmware.com>
CC: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Pavithra Ramesh [Tue, 16 Jul 2013 19:59:39 +0000 (12:59 -0700)]
BFD: Add BFD output to bugtool
This change includes the output of ovs-appctl bfd/show to
ovs-bugtool output.
Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Justin Pettit [Tue, 16 Jul 2013 01:53:23 +0000 (18:53 -0700)]
ofproto-dpif: Don't put new subfacets as result of "userspace" action.
Don't install a flow if it's the result of the "userspace" action for an
already installed facet. This can occur when a datapath flow with
wildcards has a "userspace" action and flows sent to userspace result in
a different subfacet, which will then be rejected as overlapping by the
datapath.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Co-authored-by: Ethan Jackson <ethan@nicira.com>
Ben Pfaff [Wed, 10 Jul 2013 17:54:41 +0000 (10:54 -0700)]
poll-loop: Make poll loop data structures per-thread.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 16 Jul 2013 17:43:07 +0000 (10:43 -0700)]
poll-loop: Simplify and speed up polling.
The simplification comes from dropping support for canceling a
poll_waiter, which was a feature that was never used. The speedup
comes from avoiding a malloc() for every call to poll_fd_wait().
(I doubt that this significantly improves performance.)
This prepares for making the polling structures per-thread in
the next commit.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Tue, 16 Jul 2013 04:30:59 +0000 (21:30 -0700)]
datapath: Use masked flow when validating actions.
It is important to validate flow actions to ensure that they do
not try to write off the end of a packet. The mechanism to do this
is to ensure that a flow is precise enough to describe valid vs.
invalid packets and only allowing actions on valid flows.
The introduction of megaflows broke this by using a narrow base
flow but a potentially wide match. This meant that while the
original flow was properly validated, later packets might not
conform to that flow and could be truncated. This switches to
using the masked flow instead, effectively requiring that all
possible matching packets be valid in order for a flow's actions
to be accepted.
This change only affects the flow setup path - executed packets
have always used the flow extracted from the packet and therefore
were properly validated.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Andy Zhou [Tue, 16 Jul 2013 00:25:34 +0000 (17:25 -0700)]
ovs-ofctl: Bug fix in flow_format()
Fix a corner case bug where ARP packet with ARP opcode value of 1 would cause
tp_src and tp_dst to appear in the output string.
This bug caused some output from flow_format() to not be accepted by
'ovs-appctl ofproto/trace'
Added test coverage by using ARP opcode 1 in one unit test case, that
would have exposed the bug.
Bug #18334
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 12 Jul 2013 16:39:15 +0000 (09:39 -0700)]
tests: Fix theoretical races in "ofproto-dpif - controller" test.
I don't see anything that guaranteed that ovs-ofctl would receive and print
the packets before it exited. This commit inserts explicit waits, to avoid
the problem.
Found by inspection.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 16 Jul 2013 17:12:24 +0000 (10:12 -0700)]
hindex: Fix test expected output.
Signed-off-by: Ben Pfaff <blp@nicira.com>
ZhengLingyun [Mon, 15 Jul 2013 00:21:04 +0000 (08:21 +0800)]
hindex: Fix incomplete iteration bug.
hindex_next() make the completely wrong assumption that head nodes within
a bucket were sorted in ascending order by hash. This commit removes
that assumption.
Also add a test that would have found the problem.
Signed-off-by: ZhengLingyun <konghuarukhr@163.com>
[blp@nicira.com changed how hindex_head_node() is implemented and
other code details]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Pravin B Shelar [Mon, 15 Jul 2013 19:58:41 +0000 (12:58 -0700)]
datapath: Use RCU lock for dp dump operation.
RCUfy dp-dump operation which is already read-only. This
makes all ovs dump operations lockless.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Mon, 15 Jul 2013 19:45:20 +0000 (12:45 -0700)]
datapath: Revert "datapath: rhel: Account for RHEL specific backports"
This reverts commit
752378e1cd1f133a8366fbacec3b281a45ff8268
(datapath: rhel: Account for RHEL specific backports).
Change related to netif_needs_gso() is cuasing panic on RHEL
and Xen platforms. This way we revert back to use of ovs
skb_gso_segment() and netif_skb_features() which has required
compat code for gso for kernel older than 2.6.38.
<1>[ 924.855722] BUG: unable to handle kernel NULL pointer dereference
at
000000a0
<1>[ 924.855789] IP: [<
f0337fb7>] netdev_send+0x77/0x340 [openvswitch]
<4>[ 924.855849] *pdpt =
000000011bc66027 *pde =
0000000000000000
<0>[ 924.855895] Oops: 0000 [#1] SMP
<0>[ 924.855927] last sysfs file: /sys/class/net/lo/carrier
<4>[ 924.856551] Pid: 17937, comm: vif Not tainted
(2.6.32.43-0.4.1.xs1.6.10.734.170748xen #1) VMware Virtual Platform
<4>[ 924.856618] EIP: 0061:[<
f0337fb7>] EFLAGS:
00010246 CPU: 0
<4>[ 924.856659] EIP is at netdev_send+0x77/0x340 [openvswitch]
<4>[ 924.856697] EAX:
00000000 EBX:
dd4fb800 ECX:
00000000 EDX:
00000289
<4>[ 924.856749] ESI:
edd55a40 EDI:
000005dc EBP:
df287aa8 ESP:
df287a7c
<4>[ 924.856790] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0069
<0>[ 924.856825] Process vif (pid: 17937, ti=
df286000 task=
ee88d570
task.ti=
df286000)
<0>[ 924.856880] Stack:
<4>[ 924.856902]
00000000 be8b9067 00000000 e9b02000 dd523ac0 dd523b50
f033aef1 b2e77c64
<4>[ 924.856966] <0>
dd523ac0 ee902840 dd4fc58c df287ab8 f0336162
edd55a40 ee902840 df287ac8
<4>[ 924.857043] <0>
f032d684 0000001e ee10a300 df287b34 f032d6ef
0000001c 00000000 00000000
<0>[ 924.858942] Call Trace:
<4>[ 924.859553] [<
f033aef1>] ? flex_array_get+0x51/0x70 [openvswitch]
<4>[ 924.860189] [<
f0336162>] ? ovs_vport_send+0x12/0x50 [openvswitch]
<4>[ 924.860806] [<
f032d684>] ? do_output+0x34/0x50 [openvswitch]
<4>[ 924.861444] [<
f032d6ef>] ? do_execute_actions+0x4f/0x830
[openvswitch]
<4>[ 924.862047] [<
f032dfa0>] ? ovs_execute_actions+0x70/0xd0
[openvswitch]
<4>[ 924.862636] [<
f032fd3f>] ?
ovs_dp_process_received_packet+0x8f/0xf0 [openvswitch]
<4>[ 924.863774] [<
f033690e>] ? ovs_vport_receive+0x5e/0x70
[openvswitch]
<4>[ 924.864354] [<
f0337d9f>] ? netdev_frame_hook+0x4f/0x90
[openvswitch]
<4>[ 924.864918] [<
c034f7ab>] ? netif_receive_skb+0x1bb/0x6a0
<4>[ 924.865469] [<
c03c193f>] ? vlan_gro_common+0x10f/0x230
<4>[ 924.866007] [<
c034fd58>] ? napi_skb_finish+0x38/0x40
<4>[ 924.866533] [<
c03c1e86>] ? vlan_gro_receive+0x76/0x80
<4>[ 924.867055] [<
f05adba4>] ? e1000_receive_skb+0x74/0x80 [e1000]
<4>[ 924.867571] [<
f05b2b67>] ? e1000_clean_rx_irq+0x1f7/0x3e0 [e1000]
<4>[ 924.868084] [<
f05b2970>] ? e1000_clean_rx_irq+0x0/0x3e0 [e1000]
<4>[ 924.869025] [<
f05b06ac>] ? e1000_poll+0x4c/0x1f0 [e1000]
--snip--
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pavithra Ramesh [Tue, 16 Jul 2013 09:58:42 +0000 (09:58 +0000)]
BFD: Add check_tnl_key feature to BFD code.
This change adds the check_tnl_key functionality for BFD.
When the feature is enabled, BFD will only accept control
packets with a tunnel key of 0.
Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Ben Pfaff [Mon, 15 Jul 2013 19:20:23 +0000 (12:20 -0700)]
latch: New module for a thread-safe, signal-safe, pollable doorbell.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Ben Pfaff [Wed, 10 Jul 2013 16:53:21 +0000 (09:53 -0700)]
stress: Remove essentially unused library.
The "stress" library was introduced years ago. We intended at the time to
start using it to provoke errors in testing, to make sure that Open vSwitch
was resilient against those errors. The intention was good, but there were
few actual implementations of stress options, and the testing never
materialized.
Rather than adapt the stress library for thread safety, this seems like a
good opportunity to remove it, so this commit does so.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Sat, 13 Jul 2013 03:52:51 +0000 (20:52 -0700)]
rhel, xenserver: Create /var/log/openvswitch directory.
During installation create the /var/log/openvswitch directory
so that openvswitch startup script is able to write the ovs-ctl.log
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Justin Pettit [Fri, 12 Jul 2013 23:56:55 +0000 (16:56 -0700)]
ofproto-dpif: Zero-out subfacet counters when installation fails.
When deleting subfacets, subfacet_uninstall() asserts that the
subfacet's counters are zero to make sure we don't lose counters. We
have seen cases where a subfacet cannot be installed, but the counters
have values. This should not happen and indicates a bug, since we
shouldn't create a subfacet if the datapath has a flow. A buggy
datapath could trigger this, so just zero out the counters and log an
error.
Bug #18460.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Ben Pfaff [Thu, 25 Apr 2013 22:03:27 +0000 (15:03 -0700)]
worker: Delete library.
It had no remaining users.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 25 Apr 2013 22:02:16 +0000 (15:02 -0700)]
system-stats: Remove worker process support.
The worker process implementation isn't thread-safe and, once OVS
itself is threaded, it doesn't make much sense to have a worker
process anyway.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 10 Jul 2013 21:46:41 +0000 (14:46 -0700)]
vlog: Remove unused function vlog_exit().
This is harder to implement once threads are introduced.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Ben Pfaff [Wed, 10 Jul 2013 21:06:15 +0000 (14:06 -0700)]
vlog: Remove unused function vlog_get_log_file().
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Ben Pfaff [Tue, 9 Apr 2013 18:18:01 +0000 (11:18 -0700)]
vlog: Make vlog_should_drop() thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Ben Pfaff [Fri, 12 Jul 2013 21:18:01 +0000 (14:18 -0700)]
util: Make subprogram_name thread-specific.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 25 Jun 2013 20:56:40 +0000 (13:56 -0700)]
timeval: Make CPU usage and wakeup tracking per-thread.
This should make the "timeval" module thread-safe, except for its
calls into vlog (because vlog is not yet thread-safe).
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Ben Pfaff [Wed, 10 Jul 2013 17:10:35 +0000 (10:10 -0700)]
timeval: Make reading the current time thread-safe.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Jesse Gross [Fri, 12 Jul 2013 17:02:15 +0000 (10:02 -0700)]
datapath: Use kernel eth_mac_addr() on old kernels.
The OVS MAC address set function was removed in favor of the version
in the kernel but the function pointer for older kernels was not
updated.
Reported-by: Cali Ente <calientepermanente@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Joe Stringer [Fri, 12 Jul 2013 07:58:13 +0000 (16:58 +0900)]
tests: Add ofproto-dpif push_vlan test
Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 12 Jul 2013 00:10:11 +0000 (17:10 -0700)]
vlog: Remove support for worker process.
The worker process implementation isn't thread-safe and, once OVS
itself is threaded, it doesn't make much sense to have a worker
process anyway.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Ben Pfaff [Wed, 10 Jul 2013 17:54:52 +0000 (10:54 -0700)]
poll-loop: Fix typo in comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Ben Pfaff [Thu, 9 May 2013 19:39:16 +0000 (12:39 -0700)]
timeval: Fix typo in comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Ben Pfaff [Fri, 12 Jul 2013 00:02:12 +0000 (17:02 -0700)]
timeval: Remove backtrace feature.
The backtrace feature of timeval is useful because it provides a "poor
man's profile" view of Open vSwitch. But it is not likely to be useful in
a multithreaded process, because signal delivery doesn't necessarily follow
the profile when there is more than one thread. (A signal in a
multithreaded process are delivered to an arbitrary thread.)
Another problem with the backtrace feature is that it is difficult for
format_backtraces() to synchronize properly with the signal handler in a
multithreaded process. In a single-threaded process, it can just block
the signal handler, but in a multithreaded process this does not prevent
signal delivery to threads other than the one running format_backtrace().
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Ben Pfaff [Thu, 11 Jul 2013 23:50:15 +0000 (16:50 -0700)]
timeval: New function xclock_gettime().
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Ben Pfaff [Thu, 11 Jul 2013 23:40:01 +0000 (16:40 -0700)]
fatal-signal: Remove write-only variable fatal_signal_set.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
Jesse Gross [Tue, 9 Jul 2013 21:11:12 +0000 (14:11 -0700)]
FAQ: Add supported kernel versions for newer OVS releases.
Reported-by: Kris zhang <zhang.kris@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Gurucharan Shetty [Thu, 11 Jul 2013 16:10:41 +0000 (09:10 -0700)]
ovs-ctl.in: Increase the limit on file descriptors.
Testing shows that creation of 5000 internal ports and using it
to do some meaningful tasks works fine on a 12 cpu hardware.
Since a single port needs one file descriptor and a bridge
needs 3 file descriptors, we will have to increase the file
descriptor limit to a higher number from the current limit of 5000.
7500 feels like a decent increase with enough room for further
scale testing.
Bug #18383.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Thu, 11 Jul 2013 16:08:15 +0000 (09:08 -0700)]
ovs-vswitchd: Correct the documentation on the limits for bridges and ports.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Ben Pfaff [Tue, 9 Jul 2013 16:23:02 +0000 (09:23 -0700)]
dpif-netdev: Make "packet-out" with in_port=OFPP_CONTROLLER work again.
Commit
4e022ec09e14 (Create specific types for ofp and odp port) broke
OpenFlow OFPP_PACKET_OUT requests that use in_port=OFPP_CONTROLLER. This
commit fixes the problem and adds a regression test.
CC: Alex Wang <alexw@nicira.com>
Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Min Chen [Thu, 11 Jul 2013 05:21:52 +0000 (22:21 -0700)]
vswitchd: Fix typo in the BFD section of vswitch.xml
Signed-off-by: Min Chen <minchnew@gmail.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Ethan Jackson [Tue, 9 Jul 2013 22:27:12 +0000 (15:27 -0700)]
atomic: Suppress sparse warning.
With the latest version of sparse, the ATOMIC_VAR_INIT macro
generates the following warning. This patch suppresses it.
warning: Using plain integer as NULL pointer
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>