sliver-openvswitch.git
10 years agoofproto-dpif: Make "fdb/show" report OpenFlow port numbers.
Ben Pfaff [Tue, 21 May 2013 00:14:27 +0000 (17:14 -0700)]
ofproto-dpif: Make "fdb/show" report OpenFlow port numbers.

Users are more likely to be able to reasonably interpret OpenFlow port
numbers than datapath port numbers.

This issue has existed since at least 2011 but only recently has it been
possible for OpenFlow and datapath port numbers to differ (except for the
"local" port).

Reported-by: Christopher Paggen <cpaggen@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: New function ofputil_port_to_string().
Ben Pfaff [Mon, 24 Jun 2013 20:18:46 +0000 (13:18 -0700)]
ofp-util: New function ofputil_port_to_string().

This function is more convenient than ofputil_format_port() when a "struct
ds" is not already in use.  This commit converts one caller for which this
was already true, and the following commit will add another.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Do not clear key in ovs_match_init()
Jesse Gross [Mon, 24 Jun 2013 19:21:29 +0000 (12:21 -0700)]
datapath: Do not clear key in ovs_match_init()

When executing packets sent from userspace, the majority of the
flow information is extracted from the packet itself and a small
amount of metadata supplied by userspace is added. However, when
adding this metadata, the extracted flow information is currently
being cleared.

This manifests in a problem when executing actions as elements of key are
used when verifying some actions. For example a dec_ttl action verifies the
proto of the flow. An example of a flow that fails as a result of this
problem is:

        ovs-ofctl add-flow br0 "ip actions=dec_ttl,normal"

This is a regression added by "datapath: Mega flow implementation",
a1c564be1e2ffc31f8da09ab654c8ed987907fe5.

CC: Andy Zhou <azhou@nicira.com>
Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoacinclude: Improve detection of not-understood compiler options with clang.
Ben Pfaff [Mon, 24 Jun 2013 19:25:48 +0000 (12:25 -0700)]
acinclude: Improve detection of not-understood compiler options with clang.

By default, clang warns about but does not fail on unknown -W options.
This made configure add the option to WARNING_FLAGS, which caused the
warning about not-understood warnings to be emitted for every file
compiled.

In combination with -Werror, clang does fail on unknown -W options.  This
commit adds -Werror during configure's warning tests, which should cause
the not-understood warnings to be detected that way.

Reported-by: Ed Maste <emaste@freebsd.org>
Tested-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofpacts_check: Remove unnecessary flow copying.
Jarno Rajahalme [Thu, 20 Jun 2013 14:26:17 +0000 (17:26 +0300)]
ofpacts_check: Remove unnecessary flow copying.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Add GSO/Tunnel links to gitignore
Joe Stringer [Mon, 24 Jun 2013 00:59:24 +0000 (09:59 +0900)]
datapath: Add GSO/Tunnel links to gitignore

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Fix a kernel crash caused by corrupted mask list.
Andy Zhou [Fri, 21 Jun 2013 23:07:08 +0000 (16:07 -0700)]
datapath: Fix a kernel crash caused by corrupted mask list.

When flow table is copied, the mask list from the old table
is not properly copied into the new table. The corrupted mask
list in the new table will lead to kernel crash. This patch
fixes this bug.

Bug #18110
Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Fix uninitializaed variable with GRE GSO.
Jesse Gross [Fri, 21 Jun 2013 22:28:20 +0000 (15:28 -0700)]
datapath: Fix uninitializaed variable with GRE GSO.

If a packet is neither GSO nor CHECKSUM_PARTIAL then the
GRE GSO compatibility code can use an uninitialized IP ID.

CC: Pravin Shelar <pshelar@nicira.com>
Reported-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoofp-errors: Make ofperr_decode() static.
Ben Pfaff [Wed, 13 Feb 2013 07:18:30 +0000 (23:18 -0800)]
ofp-errors: Make ofperr_decode() static.

It had no users outside of ofp-errors.c.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-errors: Fix typos in comment.
Ben Pfaff [Wed, 13 Feb 2013 05:12:06 +0000 (21:12 -0800)]
ofp-errors: Fix typos in comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agogre: Restructure tunneling.
Pravin B Shelar [Fri, 21 Jun 2013 00:11:43 +0000 (17:11 -0700)]
gre: Restructure tunneling.

Following patch restructures ovs tunneling and gre vport
implementation to make ovs tunneling more in sync with
upstream kernel tunneling.  Doing this tunneling code is
simplified as most of protocol processing on send and
recv is pushed to kernel tunneling.  For external ovs
module the code is moved to kernel compatibility code.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Use a single attribute array for parsing values and masks.
Jesse Gross [Fri, 21 Jun 2013 00:08:09 +0000 (17:08 -0700)]
datapath: Use a single attribute array for parsing values and masks.

When parsing flow Netlink messages we currently have arrays to hold the
attribute pointers for both values and masks. This results in a large
stack, which some compilers warn about. It's not actually necessary
to have both arrays at the same time, so we can collapse this to a
single array.

Reported-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoofproto-dpif: Use megaflows.
Justin Pettit [Tue, 21 May 2013 00:48:49 +0000 (17:48 -0700)]
ofproto-dpif: Use megaflows.

The commit configures the masks generated from megaflows and pushes
them through the dpif layer.

With this commit and a wildcard supporting OVS kernel module,
ovs-vswitchd's flow setup rate is very close to that of the Linux
bridge.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodpif: Log flow masks for "put" and "dump_next".
Justin Pettit [Thu, 20 Jun 2013 20:43:56 +0000 (13:43 -0700)]
dpif: Log flow masks for "put" and "dump_next".

When debugging the system, it's useful to not just see the key but
also the mask.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Handle failed flow 'put's.
Justin Pettit [Tue, 11 Jun 2013 01:09:53 +0000 (18:09 -0700)]
ofproto-dpif: Handle failed flow 'put's.

If a flow cannot be installed in the datapath, we should notice
this and not treat it as installed.  This becomes an issue with
megaflows, since a batch of unique flows may come in that generate
a single new datapath megaflow that covers them.  Since userspace
doesn't know whether the datapath supports megaflows, each unique
flow will get a separate flow entry (which overlap when masks are
applied) and all except the first will get rejected by a megaflow-
supporting datapath as duplicates.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Introduce odp_flow_key_from_mask().
Justin Pettit [Thu, 6 Jun 2013 01:56:58 +0000 (18:56 -0700)]
odp-util: Introduce odp_flow_key_from_mask().

Add a new function for converting a mask into a set of
OVS_KEY_ATTR* attributes.  This will be useful in a future commit.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Return EEXIST on overlapping new flow request
Andy Zhou [Thu, 20 Jun 2013 23:36:04 +0000 (16:36 -0700)]
datapath: Return EEXIST on overlapping new flow request

Flow update still requires unmasked key to match. If not,
return EINVAL.

CC: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoFAQ: Describe how to use ovs-ofctl with OpenFlow 1.1+.
Ben Pfaff [Thu, 20 Jun 2013 22:15:40 +0000 (15:15 -0700)]
FAQ: Describe how to use ovs-ofctl with OpenFlow 1.1+.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests: Tolerate init process pid != 1.
James Page [Thu, 20 Jun 2013 21:31:52 +0000 (22:31 +0100)]
tests: Tolerate init process pid != 1.

On Ubuntu Saucy based desktops, upstart runs with user sessions
enabled which means that the init process under which a daemon
might run is not always pid = 1.

Instead of checking for pid = 1, check to ensure that the parent
pid of the monitor is not the pid of the shell that started it.

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotest-classifier.c: Use UINT16_MAX instead of OFPP_NONE in mask assignment
Alex Wang [Thu, 20 Jun 2013 22:10:04 +0000 (15:10 -0700)]
test-classifier.c: Use UINT16_MAX instead of OFPP_NONE in mask assignment

It is more comprehensible to use UINT16_MAX in mask assignment than OFPP_NONE.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Remove prototype of non-existing function.
Jarno Rajahalme [Thu, 20 Jun 2013 14:26:16 +0000 (17:26 +0300)]
ofp-util: Remove prototype of non-existing function.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agosparse: Remove prototypes for thread-unsafe functions from headers.
Ben Pfaff [Wed, 19 Jun 2013 18:44:48 +0000 (11:44 -0700)]
sparse: Remove prototypes for thread-unsafe functions from headers.

This ensures that attempts to use them cause sparse to complain.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoCreate specific types for ofp and odp port
Alex Wang [Wed, 19 Jun 2013 23:58:44 +0000 (16:58 -0700)]
Create specific types for ofp and odp port

Until now, datapath ports and openflow ports were both represented by
unsigned integers of various sizes. With implicit conversions, etc., it is
easy to mix them up and use one where the other is expected.  This commit
creates two typedefs, ofp_port_t and odp_port_t.  Both of these two types
are marked by "__attribute__((bitwise))" so that sparse can be used to
detect any misuse.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dpctl: Add mega flow support
Andy Zhou [Wed, 19 Jun 2013 07:15:10 +0000 (07:15 +0000)]
ovs-dpctl: Add mega flow support

Added support to allow mega flow specified and displayed. ovs-dpctl tool
is mainly used as debugging tool.

This patch also implements the low level user space routines to send
and receive mega flow netlink messages. Those netlink suppor
routines are required for forthcoming user space mega flow patches.

Added a unit test to test parsing and display of mega flows.

Ethan contributed the ovs-dpctl mega flow output function.

Co-authored-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Mega flow implementation
Andy Zhou [Mon, 17 Jun 2013 14:51:00 +0000 (07:51 -0700)]
datapath: Mega flow implementation

Add wildcarded flow support in kernel datapath.

Wildcarded flow can improve OVS flow set up performance by avoid sending
matching new flows to the user space program. The exact performance boost
will largely dependent on wildcarded flow hit rate.

In case all new flows hits wildcard flows, the flow set up rate is
within 5% of that of linux bridge module.

Pravin has made significant contributions to this patch. Including API
clean ups and bug fixes.

Co-authored-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
[jesse: Additional documentation, fix memory leak, and improve validation.]
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agovswitchd: Update flow-eviction-threshold documentation
Joe Stringer [Thu, 20 Jun 2013 00:25:30 +0000 (09:25 +0900)]
vswitchd: Update flow-eviction-threshold documentation

Patch 27a88d1373cbfcceac6d901bbf1c17051aa7845f caused the vswitchd
documentation and the code to digress. This brings them back in line.

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-vsctl: Improve error message for "ovs-vsctl del-port <bridge>".
Ben Pfaff [Wed, 19 Jun 2013 04:01:33 +0000 (21:01 -0700)]
ovs-vsctl: Improve error message for "ovs-vsctl del-port <bridge>".

Previously, commands like this:
    ovs-vsctl add-br br0
    ovs-vsctl del-port br0
yielded an error message like:
    no port named br0
which is confusing.  This commit improves the error message to:
    cannot delete port br0 because it is the local port for bridge br0
    (deleting this port requires deleting the entire bridge)

Bug #17994.
Reported-by: Reid Price <reid@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Tighten up megaflow wildcard handling.
Justin Pettit [Wed, 19 Jun 2013 06:55:47 +0000 (23:55 -0700)]
ofproto-dpif: Tighten up megaflow wildcard handling.

A number of use-cases weren't handled properly when determining what can
be wildcarded for megaflows.  This commit both catches additional fields
that cannot be wildcarded and loosens a few other cases.

Bug #17979

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Revalidate on ofproto removal.
Ethan Jackson [Wed, 19 Jun 2013 02:22:56 +0000 (19:22 -0700)]
ofproto-dpif: Revalidate on ofproto removal.

When an ofproto is removed, this will likely require revalidation
of flows owned by other ofprotos under the same backer.

Found by inspection.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Reconfigure when netflow is enabled/disabled.
Ethan Jackson [Wed, 19 Jun 2013 01:03:32 +0000 (18:03 -0700)]
ofproto-dpif: Reconfigure when netflow is enabled/disabled.

The presence or absence of netflow affects wildcarding, and
therefore need to cause a revalidation when changed.

Found by inspection.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-xapi-sync: Make bridge-id caching logic easier to understand.
Ben Pfaff [Wed, 19 Jun 2013 17:49:36 +0000 (10:49 -0700)]
ovs-xapi-sync: Make bridge-id caching logic easier to understand.

The previous code had many subtleties that were easy to miss.  This code
is intended to be more obviously correct.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Tested-by: Gurucharan Shetty <shettyg@nicira.com>
10 years agotests: Add test-hindex to gitignore.
Ethan Jackson [Tue, 18 Jun 2013 20:54:53 +0000 (13:54 -0700)]
tests: Add test-hindex to gitignore.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-xapi-sync: Cache the bridge-id value for non nicira-bridge-id too.
Gurucharan Shetty [Sun, 16 Jun 2013 12:09:20 +0000 (05:09 -0700)]
ovs-xapi-sync: Cache the bridge-id value for non nicira-bridge-id too.

Currently we connect to xapi in case there are multiple
external_ids:xs-network-uuids to get the single bridge id everytime
we have a change in the database for all the interested columns in
ovs-xapi-sync. The xs-network-uuids value can also change whenever
new VLANs are added or deleted, which is a common use case. The
disadvantage with this approach is that we query XAPI more often
and set the bridge-id as "" if we don't get a valid response for
our query. This can take down the logical connectivity for all the
VMs on that xenserver.

Instead of looking at the PIF records for all the xs-network-uuids,
we can instead just look at the xapi record which has the same bridge
name as the OVS bridge name and then cache its uuid. This value will
hold true till the OVS bridge is recreated in which case we will re-read
the value.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoofproto-dpif: Store patch port peer in struct ofport_dpif.
Ethan Jackson [Mon, 17 Jun 2013 21:04:36 +0000 (14:04 -0700)]
ofproto-dpif: Store patch port peer in struct ofport_dpif.

This removes ofproto-dpif-xlate's dependency on ofport_get_peer()
which, while cleaner in-and-of itself, will become more important
as ofproto-dpif_xlate modularizes.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Reconfigure tunnel in port_modified().
Ethan Jackson [Mon, 17 Jun 2013 21:09:50 +0000 (14:09 -0700)]
ofproto-dpif: Reconfigure tunnel in port_modified().

This seems like the logical place to do it.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agohmap: Use is_pow2() instead of open-coding it.
Ben Pfaff [Tue, 18 Jun 2013 16:55:02 +0000 (09:55 -0700)]
hmap: Use is_pow2() instead of open-coding it.

Also, SIZE_MAX + 1 is 0, which is not a power of 2, so the following assert
is redundant and this commit removes it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Index flows by cookie.
Jarno Rajahalme [Tue, 18 Jun 2013 16:48:14 +0000 (19:48 +0300)]
ofproto: Index flows by cookie.

The simplest way for an OpenFlow controller to refer to a (set of) flows
is by a controller-issued flow cookie.  Make this fast by inserting flows
to a hash index, and use that when flows are queried, deleted, or modified
with a full cookie mask.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agohindex: New data structure for hashed multimaps.
Ben Pfaff [Tue, 18 Jun 2013 17:27:34 +0000 (10:27 -0700)]
hindex: New data structure for hashed multimaps.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Don't wildcard fields used in special processing.
Justin Pettit [Tue, 18 Jun 2013 01:07:33 +0000 (18:07 -0700)]
ofproto-dpif: Don't wildcard fields used in special processing.

A number of fields are looked at when determining whether special
processing (slow-path) is needed.  This commit removes wildcarding when
they were consulted.

Reported-by: Ethan Jackson <ethan@nicira.com>
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto-dpif: Move process_special() to ofproto-dpif-xlate.c.
Justin Pettit [Tue, 18 Jun 2013 00:56:54 +0000 (17:56 -0700)]
ofproto-dpif: Move process_special() to ofproto-dpif-xlate.c.

The action translation functions are the only ones that need
process_special().  Move that function closer to the callers, since a
future commit will use more xlate-related knowledge in process_special.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoleak-checker: Remove because it cannot be made thread-safe.
Ben Pfaff [Tue, 23 Apr 2013 21:52:41 +0000 (14:52 -0700)]
leak-checker: Remove because it cannot be made thread-safe.

The underlying glibc interface is deprecated because the interface itself
is not thread-safe.  That means that there's no way for a layer on top of
it to be thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agobacktrace: Remove variant that does not support threads.
Ben Pfaff [Tue, 23 Apr 2013 20:41:32 +0000 (13:41 -0700)]
backtrace: Remove variant that does not support threads.

This variant was Linux-specific, GCC-specific, only worked on
architectures with frame pointers (possibly only on i386?), and isn't used
with glibc anyway.  Remove it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif-xlate: Hide MAX_RESUBMIT_RECURSION.
Ethan Jackson [Fri, 14 Jun 2013 01:10:00 +0000 (18:10 -0700)]
ofproto-dpif-xlate: Hide MAX_RESUBMIT_RECURSION.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto: Make handle_openflow's msg argument const.
Jarno Rajahalme [Mon, 17 Jun 2013 00:55:25 +0000 (03:55 +0300)]
ofproto: Make handle_openflow's msg argument const.

handle_openflow() must not modify the received message. Make this
explicit.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-xapi-sync: Retry getting bridge-ids in case xapi is not ready.
Gurucharan Shetty [Fri, 14 Jun 2013 18:23:25 +0000 (11:23 -0700)]
ovs-xapi-sync: Retry getting bridge-ids in case xapi is not ready.

When there are multiple xs-network-uuids set for a bridge,
we query xapi to get the record that does not have a VLAN
associated with it. For cases when xapi does not respond,
retry again after a second.

During the times when xapi does not respond, set the value
as external_ids:bridge_id "".

Bug #17877.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoodp-util: Use proper formatting for ODP port number.
Jarno Rajahalme [Fri, 14 Jun 2013 14:09:34 +0000 (17:09 +0300)]
odp-util: Use proper formatting for ODP port number.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Fix use of uninitialized local variable.
Jarno Rajahalme [Fri, 14 Jun 2013 14:09:33 +0000 (17:09 +0300)]
ofproto: Fix use of uninitialized local variable.

Also make the table id arithmetic less confusing.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotunnel: Don't wildcard TTL and TOS in some circumstances.
Justin Pettit [Thu, 13 Jun 2013 23:46:33 +0000 (16:46 -0700)]
tunnel: Don't wildcard TTL and TOS in some circumstances.

For tunnels, we need to handle the facet's wildcards specially in a
couple of cases:

    - Don't wildcard TTL for facets if "ttl" option is "inherit".
    - Never wildcard the ECN bits, since they are always inherited.
    - Wildcard the rest of the TOS field if the "tos" option is "inherit".

Issue #17911

Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agolib/netdev-linux.c: Prevent receiving of sent packets
Murphy McCauley [Thu, 13 Jun 2013 21:41:21 +0000 (14:41 -0700)]
lib/netdev-linux.c: Prevent receiving of sent packets

Commit 796223f5 (netdev: Add new "struct netdev_rx" for capturing packets
from a netdev) refactored send and receive into separate netdevs.  As a
result, send and receive now use different socket descriptors (except for tap
interfaces which are treated specially).  An unintended side effect was that
all sent packets are looped back and received, which had previously been
avoided as the kernel specifically prevents this from happening on a single
socket descriptor.

To resolve the situation, a socket filter is added to the receive socket
so that it only accepts inbound packets.

Simon Horman co-discovered and initially reported this issue.

Signed-off-by: Murphy McCauley <murphy.mccauley@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Tested-by: Simon Horman <horms@verge.net.au>
Reviewed-by: Simon Horman <horms@verge.net.au>
10 years agoofproto-dpif-xlate: Remove useless variable in patch port logic.
Ethan Jackson [Thu, 13 Jun 2013 19:51:05 +0000 (12:51 -0700)]
ofproto-dpif-xlate: Remove useless variable in patch port logic.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoovsdb-server: Preserve remotes across crash and restart.
Ben Pfaff [Thu, 13 Jun 2013 19:25:39 +0000 (12:25 -0700)]
ovsdb-server: Preserve remotes across crash and restart.

Commit b421d2af0ab (ovsdb-server: Add commands for adding and removing
remotes) made it possible to make ovsdb-server connect to OVS managers only
after ovs-vswitchd has completed its initial configuration.  But this
results in an undesirable effect: whenever ovsdb-server crashes, the
monitor restarts its, but ovsdb-server can no longer connect to the manager
because the remotes were added during runtime and that information is lost
during the crash.

This commit fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: make skb->csum consistent with rest of networking stack.
Pravin B Shelar [Wed, 12 Jun 2013 23:59:28 +0000 (16:59 -0700)]
datapath: make skb->csum consistent with rest of networking stack.

As suggested by Jesse in the comment for patch "gre: Restructure
tunneling", following patch keeps skb->csum correct across ovs.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agoofproto-dpif: Hide struct priority_to_dscp.
Ethan Jackson [Wed, 12 Jun 2013 22:01:11 +0000 (15:01 -0700)]
ofproto-dpif: Hide struct priority_to_dscp.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Hide struct dpif_backer.
Ethan Jackson [Wed, 12 Jun 2013 21:16:01 +0000 (14:16 -0700)]
ofproto-dpif: Hide struct dpif_backer.

This patch removes the last reference to dpif_backer from
ofproto-dpif-xlate, and moves it's definition into ofproto-dpif.c.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Verify backer in ofport_get_peer().
Ethan Jackson [Wed, 12 Jun 2013 21:09:57 +0000 (14:09 -0700)]
ofproto-dpif: Verify backer in ofport_get_peer().

This marginally simplifies the code, and removes a reference to
dpif_backer from ofproto-dpif-xlate.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agomac-learning: Simplify mac_learning_changed().
Ethan Jackson [Wed, 12 Jun 2013 20:58:16 +0000 (13:58 -0700)]
mac-learning: Simplify mac_learning_changed().

With this patch, the mac_learning module takes responsibility for
remembering tags which need revalidation after a
mac_learning_changed() call.  This removes one of
ofproto-dpif-xlate's dpif_backer uses.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofp-print: Avoid returning static data.
Ben Pfaff [Wed, 12 Jun 2013 21:49:19 +0000 (14:49 -0700)]
ofp-print: Avoid returning static data.

Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Make code more readable via 'flow' and 'wc' locals.
Ben Pfaff [Wed, 12 Jun 2013 21:37:18 +0000 (14:37 -0700)]
ofproto-dpif-xlate: Make code more readable via 'flow' and 'wc' locals.

'ctx->xin->flow' and 'ctx->xout->wc' are both pretty long.  Where it gets
in the way of code readability, this patch replaces them by 'xin' and
'xout' using local variables.

Also, replace an explicit comparison against IP and IPv6 Ethertypes by
a call to is_ip_any().

Co-authored-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif-xlate: Harmonize naming of internal functions.
Jarno Rajahalme [Wed, 12 Jun 2013 21:33:17 +0000 (14:33 -0700)]
ofproto-dpif-xlate: Harmonize naming of internal functions.

It would be good to be able to harminize the use of "xlate", "execute",
"compose", etc.  "xlate" clearly relates to the use of the various
translation context structures, but the distinction between "execute" and
"compose" is not that clear, so these names could be going either way.
Choose to go with "compose", keeping with the older tradition.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Check for MPLS depth at the flow.
Jarno Rajahalme [Fri, 31 May 2013 11:35:11 +0000 (14:35 +0300)]
ofproto-dpif: Check for MPLS depth at the flow.

The earlier check on base_flow.mpls_depth seemed wrong, as multiple
MPLS push actions would have resulted in the flow.mpls_depth being
set to 1 each time.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Hide 'struct xlate_ctx'.
Ethan Jackson [Wed, 12 Jun 2013 19:51:52 +0000 (12:51 -0700)]
ofproto-dpif-xlate: Hide 'struct xlate_ctx'.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoextract-ofp-errors: Remove support for hexadecimal error types.
Ben Pfaff [Wed, 13 Feb 2013 00:24:53 +0000 (16:24 -0800)]
extract-ofp-errors: Remove support for hexadecimal error types.

This feature wasn't used and removing it slightly simplifies the code.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Pull xlate_actions() into its own file.
Ethan Jackson [Tue, 11 Jun 2013 20:32:30 +0000 (13:32 -0700)]
ofproto-dpif: Pull xlate_actions() into its own file.

Ideally, this patch would move xlate_actions() into it's own module
with a clearly defined regular interface which is minimally
dependent on ofproto-dpif.  While, I've done this in a prototype,
moving large amounts of code into a new file while simultaneously
changing the logic and keeping up with changes to master has proved
nearly impossible.

This patch takes a different approach.  It simply copies the logic
directly from ofproto-dpif with no changes.  Once this is in,
future patches can begin breaking the ties between
ofproto-dpif-xlate and ofproto-dpif proper.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Print slow path actions in dpif/dump-megaflows.
Justin Pettit [Wed, 12 Jun 2013 05:54:50 +0000 (22:54 -0700)]
ofproto-dpif: Print slow path actions in dpif/dump-megaflows.

It's often helpful to see what the slow path actions actual are.  Print
them when "ovs-appctl dpif/dump-megaflows" is called.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Use proper flow when using facets.
Justin Pettit [Wed, 12 Jun 2013 05:47:12 +0000 (22:47 -0700)]
ofproto-dpif: Use proper flow when using facets.

The handle_flow_miss_with_facet() function used the facet's flow
information instead of the missed flow.  This corrects that.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Never wildcard dl_type for "normal" action.
Justin Pettit [Wed, 12 Jun 2013 00:15:31 +0000 (17:15 -0700)]
ofproto-dpif: Never wildcard dl_type for "normal" action.

The is_gratuitous_arp() function is occasionally called when
processing the "normal" action.  The previous code only disabled
wildcarding the dl_type field when the function was called, but
since it runs occasionally, it could lead to inconsistencies in the
facet table.  This commit causes the dl_type to never be wildcarded
when the "normal" action is used.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Fix format specifier.
Ben Pfaff [Tue, 11 Jun 2013 20:42:12 +0000 (13:42 -0700)]
ofproto-dpif: Fix format specifier.

list_size() returns a size_t, not a uint64_t.

Found by GCC.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto-dpif: Retire 'struct initial_vals'.
Ethan Jackson [Thu, 6 Jun 2013 00:15:35 +0000 (17:15 -0700)]
ofproto-dpif: Retire 'struct initial_vals'.

By detecting that a port is a vlan splinter realdev, we can force
xlate_actions() to emit the appropriate vlan push action.  This
allows as to ditch struct initial_vals.  It will not be missed.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agortnetlink-link: Make 'attrs' local variable non-static.
Ben Pfaff [Tue, 23 Apr 2013 23:04:57 +0000 (16:04 -0700)]
rtnetlink-link: Make 'attrs' local variable non-static.

I don't see any reason for this variable to be static.

CC: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Store relevant fields for wildcarding in facet.
Justin Pettit [Wed, 15 May 2013 01:24:43 +0000 (18:24 -0700)]
ofproto-dpif: Store relevant fields for wildcarding in facet.

Dynamically determines the flow fields that were relevant in
processing flows based on the OpenFlow flow table and switch
configuration.  The immediate use for this functionality is to
cache action translations for similar flows in facets.  This yields
a roughly 80% improvement in flow set up rates for a complicated
flow table.

More importantly, these wildcards will be used to determine what to
wildcard for the forthcoming kernel wildcard (megaflow) patches
that will allow wildcarding in the kernel, which will provide
significant flow set up improvements.

The approach to tracking fields and caching action translations in
facets was based on an impressive prototype by Ethan Jackson.

Co-authored-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agoflow: Add new wildcard functions.
Ethan Jackson [Tue, 11 Jun 2013 05:48:58 +0000 (22:48 -0700)]
flow: Add new wildcard functions.

Rename the function flow_wildcards_combine() to flow_wildcards_and().
Add new flow_wildcards_or() and flow_hash_in_wildcards() functions.
These will be useful in a future patch.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agoclassifier: Add 'wc' argument to classifier_lookup().
Ethan Jackson [Fri, 10 May 2013 02:15:54 +0000 (19:15 -0700)]
classifier: Add 'wc' argument to classifier_lookup().

A future commit will want to know what bits were significant during the
classifier lookup.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Co-authored-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agoflow: Add new flow_wildcards_fold_minimask() function.
Ethan Jackson [Fri, 10 May 2013 02:14:20 +0000 (19:14 -0700)]
flow: Add new flow_wildcards_fold_minimask() function.

This function will be useful in a future commit.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Co-authored-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agometa-flow: Fix comment describing mf_set_flow_value().
Justin Pettit [Sat, 1 Jun 2013 18:44:01 +0000 (11:44 -0700)]
meta-flow: Fix comment describing mf_set_flow_value().

An obvious copy/paste error.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agoodp-execute: Style fixes
Joe Stringer [Tue, 11 Jun 2013 02:05:55 +0000 (11:05 +0900)]
odp-execute: Style fixes

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoprocess: Add thread safety comments.
Ben Pfaff [Wed, 8 May 2013 22:02:45 +0000 (15:02 -0700)]
process: Add thread safety comments.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoprocess: Make signal handling thread-safe.
Ben Pfaff [Thu, 6 Jun 2013 23:26:34 +0000 (16:26 -0700)]
process: Make signal handling thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoprocess: Remove unused features from process_start().
Ben Pfaff [Wed, 8 May 2013 21:31:55 +0000 (14:31 -0700)]
process: Remove unused features from process_start().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoprocess: Remove process_run(), process_run_capture(), and related code.
Ben Pfaff [Wed, 8 May 2013 21:46:30 +0000 (14:46 -0700)]
process: Remove process_run(), process_run_capture(), and related code.

They are unused.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
10 years agoofproto-dpif: Fix incorrect printf format specifiers.
Ben Pfaff [Mon, 10 Jun 2013 18:26:03 +0000 (11:26 -0700)]
ofproto-dpif: Fix incorrect printf format specifiers.

    cc1: warnings being treated as errors
    ../ofproto/ofproto-dpif.c: In function ‘dpif_show_backer’:
    ../ofproto/ofproto-dpif.c:8305: error: format ‘%llu’ expects type ‘long
    long unsigned int’, but argument 4 has type ‘size_t’
    ../ofproto/ofproto-dpif.c:8305: error: format ‘%llu’ expects type ‘long
    long unsigned int’, but argument 5 has type ‘size_t’

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agonetdev-vport: Make netdev_vport_get_dpif_port() code less confusing.
Ben Pfaff [Mon, 15 Apr 2013 22:55:56 +0000 (15:55 -0700)]
netdev-vport: Make netdev_vport_get_dpif_port() code less confusing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Don't return static data in ofputil_packet_in_reason_to_string().
Ben Pfaff [Tue, 16 Apr 2013 22:13:21 +0000 (15:13 -0700)]
ofp-util: Don't return static data in ofputil_packet_in_reason_to_string().

Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Avoid returning static data in ovs_key_attr_to_string().
Ben Pfaff [Mon, 15 Apr 2013 22:40:21 +0000 (15:40 -0700)]
odp-util: Avoid returning static data in ovs_key_attr_to_string().

Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
10 years agoofp-actions: Add comments to struct ofpact_learn_spec.
Ben Pfaff [Mon, 10 Jun 2013 17:38:39 +0000 (10:38 -0700)]
ofp-actions: Add comments to struct ofpact_learn_spec.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
10 years agoovsdb-idlc: Write a new-line at the end of "annotate" output.
Ben Pfaff [Mon, 10 Jun 2013 17:25:29 +0000 (10:25 -0700)]
ovsdb-idlc: Write a new-line at the end of "annotate" output.

Some tools do not like text files that lack a trailing new-line.  In
particular, Debian's dpkg-source utility complains about a missing new-line
in the file generated by ovsdb-idlc:

    dpkg-source: warning: file
    openvswitch-1.9.2+git20130605/lib/vswitch-idl.ovsidl has no final
    newline (either original or modified version)

This commit fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif-governor: Dispense with governor name.
Ethan Jackson [Fri, 7 Jun 2013 20:51:31 +0000 (13:51 -0700)]
ofproto-dpif-governor: Dispense with governor name.

In almost all cases, ovs-vswitchd runs with a single datapath, and
therefore a single governor.  Therefore, it's usually clear from
context what governor log messages are referring to making the name
redundant.  This patch removes it.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Maintain subfacets in dpif_backer.
Ethan Jackson [Wed, 1 May 2013 01:32:02 +0000 (18:32 -0700)]
ofproto-dpif: Maintain subfacets in dpif_backer.

Conceptually, a subfacet represents a datapath flow key, and
therefore belongs more to a datapath more than it does to a bridge.
This patch moves the subfacet hmap from 'struct ofproto_dpif' to
'struct dpif_backer', simplifying the code in the process.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Set flow-eviction-threshold globally.
Ethan Jackson [Tue, 4 Jun 2013 20:22:46 +0000 (13:22 -0700)]
ofproto-dpif: Set flow-eviction-threshold globally.

With the single datapath, it no longer makes sense to have a per
ofproto flow eviction threshold.  This patch moves the flow
eviction threshold to the Open_vSwitch table making the setting
global, though still treated separately for each ofproto.  A future
patch will unify flow eviction on a per datapath basis.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto: Track subfacet stats in the backer.
Ethan Jackson [Tue, 4 Jun 2013 22:48:31 +0000 (15:48 -0700)]
ofproto: Track subfacet stats in the backer.

Subfacets being per-datapath entities, their statistics are really
only interesting at per-datapath granularity.  This patch moves
them to the dpif_backer and makes some related simplifications.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: More responsive average subfacet statistics.
Ethan Jackson [Thu, 30 May 2013 20:22:26 +0000 (13:22 -0700)]
ofproto-dpif: More responsive average subfacet statistics.

Before this patch, statistics about subfacet average life span,
and count in the datapath, were calculated over the entire lifetime
of the ofproto.  Furthermore, the subfacet lifespan was only
updated when a subfacet was removed from the datapath causing long
lived subfacets to be ignored.  It's far more useful to know these
numbers averaged over all subfacets in the recent past.  This patch
changes the code to implement an exponentially weighted moving
average updated every time statistics are pulled from the datapath.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agotimeval: Remove time_disable_restart(), time_enable_restart() functions.
Ben Pfaff [Fri, 12 Apr 2013 16:42:44 +0000 (09:42 -0700)]
timeval: Remove time_disable_restart(), time_enable_restart() functions.

These functions will not have the same useful effect when Open vSwitch
becomes multithreaded, because time_disable_restart() will disable time
advancing for every thread, not just for the thread that calls it.

These functions are no longer used, so this commit removes them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-vport: Don't return static data in netdev_vport_get_dpif_port().
Ben Pfaff [Wed, 1 May 2013 18:05:28 +0000 (11:05 -0700)]
netdev-vport: Don't return static data in netdev_vport_get_dpif_port().

Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-netdev: Don't run port names through netdev_vport_get_dpif_port().
Ben Pfaff [Thu, 6 Jun 2013 22:27:15 +0000 (15:27 -0700)]
dpif-netdev: Don't run port names through netdev_vport_get_dpif_port().

The ports that exist within a dpif have already been translated through
netdev_vport_get_dpif_port(), so there is no value to translating them
again in the interfaces that query or dump ports (and possibly a drawback
if somehow the translation could change).

After this change, dpif-netdev translates port names in just one place,
the port_add path, which makes dpif-netdev act the same way as dpif-linux
in this respect.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Actually log errors in facet_check_consistency()
Simon Horman [Wed, 5 Jun 2013 13:28:47 +0000 (13:28 +0000)]
ofproto-dpif: Actually log errors in facet_check_consistency()

facet_check_consistency() goes to some effort to create informative
error messages, protected by a rate limit, but does not actually
log these messages.

This appears to be an unintended side effect of
4dff90977694784e67e9c08cc72dee28ebc343ae ("ofproto-dpif: Move
odp_actions from subfacet to facet.").  This patch restores the
logging behaviour present prior to the above commit.

This patch also reverses a changes made by the same commit to use
ds_put_cstr() instead of ds_put_char() in facet_check_consistency().

Cc: Justin Pettit <jpettit@nicira.com>
Cc: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoroute-table: Make 'rtnl_sock' and 'attrs' local variables non-static.
Ben Pfaff [Tue, 23 Apr 2013 23:03:36 +0000 (16:03 -0700)]
route-table: Make 'rtnl_sock' and 'attrs' local variables non-static.

I don't see any reason for these to be static.

CC: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agonetdev-vport: Make 'iface' non-static in tunnel_get_status().
Ben Pfaff [Mon, 15 Apr 2013 22:33:43 +0000 (15:33 -0700)]
netdev-vport: Make 'iface' non-static in tunnel_get_status().

I don't see any reason for this to be static.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agotimeval: Do not block SIGALRM around setting 'deadline' in time_alarm().
Ben Pfaff [Thu, 9 May 2013 18:26:24 +0000 (11:26 -0700)]
timeval: Do not block SIGALRM around setting 'deadline' in time_alarm().

There is no need to do so because the signal handler does not read or
write 'deadline'.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agolockfile: Remove calls to time_disable_restart()/time_enable_restart().
Ben Pfaff [Fri, 12 Apr 2013 16:39:50 +0000 (09:39 -0700)]
lockfile: Remove calls to time_disable_restart()/time_enable_restart().

These calls are not necessary because F_SETLK does not block.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agosignals: Make thread-safe.
Ben Pfaff [Wed, 8 May 2013 22:30:05 +0000 (15:30 -0700)]
signals: Make thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoAlways update ethertype on mpls_pop
Simon Horman [Wed, 5 Jun 2013 05:28:52 +0000 (14:28 +0900)]
Always update ethertype on mpls_pop

The ethertype should always be updated on mpls_pop
as there may be a transition between MPLS unicast (0x8847) and
MPLS multicast (0x8848).

Ben Pfaff tells me that this is consistent with the
behaviour described in EXT-194 of the JIRA bug tracker.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>