sliver-openvswitch.git
10 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Mon, 14 Oct 2013 10:11:59 +0000 (12:11 +0200)]
Merge branch 'mainstream'

10 years agoofproto-dpif-xlate: Simplify the xlate_send_packet() function.
Alex Wang [Fri, 11 Oct 2013 21:58:36 +0000 (14:58 -0700)]
ofproto-dpif-xlate: Simplify the xlate_send_packet() function.

This commit simplifies the xlate_send_packet() function by calling
ofproto_dpif_execute_actions() function.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Make execute_actions() function non-static.
Alex Wang [Fri, 11 Oct 2013 21:58:35 +0000 (14:58 -0700)]
ofproto-dpif: Make execute_actions() function non-static.

This commit changes the execute_actions() function to non-static
function.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Change comment for execute_actions() function.
Alex Wang [Fri, 11 Oct 2013 21:58:34 +0000 (14:58 -0700)]
ofproto-dpif: Change comment for execute_actions() function.

This commit changes the comment for execute_actions() function,
since the old comment does not apply.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Fix freeing uninitialized "struct ofpbuf".
Alex Wang [Fri, 11 Oct 2013 21:17:13 +0000 (14:17 -0700)]
ofproto-dpif-xlate: Fix freeing uninitialized "struct ofpbuf".

Commit 91d6cd12 (ofproto-dpif: Move send_packet() to
ofproto-dpif-xlate module.) introduced a bug that frees the "struct
ofpbuf" in 'xout' when the struct is not initialized.  This commit
fixes the bug.

Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agorconn: Make thread-safe.
Ben Pfaff [Fri, 11 Oct 2013 17:08:32 +0000 (10:08 -0700)]
rconn: Make thread-safe.

This should make sending OFPT_FLOW_REMOVED and NXST_FLOW_MONITOR safe from
miss handler threads.

Bug #20271.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoconnmgr: Formalize 'ofproto_mutex' as protecting ofconn monitor data.
Ben Pfaff [Fri, 11 Oct 2013 06:11:09 +0000 (23:11 -0700)]
connmgr: Formalize 'ofproto_mutex' as protecting ofconn monitor data.

'ofproto_mutex' has effectively protected the monitor-related members of
struct ofconn since its introduction, but this was not written down or
systematically annotated.  This commit makes it more systematic and fixes
a few issues found using the annotations.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoconnmgr: Use 'ofproto_mutex' to protect ofconns from being destroyed.
Ben Pfaff [Fri, 11 Oct 2013 17:04:32 +0000 (10:04 -0700)]
connmgr: Use 'ofproto_mutex' to protect ofconns from being destroyed.

Code in the ofproto-dpif miss handler threads can currently access
ofconns, sending flow_removed and flow monitor messages due to NXAST_LEARN
actions.  Nothing currently protects those threads from accessing ofconns
that are in the process of being destroyed.  This commit adds protection
'ofproto_mutex', which NXAST_LEARN already takes.

Later patches will address other races that remain.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agorconn: Make rconn_packet_counter thread-safe.
Ben Pfaff [Fri, 13 Sep 2013 22:07:35 +0000 (15:07 -0700)]
rconn: Make rconn_packet_counter thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agomonitor: Fix improper use of stubs.
Ethan Jackson [Fri, 11 Oct 2013 00:52:31 +0000 (17:52 -0700)]
monitor: Fix improper use of stubs.

Stubs must be uninitialized when used in case they allocate memory.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoAdd software switch support for modifying ARP headers in OpenFlow.
Ben Pfaff [Thu, 10 Oct 2013 00:37:30 +0000 (17:37 -0700)]
Add software switch support for modifying ARP headers in OpenFlow.

This support is added through the userspace slow path, because we don't
judge that this is important enough to require permanent support in the
Linux kernel ABI.

Bug #19259.
CC: Teemu Koponen <koponen@nicira.com>
CC: Pankaj Thakkar <thakkar@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif: Support working around actions that a datapath does not support.
Ben Pfaff [Thu, 10 Oct 2013 00:28:05 +0000 (17:28 -0700)]
dpif: Support working around actions that a datapath does not support.

Until now, OVS has expected that the datapath supports all the actions
required by any flow to be installed.  There are at least two reasons why
a datapath might not support a given action:

    - The datapath version is older than the userspace version, and the
      action was introduced after the version of the datapath in use.

    - The action is not considered important enough to implement as part of
      an ABI that must be maintained forever.

This commit adds infrastructure to handle these cases.  It doesn't actually
add any uses; that will come in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Make it possible to combine slow path reasons.
Ben Pfaff [Fri, 20 Sep 2013 19:54:51 +0000 (12:54 -0700)]
odp-util: Make it possible to combine slow path reasons.

It will soon be possible for a single flow to be slow pathed for multiple
reasons.  This commit makes it possible to indicate more than one reason
to slow path a flow.

This commit is logically a revert of commit 98f0520fb2 (odp-util: Make
slow_path_reasons mutually exclusive.) but details have changed.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-execute: Refine signatures for odp_execute_actions() callbacks.
Ben Pfaff [Fri, 20 Sep 2013 19:47:33 +0000 (12:47 -0700)]
odp-execute: Refine signatures for odp_execute_actions() callbacks.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Factor lots of code out into new function execute_actions().
Ben Pfaff [Fri, 20 Sep 2013 20:40:13 +0000 (13:40 -0700)]
ofproto-dpif: Factor lots of code out into new function execute_actions().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Simplify code using execute_odp_actions().
Ben Pfaff [Tue, 8 Oct 2013 22:57:49 +0000 (15:57 -0700)]
ofproto-dpif: Simplify code using execute_odp_actions().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Add undocumented "parse-pcap" command, for testing.
Ben Pfaff [Mon, 23 Sep 2013 17:28:14 +0000 (10:28 -0700)]
ovs-ofctl: Add undocumented "parse-pcap" command, for testing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-dummy: Add pcap feature.
Ben Pfaff [Mon, 23 Sep 2013 17:26:51 +0000 (10:26 -0700)]
netdev-dummy: Add pcap feature.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agopcap-file: Add support for append mode to pcap_open().
Ben Pfaff [Mon, 23 Sep 2013 17:27:10 +0000 (10:27 -0700)]
pcap-file: Add support for append mode to pcap_open().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agopcap-file: Improve error logging.
Ben Pfaff [Mon, 23 Sep 2013 17:14:35 +0000 (10:14 -0700)]
pcap-file: Improve error logging.

There is no reason to log end of file as an error, but that's what this
code was doing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-upcall: Make miss handlers accumulate coverage counters.
Ben Pfaff [Mon, 23 Sep 2013 17:24:05 +0000 (10:24 -0700)]
ofproto-dpif-upcall: Make miss handlers accumulate coverage counters.

The miss handler threads do not call poll_block(), which calls
coverage_clear() indirectly.  This meant that coverage counters incremented
by miss handler threads never got integrated into the global coverage
counters and therefore did not show up in coverage logging or
"ovs-appctl coverage/show" output.  This commit fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotimeval: Call coverage_clear() before coverage_log() in time_poll().
Ben Pfaff [Mon, 23 Sep 2013 17:13:54 +0000 (10:13 -0700)]
timeval: Call coverage_clear() before coverage_log() in time_poll().

time_poll() calls log_poll_interval(), which in some circumstances calls
coverage_log().  Before this commit, time_poll() also called
coverage_clear() after log_poll_interval().  This made sense before commit
857165b5fd26 (coverage: Make thread-safe.), because coverage_log() would
log the most recent main loop's coverage counters separately and calling
coverage_clear() beforehand would zero out those counters.  However, it
doesn't make sense any longer because the most recent loop's counters are
no longer separately logged and in fact this practice now means that the
most recent loop's counters are omitted from the logged counters.

Therefore, this commit moves the call to coverage_clear() earlier, so that
the most recent loop's counters are included.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Do initial rule lookup for callers.
Ethan Jackson [Wed, 9 Oct 2013 20:23:31 +0000 (13:23 -0700)]
ofproto-dpif-xlate: Do initial rule lookup for callers.

None of the functions available in ofproto-dpif.h are thread safe
unless holding the xlate_rwlock because one can't know that an ofproto
or ofport used as argument will survive during the function call.  For
this reason, ofproto-dpif-upcall's invocation of rule_dpif_lookup()
is unsafe because the ofproto could be destroyed during the call.

This patch fixes the problem by optionally doing the initial rule
lookup in xlate_actions() so that it can be done while holding the
xlate_rwlock.  This has the nice side benefit of removing a bunch of
boilerplate.

Note that this only partially solves the problem, there's still
vsp_realdev_to_vlandev() and ofproto_dpif_send_packet_in() which
aren't thread safe for the same reason.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agotests: a comment on OF1.3 table_mod
YAMAMOTO Takashi [Wed, 9 Oct 2013 07:50:29 +0000 (16:50 +0900)]
tests: a comment on OF1.3 table_mod

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agometa-flow: Fix inverted IPv6 flow label masking.
Jarno Rajahalme [Wed, 9 Oct 2013 20:50:51 +0000 (13:50 -0700)]
meta-flow: Fix inverted IPv6 flow label masking.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agomoved base version to 2.0.90
Giuseppe Lettieri [Wed, 9 Oct 2013 13:27:00 +0000 (15:27 +0200)]
moved base version to 2.0.90

10 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Wed, 9 Oct 2013 13:25:33 +0000 (15:25 +0200)]
Merge branch 'mainstream'

10 years agoofproto-dpif-monitor: Add ofproto-dpif-monitor module.
Alex Wang [Wed, 9 Oct 2013 04:30:37 +0000 (04:30 +0000)]
ofproto-dpif-monitor: Add ofproto-dpif-monitor module.

This commit adds a new module ofproto-dpif-monitor in ofproto
directory.  This module is in charge of executing the periodic
functions of monitoring code (e.g. bfd and cfm).

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agotimeval: Wake up all threads when time is warped.
Alex Wang [Wed, 9 Oct 2013 04:30:36 +0000 (04:30 +0000)]
timeval: Wake up all threads when time is warped.

This commit makes the main thread wake up all other threads when time is
warped.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agotests: Remove the unit test for "ovs-appctl coverage/show".
Alex Wang [Wed, 9 Oct 2013 04:30:35 +0000 (04:30 +0000)]
tests: Remove the unit test for "ovs-appctl coverage/show".

Changes will be made to allow "ovs-appctl time/warp" wake up all
threads.  With that, all threads will try calling "coverage_run()".
And it will be impossible to deterministically check the output of
the "ovs-appctl coverage/show" command.  Thus, this commit removes
the unit test for the coverage/show command.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Make stats update thread safe.
Alex Wang [Wed, 9 Oct 2013 04:30:34 +0000 (04:30 +0000)]
ofproto-dpif: Make stats update thread safe.

This commit makes the update of 'stats' member in ofproto_dpif
struct thread safe.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Move send_packet() to ofproto-dpif-xlate module.
Alex Wang [Wed, 9 Oct 2013 04:30:33 +0000 (04:30 +0000)]
ofproto-dpif: Move send_packet() to ofproto-dpif-xlate module.

This commit moves the main logic of send_packet() function into
the ofproto-dpif-xlate module.  Also, modification is made to
guarantee the thread safety of ofproto-dpif-xlate module.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoovs-lib: Return the correct exit status of the command 'status'
Gurucharan Shetty [Mon, 7 Oct 2013 21:28:48 +0000 (14:28 -0700)]
ovs-lib: Return the correct exit status of the command 'status'

commit 46528f78e5c(debian, rhel, xenserver: Ability to collect ovs-ctl logs)
made changes in the startup scripts such that the o/p of ovs-ctl is logged
into ovs-ctl.log. But it had an unintended consequence that the exit status
of ovs-ctl was no longer returned. We would always return success(the exit
status of tee).

With this commit, we return the exit status of ovs-ctl instead of tee.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agovswitchd: Improve the readability of the E-R diagram.
Ben Pfaff [Tue, 8 Oct 2013 22:25:28 +0000 (15:25 -0700)]
vswitchd: Improve the readability of the E-R diagram.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoovsdb-doc: Document immutable columns.
Ben Pfaff [Tue, 8 Oct 2013 22:22:20 +0000 (15:22 -0700)]
ovsdb-doc: Document immutable columns.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoovsdb-idl: Remove write-only member 'commit_seqno' from ovsdb_idl_txn.
Ben Pfaff [Tue, 8 Oct 2013 22:12:24 +0000 (15:12 -0700)]
ovsdb-idl: Remove write-only member 'commit_seqno' from ovsdb_idl_txn.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoovs-controller: Avoid dereferencing NULL pointer when the switch acts as a hub
ZhengLingyun [Tue, 8 Oct 2013 15:52:40 +0000 (23:52 +0800)]
ovs-controller: Avoid dereferencing NULL pointer when the switch acts as a hub

Starting ovs-controller with '-H' option will lead to a segment fault problem.
Add a check, and adjust the indentation of the following code.

Signed-off-by: ZhengLingyun <konghuarukhr@163.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Mon, 7 Oct 2013 10:34:23 +0000 (12:34 +0200)]
Merge branch 'mainstream'

10 years ago[gmap] fix for comma separated input
Giuseppe Lettieri [Mon, 7 Oct 2013 10:32:29 +0000 (12:32 +0200)]
[gmap] fix for comma separated input

Suggested by Felician Nemeth.

10 years agoovs-lib: Revert "Return the exit status of ovs-ctl in ovs_ctl()."
Gurucharan Shetty [Fri, 4 Oct 2013 21:52:34 +0000 (14:52 -0700)]
ovs-lib: Revert "Return the exit status of ovs-ctl in ovs_ctl()."

This reverts commit 9d46457e07ca which had a side-effect that
ssh executing start/restart command on a remote machine would
hang as one of the file descriptors created in that commit
was getting passed along to the daemons. The daemons weren't closing
it and hence ssh would just wait for them to close and hang.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: add linux/flow_{table, netlink}.c to .gitignore
Lorand Jakab [Fri, 4 Oct 2013 11:07:31 +0000 (14:07 +0300)]
datapath: add linux/flow_{table, netlink}.c to .gitignore

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoovsdb-server: Document that --remote may be used multiple times.
Ben Pfaff [Fri, 4 Oct 2013 15:58:52 +0000 (08:58 -0700)]
ovsdb-server: Document that --remote may be used multiple times.

Reported-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto-dpif-xlate: Suppress oversize datapath actions.
Ben Pfaff [Fri, 4 Oct 2013 15:48:48 +0000 (08:48 -0700)]
ofproto-dpif-xlate: Suppress oversize datapath actions.

If we allow oversize datapath actions to make it out of translation, then
we will assert-fail later when we try to put those actions into a Netlink
attribute.

Bug #19277.
Reported-by: Paul ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto-dpif-xlate: Limit memory and time that translation can consume.
Ben Pfaff [Fri, 4 Oct 2013 15:47:16 +0000 (08:47 -0700)]
ofproto-dpif-xlate: Limit memory and time that translation can consume.

The resubmit depth has been limited to MAX_RESUBMIT_RECURSION, currently
64, for a long time.  But the flow "actions=resubmit:1, resubmit:2,
output:1" generates about 2**MAX_RESUBMIT_RECURSION output actions,
exhausting memory.  This commit fixes the problem.

Such a flow also requires 2**MAX_RESUBMIT_RECURSION time for translation.
This commit fixes that problem too.

Bug #19277.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agodatapath: Simplify mega-flow APIs.
Pravin B Shelar [Thu, 3 Oct 2013 20:54:51 +0000 (13:54 -0700)]
datapath: Simplify mega-flow APIs.

Hides mega-flow implementation in flow_table.c rather than
datapath.c.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Move mega-flow list out of rehashing struct.
Pravin B Shelar [Thu, 3 Oct 2013 20:49:31 +0000 (13:49 -0700)]
datapath: Move mega-flow list out of rehashing struct.

ovs-flow rehash does not touch mega flow list. Following patch
moves it dp struct datapath.  Avoid one extra indirection for
accessing mega-flow list head on every packet receive.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Restructure datapath.c and flow.c
Pravin B Shelar [Thu, 12 Sep 2013 03:26:11 +0000 (20:26 -0700)]
datapath: Restructure datapath.c and flow.c

Over the time datapath.c and flow.c has became pretty large files.
Following patch restructures functionality of component into three
different components:

flow.c: contains flow extract.
flow_netlink.c: netlink flow api.
flow_table.c: flow table api.

Diffstat is showing wrong count. This patch mostly restructures code
without changing logic.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agosignals: Don't assume that sys_siglist is an array.
YAMAMOTO Takashi [Thu, 3 Oct 2013 06:52:24 +0000 (15:52 +0900)]
signals: Don't assume that sys_siglist is an array.

Found by commit 878f1972909b3 (util: use gcc builtins to better check array
sizes).

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoutil: use gcc builtins to better check array sizes
Flavio Leitner [Wed, 2 Oct 2013 05:40:09 +0000 (02:40 -0300)]
util: use gcc builtins to better check array sizes

GCC provides two useful builtin functions that can help
to improve array size checking during compilation.

This patch contains no functional changes, but it makes
it easier to detect mistakes.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-upcall: Remove dead code from recv_upcalls().
Ben Pfaff [Wed, 2 Oct 2013 18:07:56 +0000 (11:07 -0700)]
ofproto-dpif-upcall: Remove dead code from recv_upcalls().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-upcall: reduce number of wakeup
YAMAMOTO Takashi [Wed, 2 Oct 2013 17:49:30 +0000 (10:49 -0700)]
ofproto-dpif-upcall: reduce number of wakeup

If a queue length is long (ie. non-0), the consumer thread should
already be busy working on the queue.  there's no need to wake it
up repeatedly.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-lib: Return the exit status of ovs-ctl in ovs_ctl().
Duffie Cooley [Wed, 2 Oct 2013 14:07:43 +0000 (07:07 -0700)]
ovs-lib: Return the exit status of ovs-ctl in ovs_ctl().

commit 46528f78e5c(debian, rhel, xenserver: Ability to collect ovs-ctl logs)
made changes in the startup scripts such that the o/p of ovs-ctl is logged
into ovs-ctl.log. But it had an unintended consequence that the exit status
of ovs-ctl was no longer returned. We would always return success(the exit
status of tee).

With this commit, we return the exit status of ovs-ctl instead of tee.
Code referenced from: (line wrapped).
http://unix.stackexchange.com/questions/14270/\
get-exit-status-of-process-thats-piped-to-another/70675#70675)

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Duffie Cooley <dcooley@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dpctl, ofproto/trace: Show and handle the in_port name in flows.
Gurucharan Shetty [Tue, 24 Sep 2013 05:58:46 +0000 (22:58 -0700)]
ovs-dpctl, ofproto/trace: Show and handle the in_port name in flows.

With this commit, whenever the verbosity is enabled with '-m'
option, the ovs-dpctl dump-flows command will display the flows with
in_port field showing the name instead of a port number.

Conversely, one can also use a name in the in_port field with del-flow,
add-flow and mod-flow commands of ovs-dpctl. One should also be able
to use the port name when supplying the datapath flow as an input
to ofproto/trace command.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agostream: Log a warning when the default OpenFlow or OVSDB port is used.
Justin Pettit [Mon, 23 Sep 2013 21:20:27 +0000 (14:20 -0700)]
stream: Log a warning when the default OpenFlow or OVSDB port is used.

Both OpenFlow and OVSDB have new IANA-assigned port numbers.  We still
default to the original values (6633 and 6632, respectively), but this
commit logs a warning.  In the future, we will switch to the official
values (6653 and 6640, respectively).

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Define official OpenFlow port number.
Justin Pettit [Sat, 31 Aug 2013 00:26:56 +0000 (17:26 -0700)]
ofproto: Define official OpenFlow port number.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovsdb: Define official port number.
Justin Pettit [Sat, 31 Aug 2013 00:20:29 +0000 (17:20 -0700)]
ovsdb: Define official port number.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoDon't differentiate between TCP and SSL ports for OpenFlow and OVSDB.
Justin Pettit [Mon, 23 Sep 2013 21:33:09 +0000 (14:33 -0700)]
Don't differentiate between TCP and SSL ports for OpenFlow and OVSDB.

The OVS code has always made a distinction between the unencrypted (TCP)
and SSL port numbers for the OpenFlow and OVSDB protocols.  The default
port numbers for both protocols has changed, and there continues to be
no distinction between the unencrypted and SSL versions.  This
commit removes the distinction in port numbers.  A future patch will
recognize the change in default port number.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Fix vxlan gso with vlan.
Pravin B Shelar [Tue, 1 Oct 2013 15:24:55 +0000 (08:24 -0700)]
datapath: Fix vxlan gso with vlan.

To use ovs-gso-compatibility we need to record inner skb offset.
In case of vxlan it is done before vlan header is pushed which
gives wrong inner packet to ovs-gso.
Following patch reset skb offsets after inner skb is completely built.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agoofproto-dpif: Compute the subfacet add/del rate using coverage counters.
Alex Wang [Tue, 1 Oct 2013 01:32:44 +0000 (18:32 -0700)]
ofproto-dpif: Compute the subfacet add/del rate using coverage counters.

So far, the subfacet rates (e.g. add rate, del rate) are computed by
exponential moving averaging function in ofproto-dpif.c.  This commit
replaces that logic with coverage counters.  And the rates can be
checked by running "ovs-appctl coverage/show" command.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agocoverage: Reimplement the "ovs-appctl coverage/show" command.
Alex Wang [Tue, 1 Oct 2013 01:31:44 +0000 (18:31 -0700)]
coverage: Reimplement the "ovs-appctl coverage/show" command.

This commit changes the "ovs-appctl coverage/show" command to show the
the averaged per-second rates for the last few seconds, the last minute
and the last hour, and the total counts of all of the coverage counters.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agorhel: fix the exit status of the openvswitch init script.
Duffie Cooley [Tue, 1 Oct 2013 02:27:07 +0000 (19:27 -0700)]
rhel: fix the exit status of the openvswitch init script.

This is a fix for a request to make sure that the openvswitch status command
in rhel based distros gives a useful exit status. That was fixed in

commit 5e0c05bc058c78a11be6747f62e6ad88e5d06b70
debian: Fix exit status of openvswitch-switch init script "status" command

Signed-off-by: Duffie Cooley <dcooley@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Correct endian problem in recv_upcalls()
Simon Horman [Tue, 1 Oct 2013 06:15:22 +0000 (15:15 +0900)]
ofproto-dpif: Correct endian problem in recv_upcalls()

Use nl_attr_get_u32() instead of nl_attr_get_be32() to parse nla
so that the decoded value which is passed to mhash_add()
is host byte order as mhash_add() expects.

This resolves a minor regression introduced by
10e576406c7444ef ("ofproto-dpif: Move special upcall handling into
ofproto-dpif-upcall.").

I do not expect this change has any runtime implications.

Detected using sparse.

Cc: Ethan Jackson <ethan@nicira.com>
Cc: Ben Pfaff <blp@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Move special upcall handling into ofproto-dpif-upcall.
Ethan Jackson [Tue, 24 Sep 2013 22:04:04 +0000 (15:04 -0700)]
ofproto-dpif: Move special upcall handling into ofproto-dpif-upcall.

Both the IPFIX and SFLOW modules are thread safe, so there's no
particular reason to pass them up to the main thread.  Eliminating
this step significantly simplifies the code.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoSuppress warnings about unused variables and functions.
Jarno Rajahalme [Thu, 26 Sep 2013 17:54:59 +0000 (10:54 -0700)]
Suppress warnings about unused variables and functions.

These variables and functions are unused but we don't want to remove
their definitions.

Found by Clang.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoRemove unused variables and functions.
Jarno Rajahalme [Thu, 26 Sep 2013 17:55:35 +0000 (10:55 -0700)]
Remove unused variables and functions.

Found by Clang.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoovs-bugtool: Change log-days parameter based on file last_mod_time.
Shih-Hao Li [Fri, 27 Sep 2013 20:15:27 +0000 (13:15 -0700)]
ovs-bugtool: Change log-days parameter based on file last_mod_time.

Previously the log-days parameter can only support rotated logs
based on their numbered filename extension. Thus it can not be
used for other types of log filenames. This patch changes it to
be based on file last modification time.

Issue: #19671

Signed-off-by: Shih-Hao Li <shihli@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoodp: Only pass vlan_tci to commit_vlan_action()
Joe Stringer [Fri, 27 Sep 2013 00:18:30 +0000 (09:18 +0900)]
odp: Only pass vlan_tci to commit_vlan_action()

This allows for future patches to pass different tci values to
commit_vlan_action() without passing an entire flow structure.

Signed-off-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 agoRemove mpls_depth field from flow
Simon Horman [Thu, 26 Sep 2013 21:55:19 +0000 (06:55 +0900)]
Remove mpls_depth field from flow

Rather than tracking the MPLS depth as a field in the
flow, which is an entirely poor place for it, just track
the delta to the MPLS depth during translation.

This logic was developed while implementing recirculation
and intended to be used to detect when recirculation should
occur. This variant of the patch uses the logic to determine
if processing of actions should stop due to an MPLS
action which cannot be translated (without recirculation).

A side-effect of this patch is that it resolves a bug
whereby ovs-vswitchd will abort due to to an assertion
on eth_type_mpls(ctx->xin->flow.dl_type) in compose_mpls_pop_action(()
if the actions of a flow include pop_mpls twice without
a push_mpls in between.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonicira-ext: Fix incorrect description of NXM_NX_IPV6_LABEL as non-maskable.
Ben Pfaff [Fri, 27 Sep 2013 06:17:41 +0000 (23:17 -0700)]
nicira-ext: Fix incorrect description of NXM_NX_IPV6_LABEL as non-maskable.

Commit 32455024044444 (OXM: Allow masking of IPv6 Flow Label) made the
IPv6 flow label field fully maskable but did not update the comment to say
so.

EXT-101.
CC: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto: Recycle least recently used ofport.
Gurucharan Shetty [Wed, 25 Sep 2013 16:40:13 +0000 (09:40 -0700)]
ofproto: Recycle least recently used ofport.

If there is a lot of churn in creation and deletion of
interfaces, we may end up recycling the ofport value of a
recently deleted interface for a newly created interface.
This may result in an old stale openflow rule applying
on the newly created interface.

With this commit, when a new port is added, try and provide
it an ofport value that has not been used during the current
run. If such value does not exist, provide the least
recently used ofport value.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoFAQ: Explain why allowing only IP traffic breaks IP connectivity.
Ben Pfaff [Thu, 26 Sep 2013 20:24:38 +0000 (13:24 -0700)]
FAQ: Explain why allowing only IP traffic breaks IP connectivity.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: pritesh <pritesh.kothari@cisco.com>
10 years agoovs-bugtool: Limit disk usage
Shih-Hao Li [Wed, 25 Sep 2013 16:47:00 +0000 (09:47 -0700)]
ovs-bugtool: Limit disk usage

When output to a file with "--unlimited" unset,
only allow 90% of the free disk space to be used.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoclassifier: Avoid accumulating junk in cls_partition 'tags'.
Ben Pfaff [Wed, 25 Sep 2013 22:36:51 +0000 (15:36 -0700)]
classifier: Avoid accumulating junk in cls_partition 'tags'.

It's easy to add two tags together, but it's hard to subtract them.  The
new "tag_tracker" data structure provides a solution.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoclassifier: Speed up lookup when metadata partitions the flow table.
Ben Pfaff [Wed, 25 Sep 2013 22:07:21 +0000 (15:07 -0700)]
classifier: Speed up lookup when metadata partitions the flow table.

We have a controller that puts many rules with different metadata values
into the flow table, where metadata is used (by "resubmit"s) to distinguish
stages in a pipeline.  Thus, any given flow only needs to be hashed into
classifier "cls_table"s that contain a match for the flow's metadata value.
This commit optimizes the classifier lookup by (probabilistically) skipping
the "cls_table"s that can't possibly match.

(The "metadata" referred to here is the OpenFlow 1.1+ "metadata" field,
which is a 64-bit field similar in purpose to the "registers" defined by
Open vSwitch.)

Previous versions of this patch, with earlier versions of the controller in
question, improved flow setup performance by about 19%.

Bug #14282.
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotag: Reintroduce tag library.
Ben Pfaff [Tue, 27 Aug 2013 17:14:49 +0000 (10:14 -0700)]
tag: Reintroduce tag library.

It is needed for the classifier partitioning optimization.  This commit
only reintroduces the parts that are actually needed.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agomatch: New function minimatch_matches_flow().
Ben Pfaff [Thu, 7 Feb 2013 00:13:19 +0000 (16:13 -0800)]
match: New function minimatch_matches_flow().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Fix a typo in documentation.
Gurucharan Shetty [Thu, 26 Sep 2013 16:11:12 +0000 (09:11 -0700)]
ovs-ofctl: Fix a typo in documentation.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Thu, 26 Sep 2013 08:22:55 +0000 (10:22 +0200)]
Merge branch 'mainstream'

10 years agodatapath: Move segmentation compatibility code into a compatibility function
Simon Horman [Tue, 24 Sep 2013 07:44:06 +0000 (16:44 +0900)]
datapath: Move segmentation compatibility code into a compatibility function

Move segmentation compatibility code out of netdev_send and into
rpl_dev_queue_xmit(), a compatibility function used in place
of dev_queue_xmit() as necessary.

As suggested by Jesse Gross.

Some minor though verbose implementation notes:

* This rpl_dev_queue_xmit() endeavours to return a valid error code or
  zero on success as per dev_queue_xmit(). The exception is that when
  dev_queue_xmit() is called in a loop only the status of the last call is
  taken into account, thus ignoring any errors returned by previous calls.
  This is derived from the previous calls to dev_queue_xmit() in a loop
  where netdev_send() ignores the return value of dev_queue_xmit()
  entirely.

* netdev_send() continues to ignore the value of dev_queue_xmit().
  So the discussion of the return value of rpl_dev_queue_xmit()
  above is has no bearing on run-time behaviour.

* The return value of netdev_send() may differ from the previous
  implementation in the case where segmentation is performed before
  calling the real dev_queue_xmit(). This is because previously in
  this case netdev_send() would return the combined length of the
  skbs resulting from segmentation. Whereas the current code
  always returns the length of the original skb.

Signed-off-by: Simon Horman <horms@verge.net.au>
[jesse: adjust error path in netdev_send() to match upstream]
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: simplify VLAN segmentation
Simon Horman [Tue, 24 Sep 2013 07:44:05 +0000 (16:44 +0900)]
datapath: simplify VLAN segmentation

Push vlan tag onto packet before segmentation to simplify the code.
As suggested by Pravin Shelar and Jesse Gross.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agotunnel: Make tnl_find() easier to understand.
Ben Pfaff [Wed, 25 Sep 2013 16:35:33 +0000 (09:35 -0700)]
tunnel: Make tnl_find() easier to understand.

Suggested-by: pritesh <pritesh.kothari@cisco.com>
Acked-by: pritesh <pritesh.kothari@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoOPENFLOW-1.1+: update for OF1.3 ONF Extentions and OF1.4
YAMAMOTO Takashi [Wed, 25 Sep 2013 08:35:16 +0000 (17:35 +0900)]
OPENFLOW-1.1+: update for OF1.3 ONF Extentions and OF1.4

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agofor ovs-appctl bridge/dump-flows, don't show "priority" twice
YAMAMOTO Takashi [Wed, 25 Sep 2013 04:39:48 +0000 (13:39 +0900)]
for ovs-appctl bridge/dump-flows, don't show "priority" twice

before the change:

duration=2110s, priority=0, n_packets=3151646, n_bytes=3104180388, \
priority=0,actions=CONTROLLER:65535
table_id=254, duration=2136s, priority=0, n_packets=0, n_bytes=0, \
priority=0,reg0=0x3,actions=drop
table_id=254, duration=2136s, priority=0, n_packets=0, n_bytes=0, \
priority=0,reg0=0x1,actions=controller(reason=no_match)
table_id=254, duration=2136s, priority=0, n_packets=0, n_bytes=0, \
priority=0,reg0=0x2,actions=drop

after the change:

duration=2924s, n_packets=5316116, n_bytes=5260045454, \
priority=0,actions=CONTROLLER:65535
table_id=254, duration=2924s, n_packets=0, n_bytes=0, \
priority=0,reg0=0x3,actions=drop
table_id=254, duration=2924s, n_packets=0, n_bytes=0, \
priority=0,reg0=0x1,actions=controller(reason=no_match)
table_id=254, duration=2924s, n_packets=0, n_bytes=0, \
priority=0,reg0=0x2,actions=drop

(i wrapped long lines by hand)

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agopackets: Remove unused function eth_mpls_depth
Simon Horman [Wed, 25 Sep 2013 04:26:06 +0000 (13:26 +0900)]
packets: Remove unused function eth_mpls_depth

eth_mpls_depth() has been unused as of 1ac7c9bdb2b6fdcb ("ofproto-dpif: Use
execute_actions to execute controller actions").

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Fix typos in comment.
Ben Pfaff [Tue, 24 Sep 2013 23:33:02 +0000 (16:33 -0700)]
datapath: Fix typos in comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: pritesh <pritesh.kothari@cisco.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agoofproto-dpif-upcall: Fix a memory leak.
Jarno Rajahalme [Mon, 23 Sep 2013 17:57:22 +0000 (10:57 -0700)]
ofproto-dpif-upcall: Fix a memory leak.

The "key" member in struct flow_miss refers to memory held by the "struct
upcall", hence the upcalls should be freed only after the flow misses are
processed by the main thread.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dpctl: Update usage where datapath name is optional.
Gurucharan Shetty [Tue, 24 Sep 2013 17:23:49 +0000 (10:23 -0700)]
ovs-dpctl: Update usage where datapath name is optional.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Parse the in_port as a name correctly.
Gurucharan Shetty [Mon, 23 Sep 2013 21:13:35 +0000 (14:13 -0700)]
odp-util: Parse the in_port as a name correctly.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dpctl: Parse the arguments correctly for del-flow.
Gurucharan Shetty [Mon, 23 Sep 2013 20:11:41 +0000 (13:11 -0700)]
ovs-dpctl: Parse the arguments correctly for del-flow.

Inside dpctl_del_flow() argv[0] is 'del-flow' and argv[1] can
be the flow in the absence of the optional datapath argument.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dpctl: Add a missing simap_destroy()
Gurucharan Shetty [Mon, 23 Sep 2013 20:07:24 +0000 (13:07 -0700)]
ovs-dpctl: Add a missing simap_destroy()

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dpctl: Remove stale comment.
Gurucharan Shetty [Mon, 23 Sep 2013 20:02:10 +0000 (13:02 -0700)]
ovs-dpctl: Remove stale comment.

The '-m' option is documented in the manpage.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-upcall: Fix typos in comments.
Ben Pfaff [Tue, 24 Sep 2013 22:51:47 +0000 (15:51 -0700)]
ofproto-dpif-upcall: Fix typos in comments.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: pritesh <pritesh.kothari@cisco.com>
10 years agohmap: Make bad hash functions easier to find.
Ben Pfaff [Tue, 24 Sep 2013 21:42:35 +0000 (14:42 -0700)]
hmap: Make bad hash functions easier to find.

The hmap code has for a long time incremented a counter when a hash bucket
grew to have many entries.  This can let a developer know that some hash
function is performing poorly, but doesn't give any hint as to which one.
This commit improves the situation by adding rate-limited debug logging
that points out a particular line of code as the source of the poor hash
behavior.  It should make issues easier to track down.

Bug #19926.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Lauded-by: Keith Amidon <keith@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto: Fix memory leak in rule_actions_unref().
Ben Pfaff [Tue, 24 Sep 2013 21:22:14 +0000 (14:22 -0700)]
ofproto: Fix memory leak in rule_actions_unref().

Found by valgrind.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto: Allow ofproto_delete_flow() to delete hidden rules.
Ben Pfaff [Tue, 24 Sep 2013 04:34:37 +0000 (21:34 -0700)]
ofproto: Allow ofproto_delete_flow() to delete hidden rules.

Commit 97f63e57a8 (ofproto: Remove soon-to-be-invalid optimizations.)
changed ofproto_delete_flow() to use the general-purpose flow_mod
implementation.  However, the general-purpose flow_mod never matches hidden
flows, which are exactly the flows that ofproto_delete_flow()'s callers
want to delete.

This commit fixes the problem by allowing flow_mods that specify a priority
that can only be for a hidden flow to delete a hidden flow.  (This doesn't
allow OpenFlow clients to meddle with hidden flows because OpenFlow uses
only a 16-bit field to specify priority.)

I verified that, without this commit, if I change from one controller to
another with "ovs-vsctl set-controller", then the in-band rules for the
old controller remain.  With this commit, the old rules are removed.

Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Bug #19821.
Reported-by: Luca Giraudo <lgiraudo@vmware.com>
Bug #19888.
Reported-by: Ying Chen <yingchen@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agodatapath: remove duplicated include from vport-gre.c
Wei Yongjun [Mon, 23 Sep 2013 20:38:13 +0000 (13:38 -0700)]
datapath: remove duplicated include from vport-gre.c

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: remove duplicated include from vport-vxlan.c
Wei Yongjun [Mon, 23 Sep 2013 20:39:00 +0000 (13:39 -0700)]
datapath: remove duplicated include from vport-vxlan.c

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agocfm: Don't enforce CFM_FAULT_INTERVAL.
Ethan Jackson [Fri, 20 Sep 2013 22:32:08 +0000 (15:32 -0700)]
cfm: Don't enforce CFM_FAULT_INTERVAL.

While upgrading a deployment, it's possible that transient
configuration changes could cause the cfm interval on two ends of a
link to be different.  If these two configured values are close to
each other, this condition could have no impact on traffic.  Therefore
it's better to let this slide than force a tunnel down guaranteeing an
impact

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agocfm: Prevent interval fault when demand mode is enabled on one end.
alex wang [Fri, 20 Sep 2013 06:13:33 +0000 (06:13 +0000)]
cfm: Prevent interval fault when demand mode is enabled on one end.

This commit prevents cfm from raising 'interval' fault when demand
mode is only enabled on one end of link.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif-upcall: Forward packets in order of arrival.
Ben Pfaff [Thu, 19 Sep 2013 18:03:47 +0000 (11:03 -0700)]
ofproto-dpif-upcall: Forward packets in order of arrival.

Until now, the code in ofproto-dpif-upcall (and the code that preceded it
in ofproto-dpif) obtained a batch of incoming packets, inserted them into
a hash table based on hashes of their flows, processed them, and then
forwarded them in hash order.  Usually this maintains order within a single
network connection, but because OVS's notion of a flow is so fine-grained,
it can reorder packets within (e.g.) a TCP connection if two packets
handled in a single batch have (e.g.) different ECN values.

This commit fixes the problem by making ofproto-dpif-upcall always forward
packets in the same order they were received.

This is far from the minimal change necessary to avoid reordering packets.
I think that the code is easier to understand afterward.

Reported-by: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>