sliver-openvswitch.git
11 years agoSet dates for 1.9.0 release.
Justin Pettit [Tue, 26 Feb 2013 19:24:20 +0000 (11:24 -0800)]
Set dates for 1.9.0 release.

This also sets the dates for 1.8.0, even though it was an internal-only
release.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoNEWS: Note tunneling feature removals in the correct release.
Jesse Gross [Mon, 11 Mar 2013 23:00:17 +0000 (16:00 -0700)]
NEWS: Note tunneling feature removals in the correct release.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoovs-ctl.in: Set hard limit for core files created.
Gurucharan Shetty [Mon, 11 Mar 2013 20:07:11 +0000 (13:07 -0700)]
ovs-ctl.in: Set hard limit for core files created.

Currently we set a soft limit while defining the maximum size of
core files. If there is already a hard limit set that is lesser
than the soft limit we are setting, it will fail.

Since our startup scripts start with root permissions, it looks
fine to set the hard limit directly instead.

Reported-by: Dan Wendlandt <dan@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoofproto-dpif: Remove unnecessary ofp_port to odp_port mapping.
Jarno Rajahalme [Mon, 11 Mar 2013 13:27:41 +0000 (15:27 +0200)]
ofproto-dpif: Remove unnecessary ofp_port to odp_port mapping.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonicira-ext: Document that nx_flow_mod_table_id applies to nx_flow_mod too.
Ben Pfaff [Fri, 8 Mar 2013 18:24:06 +0000 (10:24 -0800)]
nicira-ext: Document that nx_flow_mod_table_id applies to nx_flow_mod too.

It wasn't clear from the comments that nx_flow_mod_table_id applies to
nx_flow_mod as well as ofp10_flow_mod, but it does and always has.  This
commit makes it clear.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoNEWS: Fix release for table ID in NXM flow_removed feature.
Ben Pfaff [Fri, 8 Mar 2013 18:54:13 +0000 (10:54 -0800)]
NEWS: Fix release for table ID in NXM flow_removed feature.

I forgot that I was planning to backport this to branch-1.10.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAdd table_id to NXM flow_removed messages.
Ben Pfaff [Wed, 6 Mar 2013 17:13:37 +0000 (09:13 -0800)]
Add table_id to NXM flow_removed messages.

Feature #15466.
Requested-by: Ronghua Zhang <rzhang@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Fix up user specifying wrong bridge on "ofproto/trace".
Ben Pfaff [Wed, 6 Mar 2013 00:48:21 +0000 (16:48 -0800)]
ofproto-dpif: Fix up user specifying wrong bridge on "ofproto/trace".

If there is more than one bridge, then it's easy to specify the wrong one
on an ofproto/trace command.  Previously, this would produce surprising
results.  With this commit, "ofproto/trace" should silently fix up the
problem.

It would be nice to not require the user to specify a bridge at all, but
it's theoretically possible to have more than one backer, in which case we
need some way to distinguish, and a bridge name is as good an identifier
as we have.  We could ask the user to specify the datapath_type, I guess,
but that's a less familiar name to most users and it would be a somewhat
gratuitous change in synatx for ofproto/trace.

Bug #15419.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: GOTO_TABLE recursion removal.
Jarno Rajahalme [Fri, 8 Mar 2013 13:50:12 +0000 (15:50 +0200)]
ofproto-dpif: GOTO_TABLE recursion removal.

Remove recursion from GOTO_TABLE processing in do_xlate_actions().
This allows packet processing pipelines built with goto table be
longer and not interact with each other via the resubmit recursion limit.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Print slow-path actions instead of "drop" in dump-flows.
Justin Pettit [Thu, 7 Mar 2013 01:11:35 +0000 (17:11 -0800)]
ofproto-dpif: Print slow-path actions instead of "drop" in dump-flows.

The command "ovs-appctl dpif/dump-flows" would print slow-path actions
as "drop", which could be confusing to users.  This is different from
"ovs-dpctl dump-flows", which prints a descriptive reason.  This commit
replaces "drop" with the reason.

Bug #14840

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoofproto-dpif: Add helper function to retrieve a subfacet from a facet.
Justin Pettit [Thu, 7 Mar 2013 02:15:06 +0000 (18:15 -0800)]
ofproto-dpif: Add helper function to retrieve a subfacet from a facet.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoofproto-dpif: Clarify that 'one_subfacet' may not always be valid.
Justin Pettit [Thu, 7 Mar 2013 02:03:54 +0000 (18:03 -0800)]
ofproto-dpif: Clarify that 'one_subfacet' may not always be valid.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agotimeval: Avoid backtrace() from signal handler on x86-64.
Ben Pfaff [Fri, 8 Mar 2013 01:13:49 +0000 (17:13 -0800)]
timeval: Avoid backtrace() from signal handler on x86-64.

backtrace() is really useful, but it is not signal safe everywhere.  We
need to reassess whether it is reasonable to use it anywhere, but
immediately we need to disable it on x86-64 (with glibc) because it is
causing segfaults in testing.

Bug #15497.
Reported-by: Ram Jothikumar <rjothikumar@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Treat zero MPLS post-decrement TTL as invalid.
Ben Pfaff [Thu, 7 Mar 2013 19:09:12 +0000 (11:09 -0800)]
ofproto-dpif: Treat zero MPLS post-decrement TTL as invalid.

RFC 3443 says that an outgoing MPLS TTL of zero is invalid, so we must send
packets that have such a TTL post-decrement to the controller rather than
allowing them to continue through the OpenFlow tables.

Here is the text from RFC 3443 that implies this behavior:

   oTTL: This is the TTL value used as the outgoing TTL value (see
   section 3.5 for exception).  It is always (iTTL - 1) unless otherwise
   stated.

   oTTL Check: Check if oTTL is greater than 0.  If the oTTL Check is
   false, then the packet is not forwarded.  Note that the oTTL check is
   performed only if any outgoing TTL (either IP or MPLS) is set to oTTL
   (see section 3.5 for exception).

That is, the output TTL is one less than the input TTL, and a packet with
an output TTL of 0 must not be forwarded.

CC: Bruce Davie <bsd@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
11 years agobridge: Fix interpretation of 'health' member of struct ofproto_cfm_status.
Ben Pfaff [Wed, 6 Mar 2013 22:50:26 +0000 (14:50 -0800)]
bridge: Fix interpretation of 'health' member of struct ofproto_cfm_status.

Commit 9a9e3786b3a8 (ofproto: Merge all the CFM query functions into one.)
mistakenly interpreted struct ofproto_cfm_status as always being in the
range [0,100].  It can in fact take the value -1 if the health status is
not currently well-defined.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agobridge: Fix remote_opstate bug recently introduced.
Ben Pfaff [Wed, 6 Mar 2013 22:47:11 +0000 (14:47 -0800)]
bridge: Fix remote_opstate bug recently introduced.

Commit 9a9e3786b3a8 (ofproto: Merge all the CFM query functions into one.)
mistakenly transformed a tristate variable into a Boolean one.  This commit
fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agotunnel: Mark ECN status on decapsulated tunnel packets.
Justin Pettit [Wed, 13 Feb 2013 22:50:24 +0000 (14:50 -0800)]
tunnel: Mark ECN status on decapsulated tunnel packets.

In the kernel tunnel implementation, if a packet was marked as ECN CE on
the outer packet then we would carry this over to the inner packet on
decapsulation.  With the switch to flow based tunneling, this stopped
happening.  This commit reintroduces that behavior by using the set IP
header action.

Bug #15072

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agotunnel: Generate datapath flows for tunneled packets dropped due to ECN.
Justin Pettit [Wed, 13 Feb 2013 22:08:15 +0000 (14:08 -0800)]
tunnel: Generate datapath flows for tunneled packets dropped due to ECN.

Move the check for whether tunneled packets should be dropped due to
congestion encountered (CE) when the encapsulated packet is not ECN
capable (non-ECT).  This also adds some additional tests for ECN
handling on tunnel decapsulation.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoofproto-dpif: Store the initial tunnel IP TOS values for later use.
Justin Pettit [Wed, 13 Feb 2013 02:08:01 +0000 (18:08 -0800)]
ofproto-dpif: Store the initial tunnel IP TOS values for later use.

When a packet arrives on an IP tunnel, store the TOS value for later
use.  This value will be used in a couple of future commits.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoofproto-dpif: Make initial packet value handling generic.
Justin Pettit [Tue, 12 Feb 2013 02:56:24 +0000 (18:56 -0800)]
ofproto-dpif: Make initial packet value handling generic.

For VLAN splinters, an "initial_tci" value was introduced that is passed
around during flow processing to be used later for action translation.
This commit switches to passing around a struct so that additional
values beyond TCI can be used.  A future commit will use this.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoofproto-dpif: Pass around "facet" in flow_push_stats().
Justin Pettit [Tue, 19 Feb 2013 19:42:54 +0000 (11:42 -0800)]
ofproto-dpif: Pass around "facet" in flow_push_stats().

The flow_push_stats() function will need other members of the "facet"
structure in a future commit.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agonicira-ext: Add Nicira actions NXAST_STACK_PUSH and NXAST_STACK_POP.
Andy Zhou [Wed, 6 Mar 2013 00:27:55 +0000 (16:27 -0800)]
nicira-ext: Add Nicira actions NXAST_STACK_PUSH and NXAST_STACK_POP.

The Push action takes a single parameter. Any source allowed by NXAST_REG_MOVE
is allowed to be pushed onto the stack. When the source is a bit field,
its value will be right shifted to bit zero before being pushed onto the
stack. The remaining bits will be set to zero.

The Pop action also takes a single parameter. Any destination allowed by
NXAST_REG_MOVE can be used as the destination of the action. The value, in
case of a bit field, will be taken from top of the stack, starting from
bit zero.

The stack size is not limited. The initial 8KB is statically allocated to
efficiently handle most common use cases. When more stack space is
required, the stack can grow using malloc().

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Merge all the CFM query functions into one.
Ben Pfaff [Wed, 6 Mar 2013 17:25:40 +0000 (09:25 -0800)]
ofproto: Merge all the CFM query functions into one.

This eliminates several function calls and in particular several
hash table lookups to find structures corresponding to a port
number from iface_refresh_cfm_stats().

This does not seem to reduce CPU use, but the code is shorter
and more readable.

Bug #15171.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoAdd support for set_mpls_ttl action
Simon Horman [Wed, 6 Mar 2013 07:08:12 +0000 (16:08 +0900)]
Add support for set_mpls_ttl action

This adds support for the OpenFlow 1.1+ set_mpls_ttl action.
And also adds an NX set_mpls_ttl action.

The handling of the TTL modification is entirely handled in userspace.

Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAdd support for dec_mpls_ttl action
Simon Horman [Wed, 6 Mar 2013 07:08:23 +0000 (16:08 +0900)]
Add support for dec_mpls_ttl action

This adds support for the OpenFlow 1.1+ dec_mpls_ttl action.
And also adds an NX dec_mpls_ttl action.

The handling of the TTL modification is entirely handled in userspace.

Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotimeval: Increase accuracy of cached time 4X, from 100 ms to 25 ms.
Ben Pfaff [Tue, 5 Mar 2013 21:12:08 +0000 (13:12 -0800)]
timeval: Increase accuracy of cached time 4X, from 100 ms to 25 ms.

With CFM and other tunnel monitoring protocols, having a fairly precise
time is good.  My measurements don't show this change increasing CPU use.
(In fact it appears to repeatably reduce CPU use slightly, from about
22% to about 20% with 1000 CFM instances, although it's not obvious why.)

Bug #15171.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agotimeval: Enable caching the current time even on x86-64.
Ben Pfaff [Wed, 6 Mar 2013 00:12:21 +0000 (16:12 -0800)]
timeval: Enable caching the current time even on x86-64.

With CFM enabled on 1000 tunnels, this reduced CPU use from about 30% to
about 22%.

Bug #15171.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoovsdb-idlc: Make no-op writes to write-only columns cheaper.
Ben Pfaff [Tue, 5 Mar 2013 23:30:33 +0000 (15:30 -0800)]
ovsdb-idlc: Make no-op writes to write-only columns cheaper.

For 1000 tunnels with CFM enabled, this reduces CPU use from
about 36% to about 30%.

Bug #15171.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agotunneling: Simplify ovs_tnl_send() error handling code.
Pravin B Shelar [Wed, 6 Mar 2013 00:39:01 +0000 (16:39 -0800)]
tunneling: Simplify ovs_tnl_send() error handling code.

Following commit slightly improves code readability. It is
also correctness fix as ip_local_out() was storing error
code in err which was not int.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Fix circular dependency between bug.h and kernel.h.
Jesse Gross [Wed, 6 Mar 2013 08:10:01 +0000 (00:10 -0800)]
datapath: Fix circular dependency between bug.h and kernel.h.

In Linux 3.4 the definition for BUILD_BUG_ON_NOT_POWER_OF_2 was
moved from kernel.h to bug.h.  On various kernels these header
files include each other in various orders (often through a
long chain of other header files), which can create circular
dependency issues.  Since we not longer need this definition,
this simply removes the backport.

Reported-by: Palo Andi <andi@dis.uniroma1.it>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoovs-ctl.in: Restore interfaces and ofports for userspace restarts.
Gurucharan Shetty [Thu, 28 Feb 2013 22:46:43 +0000 (14:46 -0800)]
ovs-ctl.in: Restore interfaces and ofports for userspace restarts.

When we upgrade from pre-1.9 to 1.10 or later branches, when just
the user space daemons are restarted, with the older kernel module
intact, datapaths are recreated.

This results in loosing the internal interface states like ip addresses,
routing table entries etc. Also, the 'ofport' value of the older interfaces
change.

With this patch we restore the interface states, ofport values etc,
when "ovs-ctl restart" or "/etc/init.d/openvswitch[-switch] restart
--save-flows" is called. The later command is automatically called
when debian packages are installed.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-ctl.in: Clean up code for the next commit.
Gurucharan Shetty [Thu, 28 Feb 2013 22:21:40 +0000 (14:21 -0800)]
ovs-ctl.in: Clean up code for the next commit.

Previously, we would null the variables holding the names of the restore
scripts in case there were any errors in creating the restore script or if
we did not need to run a particular restore script. That is not necessary,
as we can just check the execution permission set on those scirpts.

Also, carve out a couple of functions which will be used in the next commit.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoTunnel: Cleanup old tunnel infrastructure.
Pravin B Shelar [Mon, 4 Mar 2013 21:00:25 +0000 (13:00 -0800)]
Tunnel: Cleanup old tunnel infrastructure.

Since userspace flow based tunneling code is checked in, the kernel
port based tunneling code can be removed.

Patch removes following components:
 - tunnel ports hash table and moved tunnel ports list to individual
   vports.
 - Cleaned per tnl-port config.
 - OVS_KEY_ATTR_TUN_ID action is removed.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #15078

11 years agoCodingStyle: Mention our common return value conventions.
Ben Pfaff [Fri, 1 Mar 2013 19:02:31 +0000 (11:02 -0800)]
CodingStyle: Mention our common return value conventions.

CC: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofpbuf: Remove OFPBUF_STACK_BUFFER.
Ben Pfaff [Thu, 28 Feb 2013 01:02:53 +0000 (17:02 -0800)]
ofpbuf: Remove OFPBUF_STACK_BUFFER.

Its alleged convenience just doesn't outweigh the syntactical ugliness, and
so it didn't have any users.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Increase maximum allocation size of action list.
Pravin B Shelar [Fri, 1 Mar 2013 00:15:00 +0000 (16:15 -0800)]
datapath: Increase maximum allocation size of action list.

The switch to flow based tunneling increased the size of each output
action in the flow action list.  In extreme cases, this can result
in the action list exceeding the maximum buffer size.
This doubles the maximum buffer size to compensate for the increase
in action size.
Action list is recieved from netlink callback which is allocating
linear-skb, therefore allocating another multi-page buffer would
not increase probability of the allocation-failure a lot.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #15203

11 years agoRevert "datapath: Increase maximum allocation size of action list."
Pravin B Shelar [Fri, 1 Mar 2013 00:12:32 +0000 (16:12 -0800)]
Revert "datapath: Increase maximum allocation size of action list."

This reverts commit 82b0d755094ec675ea1a49b4ae58bc1c5e8e51c2.

This patch introduced bug by calling vfree() from interrupt context.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agonetdev: Update comment.
Ben Pfaff [Thu, 28 Feb 2013 19:20:19 +0000 (11:20 -0800)]
netdev: Update comment.

The claim that there's only a single implementation was long obsolete.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev-linux: Fix netdev_linux_send() return value in corner case.
Ben Pfaff [Tue, 26 Feb 2013 20:35:40 +0000 (12:35 -0800)]
netdev-linux: Fix netdev_linux_send() return value in corner case.

A negative 'sock' means there was an error but netdev_linux_send() returns
a positive errno value on error.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonx-match: Correct writing of value and length in set_field_to_ofast()
Simon Horman [Wed, 27 Feb 2013 07:12:16 +0000 (16:12 +0900)]
nx-match: Correct writing of value and length in set_field_to_ofast()

ofpbuf_put_* may reallocate the underlying buffer of the ofpbuf and
thus writing data after a ofpbuf_put_* call must write to memory
relative to the pointer returned by the call.

Prior to this change the length and trailing value would not be written to
the set_field action if ofpbuf_put_* may reallocated the underlying buffer.

Also make use of ofpbuf_put_zero() to avoid calling memset() directly.

Tested-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAUTHORS: Add Andy Zhou.
Ben Pfaff [Thu, 28 Feb 2013 17:55:23 +0000 (09:55 -0800)]
AUTHORS: Add Andy Zhou.

CC: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agopython: Do not include time stamp in syslog messages.
Andy Zhou [Thu, 28 Feb 2013 03:20:07 +0000 (19:20 -0800)]
python: Do not include time stamp in syslog messages.

vlog.py currently generates the same log messages, starts with the time stamp
information, for console, syslog and file. All messages start with current
time stamp information.

Syslogd, by default, prepends time stamp with each message already. Thus
the time stamp generated by vlog.py is redundant.

This patch removes time stamp from the message before vlog.py sends it
to syslogd.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotunnel: Only print non-default UDP dst_port for LISP/VXLAN tunnels
Kyle Mestery [Thu, 28 Feb 2013 14:30:16 +0000 (09:30 -0500)]
tunnel: Only print non-default UDP dst_port for LISP/VXLAN tunnels

In get_tunnel_config(), distinguish between VXLAN and LISP when deciding
whether or not to print UDP destination port. Only add the UDP
destination port for either protocol if it is not the default UDP port.
Update the LISP unit test to match the new behavior as well.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
[jesse: merge common test for VXLAN and LISP]
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto-dpif: Handle tunnel config changes in facet_revalidate().
Ethan Jackson [Wed, 27 Feb 2013 03:12:22 +0000 (19:12 -0800)]
ofproto-dpif: Handle tunnel config changes in facet_revalidate().

For most of the history of Open vSwitch, one could assume that a
given datapath flow key would consistently translate into the same
userspace struct flow representation.  However, with the switch to
flow based tunneling, we now have a situation where a database
configuration change can cause a datapath flow key's in_port to
correspond to a completely different OpenFlow in_port possibly on a
completely different bridge.  This can cause all sorts of problems,
including traffic black holes due to confused facet revalidations.

To solve the problem, this patch verifies that each facet's
subfacets still result in the appropriate struct flow.  If a facet
fails this test, it is simply removed.

Bug #15213.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Ignore subfacet install errors.
Ethan Jackson [Wed, 27 Feb 2013 23:44:06 +0000 (15:44 -0800)]
ofproto-dpif: Ignore subfacet install errors.

When we fail to install a subfacet, there's not much we can do
other than note that it happened.  However, doing this requires us
to maintain a pointer to a subfacet which theoretically could be
destroyed by facet_revalidate() later.  This patch solves the
problem by simply assuming dpif_flow_put() always succeeds.  This
should have no effect on behavior.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Always maintain subfacet key.
Ethan Jackson [Wed, 27 Feb 2013 04:10:46 +0000 (20:10 -0800)]
ofproto-dpif: Always maintain subfacet key.

Due to flow based tunneling, we can no longer assume that it's
possible to reconstruct a subfacet's key from its facet's flow.
The flow's in_port may be stale due to tunnel configuration
changes.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agotests: Add VXLAN and LISP tunnel tests to the unit test infrastructure.
Kyle Mestery [Wed, 27 Feb 2013 18:43:21 +0000 (13:43 -0500)]
tests: Add VXLAN and LISP tunnel tests to the unit test infrastructure.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodocumentation: Add instructions on how to run the unit test infrastructure.
Kyle Mestery [Wed, 27 Feb 2013 16:08:49 +0000 (11:08 -0500)]
documentation: Add instructions on how to run the unit test infrastructure.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Wed, 27 Feb 2013 09:01:41 +0000 (10:01 +0100)]
Merge branch 'mainstream'

11 years agoMerge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
Giuseppe Lettieri [Wed, 27 Feb 2013 09:01:28 +0000 (10:01 +0100)]
Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch

11 years agoget_mac subcommand in sliver-ovs
Giuseppe Lettieri [Wed, 27 Feb 2013 08:55:23 +0000 (09:55 +0100)]
get_mac subcommand in sliver-ovs

Retrieve the mac address of the local tap device attached to
a sliver-openvswitch bridge.

Replaces the temporary 'show_mac' workaround.

11 years agoofproto: Create and delete tnl_backers in type_run()
Kyle Mestery [Fri, 15 Feb 2013 22:12:13 +0000 (17:12 -0500)]
ofproto: Create and delete tnl_backers in type_run()

Garbage collect tnl_backers during type_run(). Add new
tnl_backers if a VXLAN port's UDP port changes.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoAdd support for LISP tunneling
Lorand Jakab [Fri, 22 Feb 2013 05:52:04 +0000 (21:52 -0800)]
Add support for LISP tunneling

LISP is an experimental layer 3 tunneling protocol, described in RFC
6830.  This patch adds support for LISP tunneling.  Since LISP
encapsulated packets do not carry an Ethernet header, it is removed
before encapsulation, and added with hardcoded source and destination
MAC addresses after decapsulation.  The harcoded MAC chosen for this
purpose is the locally administered address 02:00:00:00:00:00.  Flow
actions can be used to rewrite this MAC for correct reception.  As such,
this patch is intended to be used for static network configurations, or
with a LISP capable controller.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoovs-bugtool: Ability to collect number of logs through plugins.
Gurucharan Shetty [Wed, 20 Feb 2013 22:11:01 +0000 (14:11 -0800)]
ovs-bugtool: Ability to collect number of logs through plugins.

A new option "--log-days" recently added lets us to control the
number of rotated logs included in the debug bundle. This option
only works on log files defined inside the ovs-bugtool code.

This patch lets us to do the same with logs collected through plugins.

The example format inside a plugin is:
<files type="logs">
    /var/log/one
</files>

This will collect one, one.[1-x], one.[1-x].gz. Where 'x' is 20
by default and can be controlled by the option '--log-days' passed
to ovs-bugtool.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoofp-util: Remove prototype for unimplemented, misspelled function.
Ben Pfaff [Thu, 14 Feb 2013 06:16:12 +0000 (22:16 -0800)]
ofp-util: Remove prototype for unimplemented, misspelled function.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoAdd binary option for command outputs collected by ovs-bugtool
Shih-Hao Li [Fri, 22 Feb 2013 16:54:04 +0000 (08:54 -0800)]
Add binary option for command outputs collected by ovs-bugtool

Current ovs-bugtool collects command outputs as text strings.
Thus it reads the output by lines. For commands that generate
huge binary data, it becomes very inefficient to read the output.

The change here is to use a 1MB buffer to read binary data
instead of reading them by lines.

Signed-off-by: Shih-Hao Li <shihli@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agodebian: Remove openvswitch-ipsec dependency from dbg package.
Gurucharan Shetty [Thu, 21 Feb 2013 00:58:57 +0000 (16:58 -0800)]
debian: Remove openvswitch-ipsec dependency from dbg package.

The openvswitch-dbg package does not have any binaries from
openvswitch-ipsec package. So remove the dependency.

While trying to install a openvswitch-dbg package currently,
we are forced to install racoon and openvswitch-ipsec package
which is not really necessary.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoin-band: Use "internal" netdev type for local ports.
Ethan Jackson [Fri, 22 Feb 2013 03:13:16 +0000 (19:13 -0800)]
in-band: Use "internal" netdev type for local ports.

A bridge's local port always has type "internal", so opening it
with type "system" can't be correct.  This was causing upgrade
problems.  Specifically, in certain bridge topologies, if there was
a manager set force-reload-kmod would fail.  This is because the
local port netdev would open in the in-band code with type
"system", confusing the more important netdev_open() in
iface_create().

Bug #15067.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoovsdb: Fix typo in comment ("millseconds").
Ben Pfaff [Mon, 25 Feb 2013 18:05:08 +0000 (10:05 -0800)]
ovsdb: Fix typo in comment ("millseconds").

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoFAQ: Clarify that "--all" was added in version 1.8.
Ben Pfaff [Mon, 25 Feb 2013 17:27:52 +0000 (09:27 -0800)]
FAQ: Clarify that "--all" was added in version 1.8.

Reported-by: David Palma <palma@onesource.pt>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovxlan: new draft revision
Lorand Jakab [Mon, 25 Feb 2013 02:58:03 +0000 (18:58 -0800)]
vxlan: new draft revision

The VXLAN draft just got updated from -02 to -03, with no major changes.
Update documentation to reflect the change.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: fix the calculation of checksum for vlan header
Cong Wang [Sat, 23 Feb 2013 03:22:41 +0000 (19:22 -0800)]
datapath: fix the calculation of checksum for vlan header

In vlan_insert_tag(), we insert a 4-byte VLAN header _after_
mac header:

        memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN);
        ...
        veth->h_vlan_proto = htons(ETH_P_8021Q);
        ...
        veth->h_vlan_TCI = htons(vlan_tci);

so after it, we should recompute the checksum to include these 4 bytes.
skb->data still points to the mac header, therefore VLAN header is at
(2 * ETH_ALEN = 12) bytes after it, not (ETH_HLEN = 14) bytes.

This can also be observed via tcpdump:

         0x0000:  ffff ffff ffff 5254 005d 6f6e 8100 000a
         0x0010:  0806 0001 0800 0604 0001 5254 005d 6f6e
         0x0020:  c0a8 026e 0000 0000 0000 c0a8 0282

Similar for __pop_vlan_tci(), the vlan header we remove is the one
overwritten in:

memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN);

Therefore the VLAN_HLEN = 4 bytes after 2 * ETH_ALEN is the part
we want to sub from checksum.

Cc: David S. Miller <davem@davemloft.net>
Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Increase maximum allocation size of action list.
Pravin B Shelar [Sat, 23 Feb 2013 01:16:11 +0000 (17:16 -0800)]
datapath: Increase maximum allocation size of action list.

The switch to flow based tunneling increased the size of each output
action in the flow action list.  In extreme cases, this can result
in the action list exceeding the maximum buffer size.

This doubles the maximum buffer size to compensate for the increase
in action size.  In the common case, most allocations will be
less than a page and those uses kmalloc.  Therefore, for the majority
of situations, this will have no impact.

Bug #15203
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto-dpif: Look at the flow's ofproto when handling flow misses.
Justin Pettit [Fri, 22 Feb 2013 22:07:47 +0000 (14:07 -0800)]
ofproto-dpif: Look at the flow's ofproto when handling flow misses.

When handling flow misses, an attempt is made to group identical packets
together.  Before the single datapath, each OpenFlow port number was
unique, so the flow_equal() function was sufficient to check whether
packets are identical.  With the single datapath, the OpenFlow port
numbers are shared across bridges, so packets that arrive at the same
time and are identical other than their ingress port were being serviced
by the same ofproto instance.  This commit changes the duplicate flow
finding function to take the ofproto into account.

Bug #14934

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoRevert "match: Only print tp_src and tp_dst for TCP and UDP."
Justin Pettit [Fri, 22 Feb 2013 22:29:12 +0000 (14:29 -0800)]
Revert "match: Only print tp_src and tp_dst for TCP and UDP."

This reverts commit 9a9a690cc0bc07bb2a0fa01221492cdab61673e3.

This commit broke some unit tests, and I want to think about how to
address them.  I also noticed other fields we should also not print.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoSetting tag sliver-openvswitch-1.9.90-3 sliver-openvswitch-1.9.90-3
Thierry Parmentelat [Fri, 22 Feb 2013 18:09:51 +0000 (19:09 +0100)]
Setting tag sliver-openvswitch-1.9.90-3
pulled mainstream - amazingly this is still known as 1.9.90 despite the size of changes

11 years agomatch: Only print tp_src and tp_dst for TCP and UDP.
Justin Pettit [Fri, 22 Feb 2013 02:46:20 +0000 (18:46 -0800)]
match: Only print tp_src and tp_dst for TCP and UDP.

When printing a match, we would print "tp_src" and "tp_dst" if the
packet wasn't ICMPv4 or ICMPv6.  Unfortunately, this doesn't cover ARP.
This changes the check to only print those keys if the network protocol
is TCP or UDP.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agotunnel: set skb mark for IPsec tunnel packets
Ansis Atteka [Thu, 14 Feb 2013 00:48:46 +0000 (16:48 -0800)]
tunnel: set skb mark for IPsec tunnel packets

The new ovs-monitor-ipsec implementation will use skb marks in
IPsec policies. This patch will configure datapath to use these
skb marks for IPsec tunnel packets.

Issue: 14870
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: use skb_mark for route lookups
Ansis Atteka [Thu, 14 Feb 2013 00:43:24 +0000 (16:43 -0800)]
datapath: use skb_mark for route lookups

If IPsec policy uses skb mark, then we have to do route look up
with skb mark as well.

Issue: 14870
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoipsec: prepare IPsec for flow based tunneling
Ansis Atteka [Thu, 14 Feb 2013 01:13:54 +0000 (17:13 -0800)]
ipsec: prepare IPsec for flow based tunneling

This patch removes unused TNL_F_IPSEC flag.

Issue: 14870
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Remove CAPWAP tunneling support.
Pravin B Shelar [Tue, 19 Feb 2013 20:45:57 +0000 (12:45 -0800)]
datapath: Remove CAPWAP tunneling support.

The CAPWAP implementation is just the encapsulation format and
therefore really not the full protocol.  While there were some
uses of it (primarily hardware support and UDP transport).  But
these are most likely better provided by VXLAN.

Following patch removes CAPWAP tunneling support.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Fix parsing invalid LLC/SNAP ethertypes
Rich Lane [Fri, 8 Feb 2013 23:29:57 +0000 (15:29 -0800)]
datapath: Fix parsing invalid LLC/SNAP ethertypes

Before this patch, if an LLC/SNAP packet with OUI 00:00:00 had an ethertype
less than 1536 the flow key given to userspace in the upcall would contain the
invalid ethertype (for example, 3). If userspace attempted to insert a kernel
flow for this key it would be rejected by ovs_flow_from_nlattrs.

This patch allows OVS to pass the OFTest pktact.DirectBadLlcPackets.

Signed-off-by: Rich Lane <rlane@bigswitch.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Use nla_len() in queue_userspace_packet().
Jesse Gross [Tue, 19 Feb 2013 19:01:33 +0000 (11:01 -0800)]
datapath: Use nla_len() in queue_userspace_packet().

Commit e995e3df57ea4e27678bc0bea5eb30872994155b (Allow
OVS_USERSPACE_ATTR_USERDATA to be variable length.) introduced an
open coded version of nla_len() in queue_userspace_packet().  This
replaces it with the equivalent function call.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto-dpif: Receive special packets on patch ports.
Ethan Jackson [Sat, 16 Feb 2013 20:07:18 +0000 (12:07 -0800)]
ofproto-dpif: Receive special packets on patch ports.

Commit 0a740f48293 (ofproto-dpif: Implement patch ports in
userspace.) allowed special packets (i.e. LACP, CFM, etc) to be
sent on patch ports, but not received.  This patch implements the
logic required to receive special packets on patch ports.

Bug #15154.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoAllow OVS_USERSPACE_ATTR_USERDATA to be variable length.
Ben Pfaff [Sat, 16 Feb 2013 00:48:32 +0000 (16:48 -0800)]
Allow OVS_USERSPACE_ATTR_USERDATA to be variable length.

Until now, the optional OVS_USERSPACE_ATTR_USERDATA attribute had to be
exactly 64 bits long, if it was present.  However, 64 bits is not enough
space to associate as much information with a flow as would be convenient
for some userspace features now under development.  This commit generalizes
the attribute, allowing it to be any length.

This generalization is backward-compatible: if userspace only uses 64-bit
attributes, then it will not see any change in behavior.

CC: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodpif-linux: Fix byte-swapping direction in nl_msg_put_u16() call.
Ben Pfaff [Fri, 15 Feb 2013 19:24:27 +0000 (11:24 -0800)]
dpif-linux: Fix byte-swapping direction in nl_msg_put_u16() call.

OVS_TUNNEL_ATTR_DST_PORT expects a u16, tnl_cfg->dst_port is a be16, so
we want ntohs() instead of htons().

In practice htons() and ntohs() perform the same operation, so this does
not fix a real bug.

Found by sparse.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Call genlmsg_end in queue_userspace_packet
Rich Lane [Fri, 8 Feb 2013 23:29:56 +0000 (15:29 -0800)]
datapath: Call genlmsg_end in queue_userspace_packet

Without genlmsg_end the upcall message ends (according to nlmsg_len) after the
struct ovs_header.

Signed-off-by: Rich Lane <rlane@bigswitch.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoxenserver: Include ovs-bugtool in xenserver rpm.
Gurucharan Shetty [Fri, 15 Feb 2013 00:59:27 +0000 (16:59 -0800)]
xenserver: Include ovs-bugtool in xenserver rpm.

Currently we do not include ovs-bugtool in xenserver rpms.
This is because xen-bugtool provides the information required
to debug openvswitch. But xen-bugtool also provides a lot more
data that is not required for openvswitch debugging. This makes
the debug bundle quite huge.

Also, xen-bugtool takes a lot of time to collect the required
information.  For example, in my xenserver6.0.2 with 100 OVS
interfaces, 'xen-bugtool -y -s' takes 180 seconds to finish
creating a debug bundle with a size of 124M.

On the other hand, if we run a ovs-bugtool command of the form
'ovs-bugtool -y -s --log-days=10 --outfile bundle.tar.gz', it
takes 5 seconds to finish with a debug bundle size of 28M.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-bugtool: Remove unused code and nonrequired commands.
Gurucharan Shetty [Thu, 14 Feb 2013 20:42:26 +0000 (12:42 -0800)]
ovs-bugtool: Remove unused code and nonrequired commands.

There is some code that is unused and some commands whose
output we probably don't need to debug openvswitch issues.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-bugtool: Change the default output type.
Gurucharan Shetty [Thu, 14 Feb 2013 18:55:36 +0000 (10:55 -0800)]
ovs-bugtool: Change the default output type.

In my tests, I see that creating a tar.gz takes a lot less
time than creating a tar.bz2. The difference in compressed
size of the debug bundle is not much different when either
of the above is used. So, use tar.gz as the default debug
bundle type.

Test results in my setup:
For an uncompressed debug bundle size of 250MB(95% of it is log files),
bz2 takes 50 seconds whereas gz takes 8 seconds. xz took 90 seconds.
gz, bz2 and xz compressed the debug bundle into 144M, 139M and 131M
respectively.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-bugtool: Don't run a few ethtool commands on virtual devices.
Gurucharan Shetty [Thu, 14 Feb 2013 03:35:03 +0000 (19:35 -0800)]
ovs-bugtool: Don't run a few ethtool commands on virtual devices.

There can be a few hundred virtual interfaces in a hypervisor.
Some of the ethtool commands that we currently run on these devices
probably does not provide any extra information. So remove them
for tap and vif interfaces.

Also bump up the size limitation for CAP_NETWORK_STATUS. The
current value is quite low and a 50 MB limit pre-compression
does not add much to the overall size.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-bugtool: Ability to collect the number of rotated logs.
Gurucharan Shetty [Thu, 14 Feb 2013 03:17:42 +0000 (19:17 -0800)]
ovs-bugtool: Ability to collect the number of rotated logs.

A big reason for a large debug bundle size is the size of log
files. By default we collect 20 rotated logs for each logfile.
Most of the times we collect the debug bundle as soon as we
hit a bug. In such cases, we know that we need only one day's
worth of logs.

This patch adds an option, '--log-days' to ovs-bugtool wherein
we can specify how many days worth of rotated logs do we need
as part of the debug bundle.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-bugtool: Provide a separate capability to openvswitch logs.
Gurucharan Shetty [Wed, 13 Feb 2013 23:00:42 +0000 (15:00 -0800)]
ovs-bugtool: Provide a separate capability to openvswitch logs.

Currently we have a 50 MB size limitation for all logs. This looks
quite less because a single uncompressed log can be 50 MB which
will result in ovs-bugtool picking a single log.

While debugging issues related to openvswitch, it is important that
we have all logs related to openvswitch atleast. This patch provides
a new capability for openvswitch logs with no size limitation. This
should not be a problem since compression reduces the size of the logs
quite a bit.

Also increase the size limitation for the regular system logs to 200 MB.

A future commit adds an option '--log-days' to control the number of logs
that we collect.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agorhel, xenserver: Make logrotate daily and compress old logs.
Gurucharan Shetty [Wed, 13 Feb 2013 18:25:50 +0000 (10:25 -0800)]
rhel, xenserver: Make logrotate daily and compress old logs.

The default values can be different and usually comes from /etc/logrotate.conf.

For xenserver6.0.2, the values in /etc/logrotate.conf is daily and compress.
So this patch does not make any difference. But it does future proof against
any changes in xenserver in the future.

For rhel6.1, the values are weekly and un-compress.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agovxlan: Change dpif_backer->tnl backer to a "struct simap"
Kyle Mestery [Thu, 14 Feb 2013 14:37:28 +0000 (09:37 -0500)]
vxlan: Change dpif_backer->tnl backer to a "struct simap"

Move dpif_backer->tnl_backers from a "struct sset" to a
"struct simap". Store odp_port in the new map.  This will make it easier to
access the odp_port for future patches.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoModify dpif_linux_port_add() to set the destination port for VXLAN ports.
Kyle Mestery [Thu, 14 Feb 2013 14:37:26 +0000 (09:37 -0500)]
Modify dpif_linux_port_add() to set the destination port for VXLAN ports.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovxlan: Update netdev_vport_get_dpif_port() to support VXLAN port names
Kyle Mestery [Thu, 14 Feb 2013 14:37:25 +0000 (09:37 -0500)]
vxlan: Update netdev_vport_get_dpif_port() to support VXLAN port names

Modify netdev_vport_get_dpif_port() to return a name for
VXLAN ports which includes the destination UDP port number as a part of the
name.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovxlan: Add utility functions to the simap data structure.
Kyle Mestery [Thu, 14 Feb 2013 14:37:27 +0000 (09:37 -0500)]
vxlan: Add utility functions to the simap data structure.

Add utility functions to the simap structure. These are
used by future patches in this seris. The functions added are.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoOPENFLOW-1.1+: Fix character encoding issues.
Ben Pfaff [Thu, 14 Feb 2013 07:00:09 +0000 (23:00 -0800)]
OPENFLOW-1.1+: Fix character encoding issues.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoOPENFLOW-1.1+: Update.
Ben Pfaff [Thu, 14 Feb 2013 06:51:59 +0000 (22:51 -0800)]
OPENFLOW-1.1+: Update.

This drops items that are done and fixes some screwed-up encoding.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoFAQ: Add troubleshooting procedure and example.
Ben Pfaff [Thu, 14 Feb 2013 06:04:42 +0000 (22:04 -0800)]
FAQ: Add troubleshooting procedure and example.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Move 'orig_flow' from action_xlate_ctx to local variable.
Ben Pfaff [Wed, 13 Feb 2013 23:50:54 +0000 (15:50 -0800)]
ofproto-dpif: Move 'orig_flow' from action_xlate_ctx to local variable.

A comment said that this was necessary to silence a false-positive warning
from GCC 4.4.  However, it no longer triggers a warning for me, so enough
must have changed in the meantime to make GCC happy.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotests: Add test for Python version of long socket name workaround.
Ben Pfaff [Wed, 13 Feb 2013 19:21:20 +0000 (11:21 -0800)]
tests: Add test for Python version of long socket name workaround.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agotests: Make long name more readable by introducing a shell variable.
Ben Pfaff [Wed, 16 Jan 2013 17:23:08 +0000 (09:23 -0800)]
tests: Make long name more readable by introducing a shell variable.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agotests: Make test for Linux /proc/self/fd more straightforward.
Ben Pfaff [Wed, 16 Jan 2013 17:22:06 +0000 (09:22 -0800)]
tests: Make test for Linux /proc/self/fd more straightforward.

Presumably we can test for this Linux feature just by seeing whether the
directory is there.

Another goal is to shorten the code because I intend to make another copy
of it in an upcoming commit, to add a similar test for Python.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Reduce number of get_ofp_port() calls during flow xlate.
Ben Pfaff [Tue, 12 Feb 2013 23:56:10 +0000 (15:56 -0800)]
ofproto-dpif: Reduce number of get_ofp_port() calls during flow xlate.

Until now the flow translation code has done one get_ofp_port() call
initially to check for special processing, then one for each level of
action processing.  Only one call is actually necessary, though, because
the in_port of a flow doesn't change in ordinary circumstances, and so this
commit eliminates the unnecessary calls.

The one case where the in_port can change is when a packet passes through
a patch port.  The implementation here was buggy anyway: when the patch
port's peer had forwarding disabled by STP, then the code would drop all
ODP actions, even those that were executed before the packet crossed the
patch port.  This commit fixes that case.

With a complicated flow table involving multiple levels of resubmit, this
increases flow setup performance by 2-3%.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoofp-msgs: ensure that l2 is set in ofpmp_reserve()
Ben Pfaff [Tue, 12 Feb 2013 23:49:12 +0000 (15:49 -0800)]
ofp-msgs: ensure that l2 is set in ofpmp_reserve()

Ensure that the buffer returned by ofpmp_reserve() has buf->l2 set
as this may be required by nxm_reg_load_to_nxast() when generating
the reply to an stats request

This problem was observed when dumping a large number of flows
with set_field actions using ovs-ofctl dump-flows.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Co-authored-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoovs-ctl.in: Don't execute the restore ofport script in some cases.
Gurucharan Shetty [Tue, 12 Feb 2013 17:29:55 +0000 (09:29 -0800)]
ovs-ctl.in: Don't execute the restore ofport script in some cases.

While upgrading from openvswitch1.10, we need not restore ofports
across force-reload-kmod.

This patch fixes a bug wherein 'force-reload-kmod' command
tried to execute an empty script that did not have '+x' in
file permissions.

Bug #15067
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoRevert "vswitchd: Require "target" column to be unique in OVS database."
Ben Pfaff [Tue, 12 Feb 2013 19:38:05 +0000 (11:38 -0800)]
Revert "vswitchd: Require "target" column to be unique in OVS database."

This reverts commit 41219e63a02bd315e7066145d72798f7a4204566.

In fact, the "target" column cannot be made unique within the
Controller table, because different bridges are allowed to have
the same target.  OVSDB does not have a way to express this
constraint, so it must be omitted entirely.

Reported-by: Saul St. John <sstjohn@cs.wisc.edu>
CC: Natasha Gude <natasha@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoMake OpenFlow 1.2+ role replies return the generation ID.
Ben Pfaff [Tue, 12 Feb 2013 08:00:42 +0000 (00:00 -0800)]
Make OpenFlow 1.2+ role replies return the generation ID.

OpenFlow extensibility working group issue EXT-272 clarifies the use of
the generation_id in role reply messages as used for the current generation
ID or all-1-bits if there is no current generation ID.  This commit
implements EXT-272 in Open vSwitch.

Unfortunately the full text of EXT-272 is not available freely online.
(The "open" part of the Open Networking Foundation is the network, not
the foundation)

EXT-272.
CC: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>