sliver-openvswitch.git
10 years agoMerge commit '4b60911067a82fbdfa87b7c2824412da20287ed8'
Giuseppe Lettieri [Fri, 5 Jul 2013 17:37:07 +0000 (19:37 +0200)]
Merge commit '4b60911067a82fbdfa87b7c2824412da20287ed8'

10 years agoMerge commit '559eb2308b4d616590aba34bb8f4dd7f12ae4587'
Giuseppe Lettieri [Fri, 5 Jul 2013 17:36:43 +0000 (19:36 +0200)]
Merge commit '559eb2308b4d616590aba34bb8f4dd7f12ae4587'

Conflicts:
Makefile.am

11 years agonetdev: Factor restoring flags into new "struct netdev_saved_flags".
Ben Pfaff [Fri, 10 May 2013 15:55:25 +0000 (08:55 -0700)]
netdev: Factor restoring flags into new "struct netdev_saved_flags".

This gets rid of the only per-instance data in "struct netdev", which
will make it possible to merge "struct netdev_dev" into "struct netdev" in
a later commit.

Ed Maste wrote the netdev-bsd changes in this commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Co-authored-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ed Maste <emaste@freebsd.org>
Tested-by: Ed Maste <emaste@freebsd.org>
11 years agoOpenFlow-level flow-based tunneling support.
Jarno Rajahalme [Thu, 9 May 2013 12:24:16 +0000 (15:24 +0300)]
OpenFlow-level flow-based tunneling support.

Adds tun_src and tun_dst match and set capabilities via new NXM fields
NXM_NX_TUN_IPV4_SRC and NXM_NX_TUN_IPV4_DST.  This allows management of
large number of tunnels via the flow tables, without requiring the tunnels
to be pre-configured.

Flow-based tunnels can be configured with options remote_ip=flow and
local_ip=flow.  local_ip=flow requires remote_ip=flow.  When set, the
tunnel remote IP address and/or local IP address is set from the flow,
instead of the tunnel configuration.

Example:

$ ovs-vsctl add-port br0 gre -- set Interface gre ofport_request=1 type=gre options:remote_ip=flow options:key=flow
$ ovs-ofctl add-flow br0 "in_port=LOCAL actions=set_tunnel:1,set_field:192.168.0.1->tun_dst,output:1"
$ ovs-ofctl add-flow br0 "in_port=1 tun_src=192.168.0.1 tun_id=1 actions=LOCAL"

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoUse updated dl_type when checking actions that use fields
Simon Horman [Fri, 10 May 2013 02:00:06 +0000 (11:00 +0900)]
Use updated dl_type when checking actions that use fields

Update handling of the following actions to use the dl_type set by MPLS
push and pop actions if it differs from the original dl_type. This is
consistent with the existing checking of load actions and allows
their existing checks to enforce dl_type pre-requisites correctly.

output_reg
bundle
reg_move
stack_push
stack_pop
learn
multipath

In order to avoid the verbosity of updating the flow for each applicable
action the update is treated as a common case and performed in
ofpact_check().  This was suggested by Jesse Gross.

Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoofpbuf: Fix small typo.
Justin Pettit [Thu, 2 May 2013 01:22:41 +0000 (18:22 -0700)]
ofpbuf: Fix small typo.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoINSTALL: Finish sentence about running tests with valgrind.
Justin Pettit [Wed, 8 May 2013 16:13:34 +0000 (09:13 -0700)]
INSTALL: Finish sentence about running tests with valgrind.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoflow: Fix IPv6 fragment packet handling
Takashi Kawaguchi [Thu, 9 May 2013 17:39:34 +0000 (02:39 +0900)]
flow: Fix IPv6 fragment packet handling

IPv6 fragmented packet (except first fragment) will not be handled
correctly. When extracting packet at parse_ipv6(), although nw_frag
should have both of FLOW_NW_FRAG_ANY and FLOW_NW_FRAG_LATER for
later fragment, only FLOW_NW_FRAG_LATER is set.

Signed-off-by: Takashi Kawaguchi <kawaguchi-takashi@mxd.nes.nec.co.jp>
Signed-off-by: Ken Ajiro <ajiro@mxw.nes.nec.co.jp>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto-dpif: Update 'facet->rule' stats in facet_push_stats().
Ethan Jackson [Thu, 2 May 2013 22:39:06 +0000 (15:39 -0700)]
ofproto-dpif: Update 'facet->rule' stats in facet_push_stats().

Before this patch, stats for 'facet->rule' were handled differently
than stats which 'facet' resubmitted into.  The former were
maintained in 'facet' until it was destroyed, while the latter were
pushed regularly in facet_push_stats().

This inconsistent behavior was not only confusing, it was often
incorrect.  In some circumstances, if a facet changed rules, it
could carry the statistics from the entirety of its lifetime from
the old rule to the new one.  This patch remedies the issue by
handling all rule stats in facet_push_stats().

Reported-by: Tmusic <Tmusic987@gmail.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Simplify send_packet().
Ethan Jackson [Wed, 8 May 2013 22:21:24 +0000 (15:21 -0700)]
ofproto-dpif: Simplify send_packet().

Before this patch, send_packet() manually constructed the required
datapath output actions.  This worked fine when these actions were
simple, however as outputting to tunnels and patch ports became
more complex, this required quite a bit of complex duplicated code.
This patch solves the problem by running through the standard
xlate_actions() code path instead.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Remove ofproto_update_local_port_stats().
Ethan Jackson [Wed, 8 May 2013 22:30:17 +0000 (15:30 -0700)]
ofproto-dpif: Remove ofproto_update_local_port_stats().

It's a bit odd, and not particularly useful.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Simplify ofproto_receive().
Ben Pfaff [Wed, 8 May 2013 20:19:39 +0000 (13:19 -0700)]
ofproto-dpif: Simplify ofproto_receive().

The tunnel and non-tunnel paths were pretty much the same anyway, so this
commit simplifies by merging them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotunnel: Make tnl_port_receive() parameter 'const'.
Ben Pfaff [Wed, 8 May 2013 20:21:11 +0000 (13:21 -0700)]
tunnel: Make tnl_port_receive() parameter 'const'.

This function no longer has much need to modify its argument, because the
caller can now easily do the modification itself, so this commit makes
that change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Make ofport_dpif_cast() internally consistent.
Ben Pfaff [Wed, 8 May 2013 20:18:12 +0000 (13:18 -0700)]
ofproto-dpif: Make ofport_dpif_cast() internally consistent.

This function's assertion would dereference a null pointer given a null
'ofport' argument, but its return statement checked for a null pointer
argument.  This commit fixes the inconsistency in favor of supporting
null pointer arguments.  (I discovered this problem while writing a piece
of code that wanted support for a null pointer argument, otherwise I would
resolve the inconsistency in the other direction.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoprocess: Fix indentation in header.
Ben Pfaff [Wed, 8 May 2013 21:11:27 +0000 (14:11 -0700)]
process: Fix indentation in header.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Keep perfect fitness on tunnel input.
Jarno Rajahalme [Mon, 6 May 2013 11:56:18 +0000 (14:56 +0300)]
ofproto-dpif: Keep perfect fitness on tunnel input.

As the flow is no longer modified (apart from the in_port) on tunnel
input, the perfect fitness can be retained.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Remove initial_vals.tunnel_ip_tos.
Jarno Rajahalme [Mon, 6 May 2013 11:56:17 +0000 (14:56 +0300)]
ofproto-dpif: Remove initial_vals.tunnel_ip_tos.

As tunnel metadata is no longer cleared on input, and the input
values are retained in 'ctx->flow' accross tunnel output actions,
there is no need to store the tunnel.ip_tos to initial_vals.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoKeep all of tunnel metadata in flow.
Jarno Rajahalme [Mon, 6 May 2013 11:56:16 +0000 (14:56 +0300)]
Keep all of tunnel metadata in flow.

Do not clear tunnel metadata on tunnel input. This is used by a later patch.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoNEWS: Modification of 'in_port' backported to 1.11.
Ben Pfaff [Wed, 8 May 2013 18:03:06 +0000 (11:03 -0700)]
NEWS: Modification of 'in_port' backported to 1.11.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAlways check return value of strftime().
Ben Pfaff [Thu, 2 May 2013 23:16:06 +0000 (16:16 -0700)]
Always check return value of strftime().

strftime() returns 0 and leaves the contents of the output buffer
unspecified if the output buffer is not big enough.  Thus, one should
check strftime()'s return value.  Until now, OVS has had a few invocations
of strftime() that did not check the return value.  This commit fixes
those.  I believe that the buffers were always large enough in each case,
but it's better to be safe.

Reported-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoDo not perform validation in learn_parse();
Simon Horman [Wed, 8 May 2013 01:50:15 +0000 (10:50 +0900)]
Do not perform validation in learn_parse();

I believe this is consistent with the handling of all other action
parsing called from parse_named_action().

Verification of all actions, including learn actions, occurs separately
in ofpact_check__(). It also occurs via in a call to ofpacts_check()
in parse_ofp_str(),

This patch is larger than might otherwise be expected as the flow argument
of learn_parse() is now unused and thus removed.  This propagates up the
call-chain some way.

This implementation was suggested by Jesse Gross in response to an
enhancement I made to the validation performed during parsing learn actions
to allow it to correctly account for changes to the dl_type due to MPLS
push and pop actions.

Tests have also been updated to check for the less specific messages
generated by the call to ofpacts_check() in parse_ofp_str() which at the
suggestion of Ben Pfaff was added by a prior patch for this purpose.

Cc: Jesse Gross <jesse@nicira.com>
Cc: Ben Pfaff <blp@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoCheck actions prerequisites in parse_ofp_str()
Simon Horman [Wed, 8 May 2013 01:50:14 +0000 (10:50 +0900)]
Check actions prerequisites in parse_ofp_str()

Add a call to ofpacts_check() in parse_ofp_str() to check pre-requisites.
This is in preparation for removing special-case pre-requisite checking
of learn actions which is useful for the test-suite.

This patch also fixes two tests which this change revealed to be incorrect.

1. Open Flow 1.0 action which sets NXM_NX_IPV6_SRC
   without any pre-requisites

   This is not valid because there should be an IPv6 pre-requisite.

   This portion of the test has been removed as IPv6 pre-requisites are
   only valid when using OXM or NXM, however the test appears
   to be a (non-NXM) Open Flow 1.0 test.

   It has been replaced with a similar test of an action
   that sets the IPv4 source address.

2. Open Flow 1.2 action which sets NXM_NX_IPV6_SRC
   without any pre-requisites.

   This is not valid because there should be an IPv6 pre-requisite.

   This test has been corrected by adding IPv6 as a pre-requisite,
   which is valid for Open Flow 1.2 as it uses OXM.

Use of ofpacts_check() in parse_ofp_str() suggested by Ben Pfaff.

Cc: Ben Pfaff <blp@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-pki: Reduce CA certificate validity to 10 years to fix 32-bit OpenSSL.
Ben Pfaff [Wed, 8 May 2013 17:20:10 +0000 (10:20 -0700)]
ovs-pki: Reduce CA certificate validity to 10 years to fix 32-bit OpenSSL.

Before I applied this commit, when I generated CA certificate with OpenSSL
0.9.8o on my 32-bit Debian system, I got a certificate that expired
sometime in 1977.  This made all SSL-based tests fail with an invalid
certificate.

32-bit time_t only extends to 2038, so this must be a bug in OpenSSL.
This commit works around the problem by reducing the validity period of
certificates to 10 years.

CC: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agometa-flow: Make 'in_port' field writable.
Ben Pfaff [Mon, 6 May 2013 22:38:36 +0000 (15:38 -0700)]
meta-flow: Make 'in_port' field writable.

OpenFlow says that an "output" action to a flow's input port is ordinarily
dropped, unless the flow explicitly outputs to OFPP_IN_PORT.  We've
occasionally been asked to implement some way to avoid this behavior in
cases where it is not easily known in advance whether a given port is the
input port (so that OFPP_IN_PORT is not easy to use).

This commit implements such a feature.  With this commit, one may write:
    actions=load:0->NXM_OF_IN_PORT[],output:123
which will output to port 123 regardless of whether it is the input port.
If the input port is important, then one may save and restore it on the
stack:
    actions=push:NXM_OF_IN_PORT[],load:0->NXM_OF_IN_PORT[],output:123,
            pop:NXM_OF_IN_PORT[]

(Sometimes I am asked whether "resubmit" changes the in_port and would
therefore interact badly with this feature.  It does not.   "resubmit" only
(optionally) changes the in_port used for the resubmit's flow table lookup.
It does not otherwise have any effect on in_port.)

Bug #14091.
CC: Jarno Rajahalme <jarno.rajahalme@nsn.com>
CC: Ronghua Zhang <rzhang@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Avoid figuring out sFlow and IPFIX actions twice.
Ben Pfaff [Sat, 4 May 2013 00:14:19 +0000 (17:14 -0700)]
ofproto-dpif: Avoid figuring out sFlow and IPFIX actions twice.

Not only is it easier to re-use the actions we already have, this avoids
potential problems due to the state that add_sflow_action() and
add_ipfix_action() look at having possibly been changed by
do_xlate_actions().  Currently those functions appear to look only at
the flow's 'in_port', which currently can't change.  However, an upcoming
commit will make it possible for actions to change the flow's 'in_port',
and in addition, with this change, one doesn't have to wonder whether these
functions might look at other state that translation might change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agobfd: Implement Bidirectional Forwarding Detection.
Ethan Jackson [Fri, 8 Jun 2012 19:42:42 +0000 (12:42 -0700)]
bfd: Implement Bidirectional Forwarding Detection.

Traditionally, Open vSwitch has used a variant of 802.1ag "CFM" for
interface liveness detection.  This has served us well until now,
but has several serious drawbacks which have steadily become more
inconvenient.  First, the 802.1ag standard does not implement
several useful features forcing us to (optionally) break
compatibility.  Second, 802.1.ag is not particularly popular
outside of carrier grade networking equipment.  Third, 802.1ag is
simply quite awkward.

In an effort to solve the aforementioned problems, this patch
implements BFD which is ubiquitous, well designed, straight
forward, and implements required features in a standard way.  The
initial cut of the protocol focuses on getting the basics of the
specification correct, leaving performance optimizations, and
advanced features as future work.  The protocol should be
considered experimental pending future testing.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agodatapath: Free skb dropped by lisp_tnl_send().
Jarno Rajahalme [Tue, 7 May 2013 17:52:03 +0000 (20:52 +0300)]
datapath: Free skb dropped by lisp_tnl_send().

vport->send functions must free the skbs they themselves report as
dropped (return 0).

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
11 years agoovs-ofctl: Fix bad info in comment on transact_multiple_noreply().
Ben Pfaff [Tue, 7 May 2013 17:19:40 +0000 (10:19 -0700)]
ovs-ofctl: Fix bad info in comment on transact_multiple_noreply().

Cut-and-paste error I guess.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovsdb-client: Fix recently introduced svec_sort() bug.
Justin Pettit [Tue, 7 May 2013 04:30:26 +0000 (21:30 -0700)]
ovsdb-client: Fix recently introduced svec_sort() bug.

Commit 66980be9 (ovsdb-client: Avoid assertion with multiple databases.)
passed in a pointer to an svec pointer, when it should have just been an
svec pointer.  This corrects the bug.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoovsdb-client: Avoid assertion with multiple databases.
Justin Pettit [Mon, 6 May 2013 19:43:48 +0000 (12:43 -0700)]
ovsdb-client: Avoid assertion with multiple databases.

When using ovsdb-client with an ovsdb-server with multiple databases, an
assertion could trigger due to them being returned in non-sorted order.
This commit changes the fetch_dbs() function to always return databases
in sorted order, since both callers are expecting that behavior.

Bug #16882

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Reported-by: Spiro Kourtessis <spiro@vmware.com>
11 years agoAllow master to build on Fedora with the recent threading changes
Ben Pfaff [Mon, 6 May 2013 22:41:29 +0000 (15:41 -0700)]
Allow master to build on Fedora with the recent threading changes

The recent threading changes have broken the build on Fedora,
and presumably other Red Hat based distributions. This adds an explicit
"-lpthread" to the linker command line and allows the latest master to build
on Fedora. I've also tested this on Ubuntu and it builds fine there.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
11 years agodatapath: Kill VPORT_F_TUN_ID vport flag.
Pravin B Shelar [Mon, 6 May 2013 17:34:19 +0000 (10:34 -0700)]
datapath: Kill VPORT_F_TUN_ID vport flag.

VPORT_F_TUN_ID is last remaining flag, once we remove it, flags
field from vport-ops can be removed.  Since it does not complicate
much code, we decided to remove this flag.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Move vport init to first port create.
Pravin B Shelar [Mon, 6 May 2013 17:32:12 +0000 (10:32 -0700)]
datapath: Move vport init to first port create.

vport->init and exit() functions are defined by gre and netdev vport
only and both can be moved to first port create.

Following patch does same, it moves vport init to respective vport
create and gets rid of vport->init() and vport->exit() functions.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Unify vport error stats handling.
Pravin B Shelar [Mon, 6 May 2013 17:31:01 +0000 (10:31 -0700)]
datapath: Unify vport error stats handling.

Following patch changes vport->send return type so that vport
layer can do error accounting.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agotunneling: Remove struct tnl_vport and tnl_ops.
Pravin B Shelar [Mon, 6 May 2013 17:29:08 +0000 (10:29 -0700)]
tunneling: Remove struct tnl_vport and tnl_ops.

After flow based tunneling, kernel tunneling is greatly simplified.
There is no need to have extra tunneling layer between vport and
particular protocol.
Following patch removes tunneling struct which make code easy to read.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Remove unused get_config vport op.
Jesse Gross [Sat, 4 May 2013 00:49:22 +0000 (17:49 -0700)]
datapath: Remove unused get_config vport op.

The get_config vport op is left over from old compatibility code,
it is neither used nor implemented any more.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agobridge: Correctly omit unsupported interface statistics from database.
Ben Pfaff [Fri, 3 May 2013 22:36:56 +0000 (15:36 -0700)]
bridge: Correctly omit unsupported interface statistics from database.

The database documentation says:

    If an interface does not support a given statistic, then that pair is
    omitted.

but in fact the implementation included the key-value pair for an
unsupported statistic with -1 as the value.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agonetdev-bsd: Use UINT64_MAX for unsupported stats.
Ed Maste [Fri, 3 May 2013 20:57:38 +0000 (16:57 -0400)]
netdev-bsd: Use UINT64_MAX for unsupported stats.

As documented in netdev-provider.h for the get_stats method.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-util: Fix type of 'port' param to ofputil_encode_dump_ports_request().
Ben Pfaff [Fri, 3 May 2013 21:01:56 +0000 (14:01 -0700)]
ofp-util: Fix type of 'port' param to ofputil_encode_dump_ports_request().

We always use unsigned types for port numbers elsewhere, so use one here
too.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoovs-ofctl: Make "ovs-ofctl monitor" respond to echo requests.
Ben Pfaff [Fri, 3 May 2013 20:58:29 +0000 (13:58 -0700)]
ovs-ofctl: Make "ovs-ofctl monitor" respond to echo requests.

Otherwise the command will time out after a while when there's no traffic,
which probably isn't what we want.

Reported-by: Henry Mai <hmai@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agorconn: Discard messages received on monitor connections.
Ben Pfaff [Wed, 24 Oct 2012 16:47:44 +0000 (09:47 -0700)]
rconn: Discard messages received on monitor connections.

Otherwise, if a monitor connection happens to be talking to a (misguided?)
peer that sends it messages, such as replies to what the peer perceives as
echo requests meant for it, then the peer will eventually hang trying to
send data because the monitor connection never sinks it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agorconn: Factor code out from copy_to_monitor().
Ben Pfaff [Wed, 24 Oct 2012 16:42:34 +0000 (09:42 -0700)]
rconn: Factor code out from copy_to_monitor().

This prepares for the introduction of a second user in the following
commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agosocket-util: restore building on FreeBSD.
Ed Maste [Fri, 3 May 2013 20:31:02 +0000 (16:31 -0400)]
socket-util: restore building on FreeBSD.

FreeBSD does not have EAI_ADDRFAMILY or EAI_NODATA and thus failed to build
after commit 3cbb5dc7e89df2b40bb6f715873cf2b6b25a7054 "socket-util: Use
getaddrinfo() instead of gethostbyname() for thread safety."

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovconn: Mark class structures as const.
Ben Pfaff [Fri, 26 Apr 2013 20:25:32 +0000 (13:25 -0700)]
vconn: Mark class structures as const.

These data structures are never modified so it seems logical for them
to be const.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-util: Make names[] in ofputil_action_code_from_name() const-ier.
Ben Pfaff [Fri, 26 Apr 2013 20:00:32 +0000 (13:00 -0700)]
ofp-util: Make names[] in ofputil_action_code_from_name() const-ier.

This changes allows the compiler to put 'names' in a read-only section.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovlog: Mark more static data const.
Ben Pfaff [Fri, 26 Apr 2013 18:30:21 +0000 (11:30 -0700)]
vlog: Mark more static data const.

These data structures are never modified so this seems like a
logical change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev-linux: Mark more static data as "const".
Ben Pfaff [Mon, 29 Apr 2013 21:34:48 +0000 (14:34 -0700)]
netdev-linux: Mark more static data as "const".

This makes this code more obviously thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agostream-fd: Mark 'fd_pstream_class' const.
Ben Pfaff [Fri, 26 Apr 2013 18:17:46 +0000 (11:17 -0700)]
stream-fd: Mark 'fd_pstream_class' const.

These data structures are never modified so this seems like a
logical change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev: Make 'smap' variable const in netdev_set_qos().
Ben Pfaff [Fri, 26 Apr 2013 18:13:04 +0000 (11:13 -0700)]
netdev: Make 'smap' variable const in netdev_set_qos().

This makes this code more obviously thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agohmap: Make HMAP_INITIALIZER a valid initializer for a const hmap.
Ben Pfaff [Fri, 26 Apr 2013 18:10:53 +0000 (11:10 -0700)]
hmap: Make HMAP_INITIALIZER a valid initializer for a const hmap.

Without this change, an initialization such as
    const struct hmap map = HMAP_INITIALIZER(&map);
yields a compiler warning "initialization discards qualifiers from pointer
target type".

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoMake most "struct option" instances "const".
Ben Pfaff [Tue, 23 Apr 2013 23:40:56 +0000 (16:40 -0700)]
Make most "struct option" instances "const".

Reducing non-const static data makes code more obviously thread-safe.
Although option parsing does not normally need to be thread-safe, I
don't know of a drawback to making its data const.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodpif-linux: Make dummy_action const in dpif_linux_init_flow_put().
Ben Pfaff [Tue, 23 Apr 2013 21:06:25 +0000 (14:06 -0700)]
dpif-linux: Make dummy_action const in dpif_linux_init_flow_put().

This makes this code more obviously thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agosystem-stats: Use getmntent_r() for thread-safety.
Ben Pfaff [Thu, 25 Apr 2013 23:59:15 +0000 (16:59 -0700)]
system-stats: Use getmntent_r() for thread-safety.

getmntent_r() is a GNU extension so we test for its existence and just
disable this feature of system stats if it is not present, because this
feature is not very important.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoUse gmtime_r() and localtime_r() instead of non-thread-safe versions.
Ben Pfaff [Fri, 5 Apr 2013 04:31:15 +0000 (23:31 -0500)]
Use gmtime_r() and localtime_r() instead of non-thread-safe versions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-benchmark: improve 'rate' command piped output support.
Andy Zhou [Mon, 29 Apr 2013 21:42:56 +0000 (14:42 -0700)]
ovs-benchmark: improve 'rate' command piped output support.

Add fflush() to the 'rate' command of 'ovs-benchmark'.  On a tty console
the output is line-buffered. However, piped output by default has a
deeper (usually 4KB) buffer, the output won't appear to the other end of
the pipe until this buffer is full.

This patch makes the piped output of the 'rate' command's consistent
with tty console output.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agosocket-util: Use getaddrinfo() instead of gethostbyname() for thread safety.
Ben Pfaff [Thu, 2 May 2013 21:34:45 +0000 (14:34 -0700)]
socket-util: Use getaddrinfo() instead of gethostbyname() for thread safety.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoUse pthread_sigmask() in place of sigprocmask(), for thread safety.
Ben Pfaff [Fri, 5 Apr 2013 17:25:50 +0000 (12:25 -0500)]
Use pthread_sigmask() in place of sigprocmask(), for thread safety.

POSIX says that multithreaded programs must not use sigprocmask() but must
use pthread_sigmask() instead.  This commit makes that replacement.

The actual use of signals in Open vSwitch is still not thread safe
following this commit, but this change is a necessary prerequisite for
fixing the other problems.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoChange sFlow model to reflect per-bridge sampling
Neil Mckee [Wed, 1 May 2013 05:38:53 +0000 (22:38 -0700)]
Change sFlow model to reflect per-bridge sampling

Until now, we were presenting a separate sFlow data-source (sampler) for
each ifIndex-interface.  This caused problems with samples that did not
easily map to an ifIndex being aliased together and breaking the sFlow
containment rules.  This patch changes the model to present a single sFlow
data-source for each bridge.  Now we can still make all reasonable effort
to map packet samples to ingress/egress ifIndex numbers, knowing that the
fallback to "unknown" does not break the sFlow model.  Note that
interface-counter-polling is still handled the same way as before, with
sFlow counter-polling data only being exported for ifIndex-interfaces.

Signed-off-by: Neil Mckee <neil.mckee@inmon.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Immediately exit on error in ovs_vport_cmd_set().
Jesse Gross [Thu, 2 May 2013 17:14:54 +0000 (10:14 -0700)]
datapath: Immediately exit on error in ovs_vport_cmd_set().

It is an error to try to change the type of a vport using the set
command. However, while we check that this is an error, we still
proceed to allocate memory which then gets freed immediately.
This stops processing after noticing the error, which does not
actually fix a bug but is more correct.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
11 years agodpif-linux: Close channel Netlink sockets when a port number gets recycled.
Ben Pfaff [Thu, 2 May 2013 00:08:20 +0000 (17:08 -0700)]
dpif-linux: Close channel Netlink sockets when a port number gets recycled.

When ovs-vswitchd deletes a port with dpif_linux_port_del(), that function
uses del_channel() to delete the corresponding channel, including closing
its Netlink socket fd.  However, if the vport gets removed by some other
process (e.g. "ip link delete" for veths) then this function never gets
called and thus the channel never gets deleted.

This commit partially fixes the problem.  Now, if a port number gets
reused, add_channel() closes the old Netlink socket assigned to that port
before it installs the new one.

Bug #16784.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodpif-linux: Use MAX_PORTS instead of hard-coded 65535.
Ben Pfaff [Wed, 1 May 2013 23:54:18 +0000 (16:54 -0700)]
dpif-linux: Use MAX_PORTS instead of hard-coded 65535.

MAX_PORTS is currently USHRT_MAX (also 65535).  I think that's a
coincidence; I don't remember MAX_PORTS being mentioned when the new
dpif_channel code was written.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoFAQ: Indicate LTS is now the 1.9.x series.
Justin Pettit [Thu, 2 May 2013 07:15:42 +0000 (00:15 -0700)]
FAQ: Indicate LTS is now the 1.9.x series.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoMake it more obvious that OVS_KEY_ATTR_MPLS may be an array
Simon Horman [Thu, 2 May 2013 01:49:49 +0000 (10:49 +0900)]
Make it more obvious that OVS_KEY_ATTR_MPLS may be an array

Note that OVS_KEY_ATTR_MPLS may be an array of ovs_key_mpls
and that the acceptable length may be restricted by the implementation.

Currently the user-space datapath and proposed kernel datapath
implementation restrict the length to a single element.

Also update the mpls_top_lse name of the element of struct ovs_key_mpls,
as it is an array of LSEs and thus not necessarily just the top LSE.

As requested by Jesse Gross

Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoSet release date for 1.10.0.
Justin Pettit [Wed, 1 May 2013 21:30:38 +0000 (14:30 -0700)]
Set release date for 1.10.0.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoovs-sandbox: Use $schema for creating the db.
Duffie Cooley [Wed, 1 May 2013 19:23:36 +0000 (12:23 -0700)]
ovs-sandbox: Use $schema for creating the db.

The code here went to some trouble to properly set $schema and then
ignored it.

Signed-off-by: Duffie Cooley <dcooley@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoRemove spurious IPv4 data from MPLS packet test
Simon Horman [Wed, 1 May 2013 08:05:26 +0000 (17:05 +0900)]
Remove spurious IPv4 data from MPLS packet test

Supplying this data is somewhat misleading as it
is completely ignored and is not included in
the synthesised packet.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoSetting tag sliver-openvswitch-1.10.90-2 sliver-openvswitch-1.10.90-2
Giuseppe Lettieri [Wed, 1 May 2013 13:56:10 +0000 (15:56 +0200)]
Setting tag sliver-openvswitch-1.10.90-2
- fixed several bugs in the external-nodes support in exp-tool/Makefile
- let sliver-ovs return an error if tap device configuration failed

11 years agodpif-netdev: Shorten delay loops.
Ben Pfaff [Tue, 30 Apr 2013 00:49:25 +0000 (17:49 -0700)]
dpif-netdev: Shorten delay loops.

Um, I mean, remove useless code.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Add ipfix-entities.def to gitignore.
Ethan Jackson [Mon, 29 Apr 2013 19:46:45 +0000 (12:46 -0700)]
ofproto: Add ipfix-entities.def to gitignore.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Fix 'size' argument to fix_sflow_action().
Ben Pfaff [Tue, 30 Apr 2013 18:24:11 +0000 (11:24 -0700)]
ofproto-dpif: Fix 'size' argument to fix_sflow_action().

The sflow action only uses 8 bytes of the total 16 for user_action_cookie,
but fix_sflow_action() was checking for the presence of all 16, so if the
sflow action wasn't followed by a few other actions then 'cookie' would
end up NULL and the assertion would segfault.

Bug #16659.
Reported-by: Dhaval Badiani <dbadiani@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Remove unneeded ovs_netdev_get_ifindex()
Thomas Graf [Tue, 30 Apr 2013 15:47:42 +0000 (08:47 -0700)]
datapath: Remove unneeded ovs_netdev_get_ifindex()

The only user is get_dpifindex(), no need to redirect via the port
operations.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoworker: Prevent worker from being responsible for pidfile deletion.
Gurucharan Shetty [Mon, 29 Apr 2013 02:25:55 +0000 (19:25 -0700)]
worker: Prevent worker from being responsible for pidfile deletion.

Currently we are creating the worker process after creation of the pidfile.
This means that the responsibility of deleting the pidfile after process
termination rests with the worker process.

When we restart openvswitch using the startup scripts, we SIGTERM the main
process and once it is cleaned up, we start ovs-vswitchd again. This results
in a race condition. The new ovs-vswitchd will create a pidfile because it is
unlocked. But, if the old worker process exits after the start of new
ovs-vswitchd, it will simply delete the pidfile underneath the new ovs-vswitchd.
This will eventually result in multiple ovs-vswitchd daemons.

This patch gives the responsibility of deleting the pidfile to the main
process.

Bug #16669.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agovswitchd: Disable system stats collection on a concurrently running daemon.
Gurucharan Shetty [Sun, 28 Apr 2013 02:58:12 +0000 (19:58 -0700)]
vswitchd: Disable system stats collection on a concurrently running daemon.

There are very rare cases (ex: ovs-vswitchd.pid is inadvertantly deleted),
when multiple ovs-vswitchd daemons can end up running at the same time.
In a situation like that one of the daemons can wait on the poll()
with a 0 ms wait time as it would be expecting system stats to be collected.

But system stats are never run for the daemon that does not have the
lock on the database and hence it takes up 100% of the CPU if its state
machine for stats collection previously was S_WAITING.

With this patch, we disable the system stats collection for the daemon that
does not have the database lock. When it eventually gets the lock on the
database, system stats are automatically enabled if other_config:\
enable-statistics=true.

Bug #16669.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agonetlink-socket: Use xmalloc() instead of malloc().
Ben Pfaff [Fri, 26 Apr 2013 21:15:37 +0000 (14:15 -0700)]
netlink-socket: Use xmalloc() instead of malloc().

This was the only obvious use of bare malloc() in the tree, other
than in the implementation of wrapper functions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetlink-socket: Minor style fix.
Ben Pfaff [Tue, 9 Apr 2013 18:18:27 +0000 (11:18 -0700)]
netlink-socket: Minor style fix.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotimeval: Remove prototype for unimplemented function.
Ben Pfaff [Fri, 26 Apr 2013 16:46:30 +0000 (09:46 -0700)]
timeval: Remove prototype for unimplemented function.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoPrepare for post-1.11.0 (1.11.90).
Justin Pettit [Mon, 29 Apr 2013 21:44:34 +0000 (14:44 -0700)]
Prepare for post-1.11.0 (1.11.90).

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoPrepare for 1.11.0
Justin Pettit [Mon, 29 Apr 2013 21:46:05 +0000 (14:46 -0700)]
Prepare for 1.11.0

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agodatapath: Use generic struct pcpu_tstats.
Pravin B Shelar [Mon, 29 Apr 2013 21:45:08 +0000 (14:45 -0700)]
datapath: Use generic struct pcpu_tstats.

Rather than defining ovs specific stats struct (vport_percpu_stats),
we can use existing pcpu_tstats to achieve exactly same functionality.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodpif-netdev: Update max_mtu correctly.
Ben Pfaff [Fri, 26 Apr 2013 18:35:43 +0000 (11:35 -0700)]
dpif-netdev: Update max_mtu correctly.

What a dumb bug.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovxlan: Correct comments and NEWS to reflect IANA port assigment.
Jesse Gross [Mon, 29 Apr 2013 17:01:00 +0000 (10:01 -0700)]
vxlan: Correct comments and NEWS to reflect IANA port assigment.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoAdd FAQ entries around the VXLAN support in Open vSwitch.
Kyle Mestery [Fri, 26 Apr 2013 18:30:25 +0000 (14:30 -0400)]
Add FAQ entries around the VXLAN support in Open vSwitch.

Add a section to the FAQ explaining VXLAN with a pointer to the IETF draft.
Add sections detailing how much of the VXLAN protocol is currently supported
in OVS, along with a section explaining the default UDP port and how to change
this when creating VXLAN ports.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoUpdate the default VXLAN destination UDP port to the IANA assigned port
Kyle Mestery [Fri, 26 Apr 2013 18:30:24 +0000 (14:30 -0400)]
Update the default VXLAN destination UDP port to the IANA assigned port

VXLAN was recently assigned UDP port 4789 by IANA. This
comit updates the OVS VXLAN implementation to reflect the new UDP port
number.

Cc: Kenneth Duda <kduda@aristanetworks.com>
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agocheck that tap device is actually created
Giuseppe Lettieri [Thu, 25 Apr 2013 15:39:32 +0000 (17:39 +0200)]
check that tap device is actually created

11 years agofixed missing dependency
Giuseppe Lettieri [Thu, 25 Apr 2013 15:38:52 +0000 (17:38 +0200)]
fixed missing dependency

11 years agofix fake shutdown of external nodes
Giuseppe Lettieri [Wed, 24 Apr 2013 08:29:23 +0000 (10:29 +0200)]
fix fake shutdown of external nodes

11 years agoMerge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
Giuseppe Lettieri [Mon, 22 Apr 2013 10:52:15 +0000 (12:52 +0200)]
Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch

11 years agofix dependencies for external nodes
Giuseppe Lettieri [Mon, 22 Apr 2013 10:51:37 +0000 (12:51 +0200)]
fix dependencies for external nodes

11 years agoSetting tag sliver-openvswitch-1.10.90-1 sliver-openvswitch-1.10.90-1
Thierry Parmentelat [Mon, 22 Apr 2013 06:14:50 +0000 (08:14 +0200)]
Setting tag sliver-openvswitch-1.10.90-1
merged with upstream (develoment version 1.10.90)
integrated ALLEGRA contributions for the termination of virtual cables in external nodes.

11 years agoupdate mainstream version number
Thierry Parmentelat [Mon, 22 Apr 2013 06:08:45 +0000 (08:08 +0200)]
update mainstream version number

11 years agobridge: Report PID of yielding process when multiple instances run.
Justin Pettit [Mon, 8 Apr 2013 17:44:50 +0000 (10:44 -0700)]
bridge: Report PID of yielding process when multiple instances run.

Normally, the daemon code will detect when multiple instances are run
and print the conflicting PID.  However, if ovs-vswitchd is not run in
daemon mode or the pidfile is removed, a database lock is checked.  The
message it prints wasn't specific enough about which process was backing
off due to not getting the lock.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agodatapath: Account for RHEL6.4 backports in compat layer
Thomas Graf [Thu, 25 Apr 2013 12:28:16 +0000 (14:28 +0200)]
datapath: Account for RHEL6.4 backports in compat layer

Explicitly check the availability of several kernel API functions
instead of relying on the kernel version to account for Red Hat
Enterprise Linux backports.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Use openvswitch_handle_frame hook in >=RHEL6.4 to live side by side with...
Thomas Graf [Thu, 25 Apr 2013 12:28:15 +0000 (14:28 +0200)]
datapath: Use openvswitch_handle_frame hook in >=RHEL6.4 to live side by side with bridging

Due to the missing register rx_handler API in the kernel RHEL6 is
based on, the datapath currently falls back to using the bridging
hook with the consequence that bridging and OVS cannot be used in
parallel on any RHEL6 release.

For this purpose, >=RHEL6.4 releases provide a special rx frame hook
to be used by OVS. It captures frames at the same location in the
stack as the rx_handler would do in more recent kernel releases. In
order to store the vport pointer, the net_device's ax25_ptr field is
utilized under the assumption that an AX25 device will never be
attached to an OVS bridge.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoFAQ: Explain why VMs on a VLAN can't access the Internet.
Ben Pfaff [Wed, 24 Apr 2013 18:47:36 +0000 (11:47 -0700)]
FAQ: Explain why VMs on a VLAN can't access the Internet.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agomatch: Correct formatting of MPLS
Simon Horman [Wed, 24 Apr 2013 09:02:35 +0000 (18:02 +0900)]
match: Correct formatting of MPLS

1. mpls or mplsm should be included in the formatted match  instead of
   dl_type=0xXXXX if the dl_type of the match is ETH_TYPE_MPLS or
   ETH_TYPE_MPLS_MCAST respectively. This is consistent with the treatment
   of other dl_types in match_format().

2. Add formatting of MPLS TTL to match_format().
   The format is mpls_ttl=YY.

3. Set the mpls_lse mask of a match to all 1's if
   the dl_type of the flow is ETH_TYPE_MPLS or ETH_TYPE_MPLS_MCAST.
   This will cause mpls_label=LLLL,mpls_tc=W,mpls_ttl=YY,mpls_bos=Z to
   be included with the match is formatted.

4. mpls(label:LLLL,tc:W,ttl:TT,bos:Z) and
   mplsm(label:LLLL,tc:W,ttl:TT,bos:Z) should not be included
   in a formatted match as this is not consistent with the
   formatting of other match elements.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoFAQ: Describe how to connect bridges with patch ports.
Ben Pfaff [Tue, 23 Apr 2013 16:30:14 +0000 (09:30 -0700)]
FAQ: Describe how to connect bridges with patch ports.

I keep seeing this question.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotimeval: Check for HAVE_BACKTRACE instead of HAVE_EXECINFO_H.
Ben Pfaff [Tue, 23 Apr 2013 18:07:25 +0000 (11:07 -0700)]
timeval: Check for HAVE_BACKTRACE instead of HAVE_EXECINFO_H.

Other code in the tree uses HAVE_BACKTRACE and then blindly includes
<execinfo.h> if it is present, so this doesn't make anything worse.

Once we do that, HAVE_EXECINFO_H has no further users, so this commit also
removes the check for <execinfo.h>

Reported-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodeal with platforms where backtrace() is in a different library than libc.
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:00 +0000 (22:20 +0900)]
deal with platforms where backtrace() is in a different library than libc.

execinfo for NetBSD and ubacktrace for uClibc.
i don't know if the latter is relevant to Open vSwitch, though.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodebian: force-reload-kmod while package upgrading.
Gurucharan Shetty [Wed, 10 Apr 2013 22:09:00 +0000 (15:09 -0700)]
debian: force-reload-kmod while package upgrading.

Currently, when we upgrade openvswitch packages, we do a restart
of userspace daemons automatically. This does not replace the
kernel module.

But almost everytime, we want to use the new kernel module
that comes with the new version. This means that we need to
manually do a "force-reload-kmod". This step, reloads the
kernel module and also restarts the userspace daemons. This gives
us a total of two restarts of userspace daemons. This is quite
expensive in a hypervisor with hundreds of VMs sending real traffic.
This also hurts the controller as it gets two reconnections in a short
amount of time.

With this patch, during a package upgrade, if the kernel module
on disk is different than the one that is loaded, we will
automatically do a force-reload-kmod while openvswitch-switch
is installed. If not, we will just do a "restart" like before.

One can install the kernel package first and then install the userspace
packages in 2 separate steps to enforce a single 'force-reload-kmod'.

If anyone wants to just restart the userspace package instead of
force-reload-kmod, they can set the value of OVS_FORCE_RELOAD_KMOD=no
while installing the package.
Ex: OVS_FORCE_RELOAD_KMOD=no dpkg -i openvswitch-switch*

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoINSTALL.Debian: Update instructions related to package ordering.
Gurucharan Shetty [Wed, 10 Apr 2013 22:08:39 +0000 (15:08 -0700)]
INSTALL.Debian: Update instructions related to package ordering.

If we install the userspace packages first, without a kernel module
present in the correct path, we get an error because package install
automatically tries to start the userspace daemons and we look for
a kernel module to load.

Installing a kernel module package first and then following it by
userspace package sounds like the correct way to do it. This change
in ordering helps my next commit.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>