cascardo/ovs.git
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: 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>
Acked-by: Ethan Jackson <ethan@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 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 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: 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: 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 agoofproto-dpif: Consolidate facet stat logic.
Ethan Jackson [Wed, 29 May 2013 19:38:48 +0000 (12:38 -0700)]
ofproto-dpif: Consolidate facet stat logic.

The logic for updating statistics at the facet level had been
spread through ofproto-dpif in a rather confusing manner.  This
patch consolidates as much of this logic as is reasonable into
facet_push_stats().

On a side note, I'd expect this patch to have a marginal positive
performance impact when using learning (though I haven't bothered
to measure it).  It combines facet_learn() and facet_push_stats()
into one step allowing us to avoid a redundant xlate_actions().

Signed-off-by: Ethan Jackson <ethan@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 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: Do not give stats to rules bypassed by "drop" frag policy.
Ben Pfaff [Wed, 5 Jun 2013 17:11:55 +0000 (10:11 -0700)]
ofproto-dpif: Do not give stats to rules bypassed by "drop" frag policy.

When the OFPC_FRAG_DROP policy is in effect, IP fragments are supposed to
be dropped before they reach the flow table.  Open vSwitch properly dropped
IP fragments in this case, but still accounted them to the packet and byte
counters for the flow that they would have hit if the OFPC_FRAG_NX_MATCh
policy had been in effect.

Reported-by: love you <thunder.love07@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Don't count misses in OpenFlow table stats.
Jesse Gross [Sat, 25 May 2013 00:01:34 +0000 (17:01 -0700)]
ofproto-dpif: Don't count misses in OpenFlow table stats.

Originally no rule existed for packets that did not match an
OpenFlow flow and therefore every packet with a rule could be
counted as a hit. However, newer versions of OVS have hidden
miss rules so this is no longer true. To return the correct
table stats, this subtracts packets that hit the miss rule
from the total and removes the separate counter.

Reported-by: love you <thunder.love07@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agopackets: Fix typo in reserved multicast Ethernet addresses.
Ben Pfaff [Tue, 28 May 2013 23:05:34 +0000 (16:05 -0700)]
packets: Fix typo in reserved multicast Ethernet addresses.

The reserved multicast Ethernet addresses begin with 01:80:c2, not
01:08:c2.

Reported-by: Padmanabhan Krishnan <kprad1@yahoo.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoAlways use valid ids pointer in dec_ttl_cnt_ids_from_openflow()
Simon Horman [Mon, 3 Jun 2013 05:46:30 +0000 (14:46 +0900)]
Always use valid ids pointer in dec_ttl_cnt_ids_from_openflow()

Always update the ids pointer after calling ofpbuf_put()
to ensure that it is valid when accessed.

During testing a case came up where the call to ofpbuf_put() in the
for (i = 0; i < ids->n_controllers; i++) loop would cause the underlying
buffer to be reallocated. This resulted in ids->n_controllers being an
incorrect value, the loop continuing on longer than desired and finally a
segmentation fault.

Reported-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agocfm: Update netdev when changed.
Ethan Jackson [Mon, 3 Jun 2013 20:49:13 +0000 (13:49 -0700)]
cfm: Update netdev when changed.

If ofproto decided to change the netdev of a particular ofport,
cfm_demand mode would improperly continue using the old netdev to
collect stats.

Bug #17583.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoINSTALL: Add documentaion for hot upgrades.
Gurucharan Shetty [Thu, 30 May 2013 09:07:15 +0000 (09:07 +0000)]
INSTALL: Add documentaion for hot upgrades.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoovs-ctl.in: Restore flows with vswitchd packet processing disabled.
Gurucharan Shetty [Tue, 28 May 2013 13:21:56 +0000 (13:21 +0000)]
ovs-ctl.in: Restore flows with vswitchd packet processing disabled.

It has been observed that when we upgrade openvswitch with
thousands of openflow flows already established and there is heavy
traffic going through the switch, restoring flows can take a very
long time (8 minutes in one use case) with CPU running at 100%.
This can make the upgrade very expensive.

This commit starts vswitchd by asking it to wait till flow restore is
finished. Once the flows are restored, it resumes normal operations.

Bug #16086.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoovs-ctl.in: Add manager after restoring flows.
Gurucharan Shetty [Tue, 28 May 2013 12:53:17 +0000 (12:53 +0000)]
ovs-ctl.in: Add manager after restoring flows.

Currently we are adding the manager after starting ovs-vswitchd.
Instead, add the manager after flow restore is completed.

Bug #16086.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoovs-vswitchd: An option to wait for userspace flow restore to complete.
Gurucharan Shetty [Tue, 28 May 2013 12:52:36 +0000 (12:52 +0000)]
ovs-vswitchd: An option to wait for userspace flow restore to complete.

While upgrading openvswitch, it helps to restore openflow flows before
starting packet processing.  Typically we want to restart openvswitch,
add the openflow flows and then start packet processing.

To do this, we look for the other_config:flow-restore-wait column
in the Open_vSwitch table during startup. If set as true, we disable
receiving packets from the datapath, expiring or flushing flows and
running any periodic ofproto activities. This option does not prevent
the addition and deletion of ports. Once this option is set to false,
we return to normal processing.

An upcoming commit will use this feature in Open vSwitch startup scripts.

Bug #16086.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoofproto-dpif.c: Modify vsp_realdev_to_vlandev() function
Alex Wang [Fri, 31 May 2013 01:24:44 +0000 (18:24 -0700)]
ofproto-dpif.c: Modify vsp_realdev_to_vlandev() function

Commit 52a90c29 (Implement new "VLAN splinters" feature) passed in OpenFlow
port number to vsp_realdev_to_vlandev() function which asks for datapath port
number.

This patch fixes this bug by making the vsp_realdev_to_vlandev() function
take in and return OpenFlow port number.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Revamp xlate_actions() interface.
Ethan Jackson [Mon, 13 May 2013 18:18:21 +0000 (11:18 -0700)]
ofproto-dpif: Revamp xlate_actions() interface.

This patch implements a new interface to xlate_actions which, aside
from being simpler and more intuitive, achieves several goals.  It
pulls all of xlate_actions() results into a single structure which
will be easier to cache and pass around in future.  And it shields
xlate_ctx from the rest of the code, making it possible to factor
xlate_actions() in the future (hopefully).

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Rename action_xlate_ctx.
Ethan Jackson [Mon, 13 May 2013 22:31:31 +0000 (15:31 -0700)]
ofproto-dpif: Rename action_xlate_ctx.

This patch changes the name of action_xlate_ctx to xlate_ctx. Aside
from being a bit snappier, it fits more cleanly with structures
added in future patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Move odp_actions from subfacet to facet.
Ethan Jackson [Sat, 16 Mar 2013 01:03:59 +0000 (18:03 -0700)]
ofproto-dpif: Move odp_actions from subfacet to facet.

Upon close inspection, it appears that it's not possible for
actions to differ between subfacets belonging to a given facet.
Given this fact, it makes sense to move datapath actions from
subfacets to their parent facets.  It's both conceptually more
straightforward, and necessary for future threading and megaflow
work.

Co-authored-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoodp-util: Make slow_path_reasons mutually exclusive.
Ethan Jackson [Tue, 28 May 2013 18:43:43 +0000 (11:43 -0700)]
odp-util: Make slow_path_reasons mutually exclusive.

It's no longer possible for a single datapath flow to be slow
pathed for two different reasons.  This patch updates the code to
reflect this fact (marginally simplifying it).

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto: Ditch SLOW_IN_BAND slow path reason.
Ethan Jackson [Thu, 23 May 2013 23:01:20 +0000 (16:01 -0700)]
ofproto: Ditch SLOW_IN_BAND slow path reason.

Before this patch, when in band control was enabled, every DHCP
packet had to be sent to userspace to calculate it's actions.
Those DHCP packets intended for the local port would have a special
action added to ensure they actually make it there.  This
unnecessarily complicates the code, so this patch takes a slightly
different approach.  When in-band is enabled, *all* DHCP packets
must be sent to the local port.  This guarantees that
xlate_actions() returns the same result every time for a given
flow.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Ditch SLOW_MATCH slow path reason.
Ethan Jackson [Fri, 17 May 2013 20:39:03 +0000 (13:39 -0700)]
ofproto-dpif: Ditch SLOW_MATCH slow path reason.

Before this patch, datapath keys with ODP_FIT_TO_LITTLE, would be
assigned subfacets and installed in the kernel with a SLOW_MATCH
slow path reason.  This is problematic, because these flow keys
can't be reliable converted into a 'struct flow' thus breaking a
fundamental assumption of ofproto-dpif.  This patch circumvents the
issue by skipping facet creation for these flows altogether.  This
approach has the added benefit of simplifying the code for future
patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofpbuf: New helper ofpbuf_equal().
Ethan Jackson [Tue, 19 Mar 2013 21:46:12 +0000 (14:46 -0700)]
ofpbuf: New helper ofpbuf_equal().

Used in future commits.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Avoid redundant facet_find() in facet_lookup_valid().
Ethan Jackson [Tue, 28 May 2013 20:29:50 +0000 (13:29 -0700)]
ofproto-dpif: Avoid redundant facet_find() in facet_lookup_valid().

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: handle_flow_miss_common() without facets.
Ethan Jackson [Wed, 29 May 2013 17:20:23 +0000 (10:20 -0700)]
ofproto-dpif: handle_flow_miss_common() without facets.

handle_flow_miss_common() is intended to be called whether or not a
miss needs a facet.  Found by inspection.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agodebian: Don't fail ovs-controller restart if daemon not running.
Gurucharan Shetty [Wed, 29 May 2013 00:18:12 +0000 (17:18 -0700)]
debian: Don't fail ovs-controller restart if daemon not running.

Reported-by: Maxime Brun <m.brun@alphalink.fr>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoovs-xapi-sync: Handle exceptions from XAPI for get_single_bridge_id.
Gurucharan Shetty [Thu, 23 May 2013 23:14:19 +0000 (16:14 -0700)]
ovs-xapi-sync: Handle exceptions from XAPI for get_single_bridge_id.

There are possibilities when records disappear underneath ovs-xapi-sync.
In this particular case, when VLAN network was deleted, the corresponding
record in bridge's external_ids:xs_network_ids column was not deleted by
xenserver.  In situations like that handle the exceptions cleanly.

Bug #17390.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agocfm: Implement "demand mode".
Ethan Jackson [Wed, 15 May 2013 21:31:06 +0000 (14:31 -0700)]
cfm: Implement "demand mode".

The new CFM "demand mode" (named after BFD's demand mode) uses
data traffic to indicate interface liveness.  It's helpful on
heavily congested networks where CCMs may be dropped.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agodon't forget to define HAVE_BACKTRACE
YAMAMOTO Takashi [Tue, 21 May 2013 08:49:53 +0000 (17:49 +0900)]
don't forget to define HAVE_BACKTRACE

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-xapi-sync: Handle multiple xs-network-uuids for xs 6.1.
Gurucharan Shetty [Sun, 19 May 2013 07:05:09 +0000 (00:05 -0700)]
ovs-xapi-sync: Handle multiple xs-network-uuids for xs 6.1.

For xenservers with version less than 6.1, interface reconfiguration
happened through interface-reconfigure scripts in this repo. In cases
where there were multiple xs-network-uuids for a single bridge,
interface-reconfigure script would add the network uuid associated
with the non-VLAN network as the first record. ovs-xapi-sync would
just blindly use the first record to create the bridge-id

But it looks like for xenserver 6.1, interface-reconfigure script
is no longer used and xenserver natively writes the xs-network-uuids.
So, in ovs-xapi-sync we no longer can copy the first value in
xs-network-uuids as bridge-id. This commit fetches the PIF record
for each xs-network-uuids and the network that does not have a VLAN
associated with it is copied over to bridge-id.

Bug #17090.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agodatapath: Fix compilation with Linux kernel 3.7.
Pravin B Shelar [Mon, 13 May 2013 22:53:06 +0000 (15:53 -0700)]
datapath: Fix compilation with Linux kernel 3.7.

Definition of __sum16 and __wsum is moved to uapi header.
Following patch adds check in config script for second possible
header.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto-dpif: Make fin_timeout work when governor kicks in.
Ben Pfaff [Sun, 12 May 2013 21:53:51 +0000 (14:53 -0700)]
ofproto-dpif: Make fin_timeout work when governor kicks in.

The xlate_actions() call in handle_flow_miss_without_facet() didn't
implement fin_timeout properly because tcp_flags wasn't getting set.

I have not tested that this fixes the problem, but it seems "obviously
correct".

Bug #16506.
Reported-by: Ying Chen <yingchen@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@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 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 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 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 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 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 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 agoRevert "Prepare for post-1.11.0 (1.11.90)."
Justin Pettit [Wed, 1 May 2013 21:40:51 +0000 (14:40 -0700)]
Revert "Prepare for post-1.11.0 (1.11.90)."

This reverts commit 9f31efc731090e8d33236c55a4adbf461f3acbd1.

This is the 1.11.0 release, so this patch doesn't belong.

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 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 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 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>
11 years agoFAQ: Explain how to drop packets.
Ben Pfaff [Tue, 23 Apr 2013 04:15:25 +0000 (21:15 -0700)]
FAQ: Explain how to drop packets.

This question keeps coming up.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotutorial: Correct typos.
Ben Pfaff [Tue, 23 Apr 2013 04:17:50 +0000 (21:17 -0700)]
tutorial: Correct typos.

Reported-by: Yeming Zhao <zhaoyeming@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoImplement IPFIX export
Romain Lenglet [Mon, 22 Apr 2013 17:01:14 +0000 (10:01 -0700)]
Implement IPFIX export

Define a new NXAST_SAMPLE OpenFlow vendor action and the corresponding
OFPACT_SAMPLE OVS action, to do per-flow packet sampling, translated
into a new SAMPLE "flow_sample" dp action.

Make the userspace action's userdata size vary depending on the union
member used.  Add a new "flow_sample" upcall to do per-flow packet
sampling.  Add a new "ipfix" upcall to do per-bridge packet sampling
to IPFIX collectors.

Extend the OVSDB schema to support configuring IPFIX collector sets.
Add support for configuring multiple IPFIX collectors for per-flow
packet sampling.  Add support for configuring per-bridge IPFIX
sampling.

Automatically generate standard IPFIX entity definitions from the IANA
specs.  Send one IPFIX data record message for every packet sampled by
an OpenFlow sample action or received by a bridge configured with
IPFIX sampling, and periodically send IPFIX template set messages.

Signed-off-by: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoRestore all flow changes by compose_output_action__().
Jarno Rajahalme [Thu, 18 Apr 2013 15:07:41 +0000 (18:07 +0300)]
Restore all flow changes by compose_output_action__().

This makes sure that output actions leave no changes to any flow fields,
while all explicit set_field actions are retained across output actions.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Restore flow nw_tos in all cases.
Jarno Rajahalme [Thu, 18 Apr 2013 15:07:40 +0000 (18:07 +0300)]
ofproto-dpif: Restore flow nw_tos in all cases.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoodp-util: Keep base flow in sync with the kernel view.
Jarno Rajahalme [Thu, 18 Apr 2013 15:07:39 +0000 (18:07 +0300)]
odp-util: Keep base flow in sync with the kernel view.

Change the base flow only if a corresponding kernel action is generated
in commit_odp_tunnel_action().

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agouse RT_ROUNDUP on NetBSD
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:12 +0000 (22:20 +0900)]
use RT_ROUNDUP on NetBSD

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoinclude some headers to satisfy header file dependencies on NetBSD-6
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:11 +0000 (22:20 +0900)]
include some headers to satisfy header file dependencies on NetBSD-6

while this change don't seem to be necessary on NetBSD-current,
NetBSD-6 is the latest release at this point.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agosome ctype related casts to suppress gcc warnings on NetBSD
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:10 +0000 (22:20 +0900)]
some ctype related casts to suppress gcc warnings on NetBSD

where it can't be EOF, cast a value to unsigned char before passing it
to ctype functions to avoid unintended sign extension.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agobe compilable even when _SC_PHYS_PAGES is not available
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:09 +0000 (22:20 +0900)]
be compilable even when _SC_PHYS_PAGES is not available

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agochange the type of popcount unsigned
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:08 +0000 (22:20 +0900)]
change the type of popcount unsigned

it's a natural choice and compatible with a version found in NetBSD libc.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoinvoke perl as ${PERL}
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:07 +0000 (22:20 +0900)]
invoke perl as ${PERL}

as suggested by Ben Pfaff.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoexplicitly invoke perl for uuidfilt.pl (rather than via shebang)
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:06 +0000 (22:20 +0900)]
explicitly invoke perl for uuidfilt.pl (rather than via shebang)

depending on a platform, perl might not be /usr/bin/perl.
eg. on NetBSD it's usually /usr/pkg/bin/perl.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-pki: Add NetBSD case for test
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:05 +0000 (22:20 +0900)]
ovs-pki: Add NetBSD case for test

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoinclude strings.h for strcasecmp
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:04 +0000 (22:20 +0900)]
include strings.h for strcasecmp

while this is not the only place strcasecmp is used without an
explicit inclusion of the header, it's the only place gcc complains
on my environment.  for other places, probably the header is included
indirectly via other headers, i guess.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoremove remaining pkg-config references
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:03 +0000 (22:20 +0900)]
remove remaining pkg-config references

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agouse ax_check_openssl.m4 instead of a direct use of pkg-config.
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:02 +0000 (22:20 +0900)]
use ax_check_openssl.m4 instead of a direct use of pkg-config.

on some platforms, including NetBSD-6, openssl is available but
its pkg-config files (*.pc) are not.  according to Ed Maste,
this is the case for FreeBSD as well.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoadd ax_check_openssl.m4
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:20:01 +0000 (22:20 +0900)]
add ax_check_openssl.m4

this file is obtained from:
http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_openssl.m4;hb=5a7260331c7d13263126e35c5743fdc35cbc2894

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agofix an obvious mistake in a test of IFM_ETHER
YAMAMOTO Takashi [Mon, 22 Apr 2013 13:19:59 +0000 (22:19 +0900)]
fix an obvious mistake in a test of IFM_ETHER

fix a bug in FreeBSD code.  the fix is suggested by Ed Maste.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAdd a tutorial for advanced Open vSwitch features.
Ben Pfaff [Fri, 19 Apr 2013 23:25:56 +0000 (16:25 -0700)]
Add a tutorial for advanced Open vSwitch features.

Signed-off-by: Ben Pfaff <blp@nicira.com>