sliver-openvswitch.git
10 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Fri, 19 Jul 2013 10:51:38 +0000 (12:51 +0200)]
Merge branch 'mainstream'

10 years agosystem-stats: Move into separate thread.
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>
10 years agovlog: Make thread-safe.
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>
10 years agovlog: Use async I/O.
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>
10 years agoofp-util: Un-"inline" should_send_version_bitmap().
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>
10 years agoasync-append: New library to allow asynchronous appending to a log file.
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>
10 years agonetlink: Avoid designated initializers because MSVC does not support them.
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>
10 years agonetlink-socket: Make thread-safe.
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>
10 years agonetlink-socket: Simplify use of transactions and dumps.
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>
10 years agonetdev-linux: avoid negative value cast to non-negative in comparison
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>
10 years agoofp-msgs: Consistently include "STATS" in the names of stats messages.
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>
10 years agoofproto-dpif: Make "ovs-appctl dpif/dump-flows" megaflow-aware.
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>
10 years agoofproto-dpif: Expire fin_timeout actions when no previous timeout set.
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>
10 years agoutil: New macros ROUND_UP_POW2, ROUND_DOWN_POW2.
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>
10 years agoMake attribute packed equivalent for MSC compilers.
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>
10 years agobyteq: Make the queue size variable instead of fixed at BYTEQ_SIZE bytes.
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>
10 years agovlog: Make VLOG_ONCE thread-safe.
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>
10 years agobfd: Use htonll() instead of htonl() for tunnel ID constant.
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>
10 years agoBFD: Add BFD output to bugtool
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>
10 years agoofproto-dpif: Don't put new subfacets as result of "userspace" action.
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>
10 years agopoll-loop: Make poll loop data structures per-thread.
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>
10 years agopoll-loop: Simplify and speed up polling.
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>
10 years agodatapath: Use masked flow when validating actions.
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>
10 years agoovs-ofctl: Bug fix in flow_format()
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>
10 years agotests: Fix theoretical races in "ofproto-dpif - controller" test.
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>
10 years agohindex: Fix test expected output.
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>
10 years agohindex: Fix incomplete iteration bug.
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>
10 years agodatapath: Use RCU lock for dp dump operation.
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>
10 years agodatapath: Revert "datapath: rhel: Account for RHEL specific backports"
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>
10 years agoBFD: Add check_tnl_key feature to BFD code.
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>
10 years agolatch: New module for a thread-safe, signal-safe, pollable doorbell.
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>
10 years agostress: Remove essentially unused library.
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>
10 years agorhel, xenserver: Create /var/log/openvswitch directory.
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>
10 years agoofproto-dpif: Zero-out subfacet counters when installation fails.
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>
10 years agoworker: Delete library.
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>
10 years agosystem-stats: Remove worker process support.
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>
10 years agovlog: Remove unused function vlog_exit().
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>
10 years agovlog: Remove unused function vlog_get_log_file().
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>
10 years agovlog: Make vlog_should_drop() thread-safe.
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>
10 years agoutil: Make subprogram_name thread-specific.
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>
10 years agotimeval: Make CPU usage and wakeup tracking per-thread.
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>
10 years agotimeval: Make reading the current time thread-safe.
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>
10 years agodatapath: Use kernel eth_mac_addr() on old kernels.
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>
10 years agotests: Add ofproto-dpif push_vlan test
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>
10 years agovlog: Remove support for worker process.
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>
10 years agopoll-loop: Fix typo in comment.
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>
10 years agotimeval: Fix typo in comment.
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>
10 years agotimeval: Remove backtrace feature.
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>
10 years agotimeval: New function xclock_gettime().
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>
10 years agofatal-signal: Remove write-only variable fatal_signal_set.
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>
10 years agoFAQ: Add supported kernel versions for newer OVS releases.
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>
10 years agoovs-ctl.in: Increase the limit on file descriptors.
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>
10 years agoovs-vswitchd: Correct the documentation on the limits for bridges and ports.
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>
10 years agodpif-netdev: Make "packet-out" with in_port=OFPP_CONTROLLER work again.
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>
10 years agovswitchd: Fix typo in the BFD section of vswitch.xml
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>
10 years agoatomic: Suppress sparse warning.
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>
10 years agoovs-bugtool: Add ovsdb-server/list-dbs command to bugtool.
Gurucharan Shetty [Wed, 10 Jul 2013 16:42:37 +0000 (09:42 -0700)]
ovs-bugtool: Add ovsdb-server/list-dbs command to bugtool.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatpath: Fix tunnel TTL flow rejection message.
Jesse Gross [Tue, 9 Jul 2013 23:59:56 +0000 (16:59 -0700)]
datpath: Fix tunnel TTL flow rejection message.

There is no default value for the tunnel TTL, so it must be
specified when setting up a new flow. However, the flow rejection
log message indicates that the TTL must be non-zero, which is not
true.

CC: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Always include tunnel TTL in serialized Netlink attributes.
Jesse Gross [Tue, 9 Jul 2013 23:47:01 +0000 (16:47 -0700)]
datapath: Always include tunnel TTL in serialized Netlink attributes.

There is no default value for the tunnel TTL so it must always be
included in flow keys sent from userspace to kernel. The kernel
should also respect this convertion when sending flows to userspace
by always including the TTL in tunnel flows.

CC: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: fix bugs in exporting netlink attributes
Andy Zhou [Tue, 9 Jul 2013 07:25:00 +0000 (00:25 -0700)]
datapath: fix bugs in exporting netlink attributes

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Fix Netlink error message header.
Jesse Gross [Tue, 9 Jul 2013 21:43:47 +0000 (14:43 -0700)]
datapath: Fix Netlink error message header.

CC: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Use DP_MAX_PORTS when no IN_PORT attribute is present.
Jesse Gross [Tue, 9 Jul 2013 21:21:26 +0000 (14:21 -0700)]
datapath: Use DP_MAX_PORTS when no IN_PORT attribute is present.

To indicate that a flow is not associated with any particular in port,
userspace may omit the IN_PORT attribute, which the kernel translates
internally to the special value DP_MAX_PORTS. After the megaflows
changes, this was no longer being done, resulting in it using port 0
(the internal port).

This also adopts a wildcarding scheme similar to 802.2 packets where
a mask can be specified for this non-existent key attribute but it
must either be completely wildcarded or completely exact match.

CC: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoovs-vsctl: Fix behavioral regression for "--if-exists del-port <bridge>".
Ben Pfaff [Mon, 8 Jul 2013 17:47:37 +0000 (10:47 -0700)]
ovs-vsctl: Fix behavioral regression for "--if-exists del-port <bridge>".

Commit 89f3c258fe (ovs-vsctl: Improve error message for "ovs-vsctl del-port
<bridge>".) changed the behavior of
    ovs-vsctl --if-exists del-port <bridge>
from a silent no-op to a hard failure.  This commit fixes this regression.

This caused problems on XenServer, for which the Open vSwitch integration
runs commands like:
    /usr/bin/ovs-vsctl --timeout=20 \
        -- --with-iface --if-exists del-port xapi103 \
        -- --if-exists del-br xapi103

Bug #18276.
Reported-by: Michael Hu <mhu@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agocsum: Suppress sparse warning.
Ethan Jackson [Tue, 9 Jul 2013 17:13:35 +0000 (10:13 -0700)]
csum: Suppress sparse warning.

The latest version of sparse triggers the following warning in the
checksum tests.  This patch suppresses it.

warning: too long initializer-string for array of char

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoutilities: New helper script ovs-dev.py.
Ethan Jackson [Sun, 7 Jul 2013 01:55:45 +0000 (18:55 -0700)]
utilities: New helper script ovs-dev.py.

ovs-dev.py is a script I've written to help perform common tasks
necessary for developing Open vSwitch.  It allows a developer to
configure, build, and run the switch with a minimum of effort or
knowledge of the various idiosyncrasies involved.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agodatapath: rhel: Move RHEL OVS hook registration to netdev_rx_handler_register() backport
Thomas Graf [Tue, 9 Jul 2013 18:36:57 +0000 (20:36 +0200)]
datapath: rhel: Move RHEL OVS hook registration to netdev_rx_handler_register() backport

Moves the registration of the RHEL specific OVS hook to the compat
backport of netdev_rx_handler_register(). This moves the hook
unregistration from the RCU callback to the netdev_destroy()
callback directly.

This is purely cosmetic though, the RHEL hook is only used if the
IFF_OVS_DATAPATH flag is present which was removed under RTNL
protection before the RCU callback.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: rhel: Account for RHEL specific backports
Thomas Graf [Tue, 9 Jul 2013 16:00:26 +0000 (18:00 +0200)]
datapath: rhel: Account for RHEL specific backports

The following symbols have been backported to RHEL and the kernel
version is no longer an accurate indicator for their presence:

 - skb_gso_segment
 - netif_skb_features
 - netif_needs_gso

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Rename skb_network_protocol() to __skb_network_protocol()
Thomas Graf [Tue, 9 Jul 2013 16:00:25 +0000 (18:00 +0200)]
datapath: Rename skb_network_protocol() to __skb_network_protocol()

The function skb_network_protocol() is already defined in
<linux/netdevice.h> upstream but not an exported symbol.

Rename the OVS internal implementation to work around this.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agotests: Additional test for run time addition of a database.
Gurucharan Shetty [Mon, 8 Jul 2013 22:27:27 +0000 (15:27 -0700)]
tests: Additional test for run time addition of a database.

Adding a removed database covers a common use case.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoofproto-dpif: Remove pointers between rules and facets.
Ethan Jackson [Thu, 2 May 2013 22:22:19 +0000 (15:22 -0700)]
ofproto-dpif: Remove pointers between rules and facets.

Before this patch, facets maintained a pointer to the first rule
used when translating their actions, and rules maintained a pointer
to those facets.  This made sense before the resubmit actions which
each facet used precisely one rule.  However, today a facet may
require many rules to translate, and therefore it makes no
conceptual sense to designate one as the "owning rule".

Furthermore, as Open vSwitch becomes multithreaded, maintaining a
facet's rule pointer will become more difficult.  One thread will
do the action translation, while another will maintain the facets.
During the hand-off between these threads, it's possible the
"owning rule" will expire leaving us with a stale pointer.

This patch does have a disadvantage,  Pushing a facet's statistics
will become slightly less efficient as it will involve an
additional classifier lookup.  We can revisit this issue once
multithreading is complete, but I suspect there's much lower
hanging fruit to worry about.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Modularize ofproto-dpif-xlate.
Ethan Jackson [Fri, 14 Jun 2013 01:38:24 +0000 (18:38 -0700)]
ofproto-dpif: Modularize ofproto-dpif-xlate.

This patch modularizes ofproto-dpif-xlate by disentangling it from
ofproto-dpif.  Instead of poking around in ofproto-dpif's internal
data structures, ofproto-dpif-xlate is updated with a simple API
which can easily be made thread safe.  There are still some places
where ofproto-dpif-xlate needs to call into ofproto-dpif, but this
patch makes significant progress towards the final goal.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Actually drop packets on mirror ports.
Ethan Jackson [Sun, 7 Jul 2013 10:52:16 +0000 (03:52 -0700)]
ofproto-dpif-xlate: Actually drop packets on mirror ports.

Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Free meters in ofproto_destroy__().
Jarno Rajahalme [Mon, 1 Jul 2013 13:30:52 +0000 (16:30 +0300)]
ofproto: Free meters in ofproto_destroy__().

Ben noticed that I had forgot to free meters when ofproto is freed.
This should do it.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoAdd basic OpenFlow 1.1 protocol support.
Ben Pfaff [Mon, 8 Jul 2013 21:48:05 +0000 (14:48 -0700)]
Add basic OpenFlow 1.1 protocol support.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests: Add tests for mod flows with cookie miss on OF1.2.
Ben Pfaff [Wed, 17 Apr 2013 20:30:17 +0000 (13:30 -0700)]
tests: Add tests for mod flows with cookie miss on OF1.2.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Add 'modify_cookie' to struct ofputil_flow_mod, to support OF1.1.
Ben Pfaff [Wed, 17 Apr 2013 20:02:15 +0000 (13:02 -0700)]
ofp-util: Add 'modify_cookie' to struct ofputil_flow_mod, to support OF1.1.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoDESIGN: Update flow_mod section to describe OpenFlow 1.1+ behavior.
Ben Pfaff [Wed, 17 Apr 2013 16:59:08 +0000 (09:59 -0700)]
DESIGN: Update flow_mod section to describe OpenFlow 1.1+ behavior.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Make netlink error messages more consistent.
Jesse Gross [Mon, 8 Jul 2013 21:51:27 +0000 (14:51 -0700)]
datapath: Make netlink error messages more consistent.

Suggested-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoofproto-dpif: Modularize mirror code.
Ethan Jackson [Thu, 20 Jun 2013 20:00:27 +0000 (13:00 -0700)]
ofproto-dpif: Modularize mirror code.

This code modularizes ofproto-dpif's mirror code by moving it to
ofproto-dpif-mirror.  Not only does this shorten ofproto-dpif and
hide complexity, but its also necessary for future patches which
modularize ofproto-dpif-xlate in preparation for multi-threading.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Handle dest mirrors in compose_output_action().
Ethan Jackson [Thu, 20 Jun 2013 01:51:28 +0000 (18:51 -0700)]
ofproto-dpif: Handle dest mirrors in compose_output_action().

Before this patch, the mirroring code would retroactively insert
actions for destination mirrors after actions were translated.
This relied on converting datapath output actions into ofports
which doesn't work for tunnels and patch ports.  This patch
refactors the code to handle destination mirrors at output.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agolacp: Handle unknown slaves in lacp_process_packet().
Ethan Jackson [Wed, 19 Jun 2013 21:40:21 +0000 (14:40 -0700)]
lacp: Handle unknown slaves in lacp_process_packet().

In future patches, ofproto-dpif-xlate may be temporarily out of
sync with ofproto-dpif proper, and pass an unknown ofport to
lacp_process_packet().  This patch handles that edge case
gracefully.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoDESIGN: Fix typo in "VLAN Matching" section.
Ben Pfaff [Fri, 3 May 2013 22:27:55 +0000 (15:27 -0700)]
DESIGN: Fix typo in "VLAN Matching" section.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobitmap: Fix bitmap_allocate1() bug when n_bits is a multiple of 32.
ZhengLingyun [Mon, 8 Jul 2013 21:10:26 +0000 (14:10 -0700)]
bitmap: Fix bitmap_allocate1() bug when n_bits is a multiple of 32.

In function bitmap_allocate1(), the last "unsigned long" in bitmap was
set to all 0-bits when (n_bits % BITMAP_ULONG_BITS == 0).  This commit
correctly sets it to all 1-bits.

Signed-off-by: ZhengLingyun <konghuarukhr@163.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobridge: Add ifindex column to Interface table.
Neil McKee [Mon, 8 Jul 2013 20:36:06 +0000 (13:36 -0700)]
bridge: Add ifindex column to Interface table.

This commit adds an "ifindex" column to the "Interface" table in the db.

Signed-off-by: Neil McKee <neil.mckee@inmon.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoBFD: Add forwarding_override command for BFD.
Pavithra Ramesh [Sat, 29 Jun 2013 10:09:02 +0000 (10:09 +0000)]
BFD: Add forwarding_override command for BFD.

Added appctl commands to override the bfd forwarding status. Values
of true/false/normal are allowed. When set to normal, the bfd
forwarding status is left unchanged. Else, the forwarding status is
set to the specified value - true/false.

Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofp-parse: Do not exit() upon a parse error.
Ben Pfaff [Mon, 8 Jul 2013 17:15:00 +0000 (10:15 -0700)]
ofp-parse: Do not exit() upon a parse error.

Until now, failure to parse a flow in the ofp-parse module has caused the
program to abort immediately with a fatal error.  This makes it hard to
use these functions from any long-lived program.  This commit fixes the
problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoSetting tag sliver-openvswitch-1.11.90-1 sliver-openvswitch-1.11.90-1
Giuseppe Lettieri [Sat, 6 Jul 2013 17:51:36 +0000 (19:51 +0200)]
Setting tag sliver-openvswitch-1.11.90-1
merge with mainstream

10 years agoMerge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
Giuseppe Lettieri [Sat, 6 Jul 2013 17:51:05 +0000 (19:51 +0200)]
Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch

Conflicts:
sliver-openvswitch.spec

10 years agoSetting tag sliver-openvswitch-1.10.90-3 sliver-openvswitch-1.10.90-3
Giuseppe Lettieri [Sat, 6 Jul 2013 17:47:11 +0000 (19:47 +0200)]
Setting tag sliver-openvswitch-1.10.90-3
merge with mainstream

10 years agoupdate mainstream version number
Giuseppe Lettieri [Sat, 6 Jul 2013 17:45:01 +0000 (19:45 +0200)]
update mainstream version number

10 years agouse struct tun_pi in read/write to pltap
Giuseppe Lettieri [Sat, 6 Jul 2013 17:36:10 +0000 (19:36 +0200)]
use struct tun_pi in read/write to pltap

10 years agoupdate sliver-ovs to new ovsdb syntax
Giuseppe Lettieri [Sat, 6 Jul 2013 17:32:14 +0000 (19:32 +0200)]
update sliver-ovs to new ovsdb syntax

10 years agocomply with thread-safety checks
Giuseppe Lettieri [Sat, 6 Jul 2013 17:14:14 +0000 (19:14 +0200)]
comply with thread-safety checks

We hide tunproxy.c from the build, since thread-safety checks do not
make sense there.

10 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Sat, 6 Jul 2013 17:00:44 +0000 (19:00 +0200)]
Merge branch 'mainstream'

10 years agoreplaced strerror to ovs_strerror in pltap&tunnel
Giuseppe Lettieri [Sat, 6 Jul 2013 17:00:19 +0000 (19:00 +0200)]
replaced strerror to ovs_strerror in pltap&tunnel

10 years agoMerge commit '10a89ef04df5669c5cdd02f786150a7ab8454e01'
Giuseppe Lettieri [Sat, 6 Jul 2013 16:57:17 +0000 (18:57 +0200)]
Merge commit '10a89ef04df5669c5cdd02f786150a7ab8454e01'

10 years agounification of netdev&netdev_dev in pltap&tunnel
Giuseppe Lettieri [Sat, 6 Jul 2013 16:56:09 +0000 (18:56 +0200)]
unification of netdev&netdev_dev in pltap&tunnel

10 years agoMerge commit 'b5d57fc87925cb3c029de19d0a94de5ca07ae28e'
Giuseppe Lettieri [Sat, 6 Jul 2013 16:06:37 +0000 (18:06 +0200)]
Merge commit 'b5d57fc87925cb3c029de19d0a94de5ca07ae28e'

10 years agorename superclass member to up in netdev-pltap
Giuseppe Lettieri [Sat, 6 Jul 2013 15:55:51 +0000 (17:55 +0200)]
rename superclass member to up in netdev-pltap

10 years agorename superclass member to up in netdev-tunnel
Giuseppe Lettieri [Sat, 6 Jul 2013 15:59:50 +0000 (17:59 +0200)]
rename superclass member to up in netdev-tunnel