]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
10 years agoovs-vsctl: reconnect to the database if connection was dropped
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>
10 years agoconfigure: Fix bug report email address.
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>
10 years agopacket: Make set_ethertype() static
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>
10 years agoofproto: Remove 'force-miss-model' configuration.
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>
10 years agoofp-actions: Correct pop MPLS ethtype as consistency test
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>
10 years agotests/run-ryu: Fix setup for Ryu tests
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>
10 years agotests/run-ryu: Fix log file names
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>
10 years agoofp-util: Fix a typo in ofputil_decode_ofp11_port
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>
10 years agodatapath: Use ether_addr_copy
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>
10 years agoOPENFLOW-1.1+: Update status of a few items.
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>
10 years agoOPENFLOW-1.1+: Remove "rework tag order" and MPLS BoS matching from OF1.3.
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>
10 years agodatapath: Per NUMA node flow stats.
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>
10 years agodatapath: Remove 5-tuple optimization.
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>
10 years agodatapath: fix dp check in ovs_dp_reset_user_features
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>
10 years agotests: Add support for automatically running Ryu tests against OVS.
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>
10 years agoutil: Pre-allocate buffer for ovs_lasterror_to_string().
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>
10 years agolockfile: Implementation for Windows platform.
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>
10 years agoutil: follow_symlinks() for windows.
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>
10 years agostring: strerror_r() for windows.
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>
10 years agoutil: Make xreadlink a static function.
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>
10 years agoofproto-dpif: Use adaptive mutex for stats.
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>
10 years agoovs-thread: Add support for pthread adaptive mutex
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>
10 years agodatapath: Fix race.
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>
10 years agoofproto: Move 'rule->used' to the provider.
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>
10 years agoofproto: Optimize the case of a repeated learn action execution.
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>
10 years agoofproto: Lock for vlan splinters only if have them.
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>
10 years agonetdev-dummy: Reduce reconnect back off timeout
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>
10 years agonetdev-dummy: Fix reconnecting.
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>
10 years agometa-flow: Fix setting MFF_IP_FRAG.
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>
10 years agotunnel: Support all combinations of flow-based and specific tunnel matches.
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>
10 years agobond: Change the way of assigning bond slave for unassigned bond entry.
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>
10 years agotests: Fix MPLS test cases.
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>
10 years agoflow: Copy MPLS label on mpls_push.
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>
10 years agotests: Add basic MPLS push test.
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>
10 years agostream-ssl: Add support for Windows platform.
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>
10 years agosocket-util: error number to string for sockets.
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>
10 years agopoll-loop: Make poll_fd_wait_event() cross-platform.
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>
10 years agotests: Add missing banner.
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>
10 years agoofproto-dpif-xlate: Make flows that match ICMP fields revalidate correctly.
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>
10 years agopcap-file: Allow capturing TCP streams where the SYN is not seen.
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>
10 years agoupcall: Add appctl call to set flow_limit.
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>
10 years agodatapath: Read tcp flags only then the tranport header is present.
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>
10 years agotests: Don't rely on strace for IPv6 IDL testcases.
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>
10 years agonetdev-dummy: disable periodic probing
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>
10 years agoofproto: Update documentation
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>
10 years agocollectors: Improve log message to better describe errors.
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>
10 years agoovs-thread: Add a comment.
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>
10 years agoFAQ: Correct typo.
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>
10 years agoFAQ: Describe the state of MPLS in Open vSwitch.
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>
10 years agotests: Add MPLS + VLAN tests.
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>
10 years agoAlways insert MPLS labels after VLAN tags.
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>
10 years agoofproto-dpif.at: Avoid races in "ofproto-dpif - dummy interface"
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>
10 years agonetdev-bsd: Fix tx/rx stats for type=tap netdev
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>
10 years agoAdd IPv6 support for OpenFlow, OVSDB, NetFlow, and sFlow.
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>
10 years agodatapath: Fix kernel style issues.
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>
10 years agoofproto-dpif.at: Avoid races by sleeping
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>
10 years agodaemon.at: Fix stderr races
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>
10 years agoofproto-dpif.at: Workaround races in megaflow tests
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>
10 years agoofprot-dpif.at: Fix races
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>
10 years agopackets: Fix userland implementation of set-field ipv6 addresses
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>
10 years agoEnhance userspace support for MPLS, for up to 3 labels.
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>
10 years agodaemon-windows: Add users for windows services.
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>
10 years agodaemon-windows: Ability to handle windows service calls.
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>
10 years agodpif-netdev: Make a log message more detailed.
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>
10 years agodatapath: flow_netlink: Use pr_fmt to OVS_NLERR
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>
10 years agodatapath: Use net_ratelimit in OVS_NLERR
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>
10 years agoAUTHORS: Add Ken Ajiro.
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>
10 years agoovs-vsctl: Update will be discarded when multiple ovs-vsctl are executed
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>
10 years agodpif-linux: remove useless includes
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>
10 years agom4: remove useless include from netlink check
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>
10 years agoofproto-dpif-xlate: Remove unused fitnessp pararameter from xlate_receive
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>
10 years agodatapath: Added (unsigned long long) cast in printf
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>
10 years agodatapath: avoid cast-qual warning in vport_priv
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>
10 years agodatapath: avoid warnings in vport_from_priv
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>
10 years agodatapth: Suppress error messages on megaflow updates
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>
10 years agosocket-util: Remove unused functions.
Ben Pfaff [Tue, 10 Dec 2013 01:28:32 +0000 (17:28 -0800)]
socket-util: Remove unused functions.

A Windows porter mentioned to me that these functions caused special
trouble in the Windows port.  However, they are no longer used, so we
might as well remove them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agoconfigure: Identify OpenSSL libraries in Windows.
Gurucharan Shetty [Thu, 30 Jan 2014 16:55:43 +0000 (08:55 -0800)]
configure: Identify OpenSSL libraries in Windows.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Fix ovs_flow_free() ovs-lock assert.
Pravin B Shelar [Tue, 28 Jan 2014 02:18:33 +0000 (18:18 -0800)]
datapath: Fix ovs_flow_free() ovs-lock assert.

ovs_flow_free() is not called under ovs-lock during packet
execute path (ovs_packet_cmd_execute()). Since packet execute
does not touch flow->mask, there is no need to take that
lock either. So move assert in case where flow->mask is checked.

Found by code inspection.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agocccl: Handle library paths for one shot compilation.
Gurucharan Shetty [Thu, 30 Jan 2014 00:08:49 +0000 (16:08 -0800)]
cccl: Handle library paths for one shot compilation.

When one wishes to compile and link a program with an
external library in one shot, additional
option "-link" is expected after all the other options. For example,

$ cl -I/c/OpenSSL-Win32/include 3.c -link -LIBPATH:"C:/OpenSSL-Win32/lib"

This is needed in an upcoming commit to compile conftest.c in autoconf.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoBUILD.Windows: Add documentation to handle the libtool change.
Gurucharan Shetty [Wed, 29 Jan 2014 23:34:03 +0000 (15:34 -0800)]
BUILD.Windows: Add documentation to handle the libtool change.

With the recent change to libtool, the default behavior is to use
MinGW's 'ld'. Set the LD variable to direct it to Visual Studio's
linker.

The wordings for the documentation is copied from INSTALL.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoBUILD.Windows: Clarify on the correct linker.
Gurucharan Shetty [Wed, 29 Jan 2014 23:28:42 +0000 (15:28 -0800)]
BUILD.Windows: Clarify on the correct linker.

This has tripped a couple of people.

The workaround in cccl does not actually work. So get rid of it and
clarify in documentation.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agobridge: Set ofport column in every database transaction.
Ben Pfaff [Fri, 31 Jan 2014 00:57:16 +0000 (16:57 -0800)]
bridge: Set ofport column in every database transaction.

Database transactions can occasionally fail due to concurrent changes in
the database.  When that happens, the next transaction should repeat the
changes that ovs-vswitchd tried to make the first time (adjusted for the
changes to the database).

The code to report the OpenFlow port number in use didn't do that.  It set
the ofport field once when it created the port and never set it again, even
if the transaction to set it failed.  This commit fixes the problem.

Bug #23047.
Reported-by: Suganya Ramachandran <suganyar@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto-dpif-upcall: Hardcode max_idle to 1500ms.
Ethan Jackson [Tue, 28 Jan 2014 00:40:27 +0000 (16:40 -0800)]
ofproto-dpif-upcall: Hardcode max_idle to 1500ms.

Before this patch, OVS tried to guess an optimal max idle time for
datapath flows based on the number of datapath flows relative to the
limit.  This caused instability because the limit was based on the
dump duration which was affected by the max idle time.  This patch
chooses instead to hardcode the max idle time to 1.5s except in
extreme case where the datapath flow limit is exceeded.  1.5s was
chosen to ensure pings occurring at once per second stay cached in the
datapath.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
10 years agoupcall: Avoid divide-by-zero calculating flow limit
Joe Stringer [Tue, 28 Jan 2014 21:04:35 +0000 (13:04 -0800)]
upcall: Avoid divide-by-zero calculating flow limit

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoutil: A generic function to convert error to string for windows.
Gurucharan Shetty [Thu, 16 Jan 2014 21:49:38 +0000 (13:49 -0800)]
util: A generic function to convert error to string for windows.

More users will be added in an upcoming commit.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agogetopt_long: Copy over the implementation from netbsd.
Gurucharan Shetty [Mon, 27 Jan 2014 16:52:57 +0000 (08:52 -0800)]
getopt_long: Copy over the implementation from netbsd.

Windows does not have a getopt_long function. This commit
copies over the getopt_long implementation from netbsd with
some minor modifications and is used only on Windows platform.

Modifications on top of the version in NetBSD repo.
* Remove header files not available in Visual Studio.
* Remove some unwanted #defines.
* Add Open vSwitch specific header files like config.h, vlog.h, util.h
* Add the following #define's
define __UNCONST(a)    ((void *)(unsigned long)(const void *)(a))
define _DIAGASSERT(q) ovs_assert(q)
define warnx VLOG_WARN
* Add extern declaration in getopt.h for optarg, optind.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dev.py: Only build the Linux datapath with GCC.
Ethan Jackson [Wed, 22 Jan 2014 19:06:23 +0000 (11:06 -0800)]
ovs-dev.py: Only build the Linux datapath with GCC.

In practice, Linux kernel modules are only built with GCC, so it
doesn't make much sense to spend time compiling them with clang.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
10 years agodaemon: Cleanup some functions.
Gurucharan Shetty [Fri, 10 Jan 2014 16:33:15 +0000 (08:33 -0800)]
daemon: Cleanup some functions.

Some functions are unused and some functions can be
declared as static.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agosyslog: Provide stub functions for openlog and syslog.
Gurucharan Shetty [Mon, 6 Jan 2014 21:54:21 +0000 (13:54 -0800)]
syslog: Provide stub functions for openlog and syslog.

One option to implement openlog and syslog functionality in Windows
is to use windows event logger. But it looks like it involves changing
registry settings and in general looks complicated.

For the time being, do nothing for syslog. All the information needed for
debugging will be present through the 'file' option anyways.

We can start OVS daemons on Windows with "-vfile:info -vsyslog:off".

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agosyslog: Add LOG_LOCALX definitions.
Gurucharan Shetty [Mon, 6 Jan 2014 21:12:21 +0000 (13:12 -0800)]
syslog: Add LOG_LOCALX definitions.

LOG_LOCAL0 is used in lib/vlog.c.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Handle negative number of threads.
Gurucharan Shetty [Wed, 22 Jan 2014 21:26:33 +0000 (13:26 -0800)]
ofproto: Handle negative number of threads.

As of now, setting other_config:n-handler-threads to a negative
value causes ovs-vswitchd to crash.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agonetdev-dummy: Add support for active stream
Andy Zhou [Wed, 18 Dec 2013 21:55:25 +0000 (13:55 -0800)]
netdev-dummy: Add support for active stream

The dummy ports thus far only support passive connections. It can
listen for multiple incoming connection requests but not make active
connections. This patch adds support of active stream, so that a
dummy port can be configured with either passive or active connections.

The net result is that dummy ports can now connect to each other,
without being patch ports. This feature will be useful in adding test
cases of future commits.

Signed-off-by: Andy Zhou <azhou@nicira.com>
10 years agonetlink: Rename 'dump->seq' to 'dump->nl_seq'
Joe Stringer [Tue, 21 Jan 2014 19:29:26 +0000 (11:29 -0800)]
netlink: Rename 'dump->seq' to 'dump->nl_seq'

An upcoming patch will introduce another, completely unrelated seq to
'struct nl_dump'. Giving this one a better name should reduce confusion.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: use const in some local vars and casts
Daniele Di Proietto [Thu, 23 Jan 2014 16:19:29 +0000 (17:19 +0100)]
datapath: use const in some local vars and casts

In few functions, const formal parameters are assigned or cast to
non-const.
These changes suppress warnings if compiled with -Wcast-qual.

Signed-off-by: Daniele Di Proietto <daniele.di.proietto@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Fix ovs_dp_cmd_msg_size()
Daniele Di Proietto [Thu, 23 Jan 2014 16:18:59 +0000 (17:18 +0100)]
datapath: Fix ovs_dp_cmd_msg_size()

commit c58cc9a460fd158e5250e59902e96ac677dc115f (datapath: Allow user space to
announce ability to accept unaligned Netlink messages) introduced
OVS_DP_ATTR_USER_FEATURES netlink attribute in datapath responses,
but the attribute size was not taken into account in ovs_dp_cmd_msg_size().

Signed-off-by: Daniele Di Proietto <daniele.di.proietto@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodpif-linux: Fix flow_dump_next annotation.
Joe Stringer [Tue, 21 Jan 2014 19:29:24 +0000 (11:29 -0800)]
dpif-linux: Fix flow_dump_next annotation.

The 'dpif_' parameter of dpif_linux_flow_dump_next() was marked as
OVS_UNUSED, even though it's passed down to dpif_linux_flow_get__().

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agolib/pcap-file: add 'ovs_' prefix to pcap functions
Luigi Rizzo [Thu, 23 Jan 2014 16:24:03 +0000 (17:24 +0100)]
lib/pcap-file: add 'ovs_' prefix to pcap functions

This is done to avoid collisions and confusions with libpcap symbols,
like pcap_read()

Signed-off-by: Luigi Rizzo <rizzo@iet.unipi.it>
Signed-off-by: Daniele Di Proietto <daniele.di.proietto@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agolib/netdev-bsd: simplify multiple struct definitions
Daniele Di Proietto [Thu, 23 Jan 2014 16:19:56 +0000 (17:19 +0100)]
lib/netdev-bsd: simplify multiple struct definitions

Use a macro helper to initialize different netdev_*_class for bsd, like
in lib/netdev-linux.c
This helps adding other netdev types for bsd

Signed-off-by: Daniele Di Proietto <daniele.di.proietto@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoMakefile: Use AM_V_GEN instead of echo.
Ethan Jackson [Wed, 22 Jan 2014 01:55:41 +0000 (17:55 -0800)]
Makefile: Use AM_V_GEN instead of echo.

The AM_V_GEN macro fits more cleanly with the automake silent rules
option.  When enabled it will print "GEN <filename>" instead of simply
echoing the command as before.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoconfigure: Enable silent rules.
Ethan Jackson [Wed, 22 Jan 2014 00:22:08 +0000 (16:22 -0800)]
configure: Enable silent rules.

Configure has an option which supports quieter compilation.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>