]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
12 years agoofproto: Fix typo in macro name.
Ben Pfaff [Fri, 12 Oct 2012 20:18:41 +0000 (13:18 -0700)]
ofproto: Fix typo in macro name.

I like the sound of "evicton" but it isn't a real word.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoofproto: Do not add flow on flow mod if new_cookie is UINT64_MAX
Simon Horman [Fri, 12 Oct 2012 00:26:28 +0000 (09:26 +0900)]
ofproto: Do not add flow on flow mod if new_cookie is UINT64_MAX

Internally a new_cookie value UINT64_MAX is used for
an OpenFlow 1.2 flow mod whose command is not Add.
Open Flow 1.2 does not permit adding flows for such commands.
Also, UINT64_MAX is a prohibited cookie value, and the
existing code created a flow with that value as for the cookie.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-print: Do not display flow mod cookie if it is UINT64_MAX
Simon Horman [Fri, 12 Oct 2012 00:26:29 +0000 (09:26 +0900)]
ofp-print: Do not display flow mod cookie if it is UINT64_MAX

Internally UINT64_MAX is used to denote that the cookie
should not be changed, so it seems appropriate
to omit this value when pretty printing flow mods.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-util: Correct setting of Flow Mod cookie on encode
Simon Horman [Fri, 12 Oct 2012 00:26:27 +0000 (09:26 +0900)]
ofp-util: Correct setting of Flow Mod cookie on encode

When the command of a Flow Mod messages is ADD the cookie should be set as
fm->new_cookie, this is the new cookie value to be set. Otherwise it
should be set as fm->cookie, internally this is the cookie value to match.

Also remove 'XXX' marker from the matching code in the decoder.
I am now comfortable with the implementation.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-msgs: Open Flow 1.1 and 1.2 Queue Status Messages
Simon Horman [Fri, 12 Oct 2012 04:03:04 +0000 (13:03 +0900)]
ofp-msgs: Open Flow 1.1 and 1.2 Queue Status Messages

This allows for encoding and decoding Open Flow 1.1 and 1.2 Queue Stats
Request and Reply messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-util: Correct comment above ofputil_append_port_stat()
Simon Horman [Fri, 12 Oct 2012 04:01:05 +0000 (13:01 +0900)]
ofp-util: Correct comment above ofputil_append_port_stat()

This function changed a few times before it was merged,
unfortunately at some point the comment wasn't kept in sync
with the changes.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-msgs: Update for OpenFlow 1.1 & 1.2 Port Desc Stats
Simon Horman [Fri, 12 Oct 2012 04:00:38 +0000 (13:00 +0900)]
ofp-msgs: Update for OpenFlow 1.1 & 1.2 Port Desc Stats

* Split OFPRAW_OFPST_PORT_DESC_REPLY into OpenFlow 1.0
  and OpenFlow 1.1+ versions.
* Allow OFPRAW_OFPST_PORT_DESC_REQUEST to be used for
  OpenFlow 1.0+ instead of only OpenFlow 1.0.

This appears to be necessary and sufficient to allow encoding of Port Desc
Stats reply messages and decoding of Port Desc Stats request messages. Or
in other words both the client and server side of ovs-ofctl dump-ports-desc

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoUse enum ofperr in ofputil_decode_flow_removed()
Simon Horman [Fri, 12 Oct 2012 00:24:34 +0000 (09:24 +0900)]
Use enum ofperr in ofputil_decode_flow_removed()

The return type of both ofputil_decode_flow_removed() and nx_pull_match()
is enum ofperr so it makes sense for error be of that type too.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agolib: Use FreeBSD libc function for proctitle
Ed Maste [Thu, 11 Oct 2012 20:58:17 +0000 (20:58 +0000)]
lib: Use FreeBSD libc function for proctitle

FreeBSD libc's setproctitle provides the same interface as proctitle_set so
use it directly.

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agolib: Move addition of program_name to proctitle_set
Ed Maste [Thu, 11 Oct 2012 20:49:38 +0000 (20:49 +0000)]
lib: Move addition of program_name to proctitle_set

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agonicira-ext: Correct and improve nx_flow_update_abbrev comment.
Ben Pfaff [Thu, 11 Oct 2012 17:56:12 +0000 (10:56 -0700)]
nicira-ext: Correct and improve nx_flow_update_abbrev comment.

Notifications always precede a barrier that follows a given flow_mod,
not a barrier that precedes a flow_mod as the text here previously claimed.

Also, the text about abbreviated notifications is equally applicable
to normal, unabbreviated notifications, so say that explicitly.

Reported-by: Jean Tourrilhes <jt@hpl.hp.com>
Acked-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-msgs: Open Flow 1.1 and 1.2 Port Status Messages
Simon Horman [Sat, 6 Oct 2012 10:39:49 +0000 (19:39 +0900)]
ofp-msgs: Open Flow 1.1 and 1.2 Port Status Messages

This allows for encoding and decoding Open Flow 1.1 and 1.2 Port Stats
Request and Reply message

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com added ofputil_count_port_stas(), simplified
 interface of ofputil_decode_port_stats(), style changes]
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoMakefile.am: Distribute INSTALL.Fedora.
Ben Pfaff [Wed, 10 Oct 2012 17:09:12 +0000 (10:09 -0700)]
Makefile.am: Distribute INSTALL.Fedora.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agobuild: Add support for building RPMs for Fedora Linux
Ralf Spenneberg [Tue, 2 Oct 2012 18:31:55 +0000 (14:31 -0400)]
build: Add support for building RPMs for Fedora Linux

Add RPM specfiles for building OVS for Fedora Linux. This
allows users of the upstream project the ability to
generate RPMs for their Open vSwitch needs.

Signed-off-by: Ralf Spenneberg <ralf@spenneberg.net>
[kmestery@cisco.com made substantial changes including
 writing documentation]
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Allow GRE64 tunnels without any key.
Pravin B Shelar [Wed, 10 Oct 2012 00:13:05 +0000 (17:13 -0700)]
datapath: Allow GRE64 tunnels without any key.

Now GRE64 deals with tunnel with no key and tunnel with zero key
as a same. This behaviour is different than standard GRE.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodatapath: Fix GRE tunnel without any key.
Pravin B Shelar [Tue, 9 Oct 2012 23:08:39 +0000 (16:08 -0700)]
datapath: Fix GRE tunnel without any key.

Commit 2de795adb96 (datapath: 64-bit GRE support) introduced a bug
for tunnels with no key. Following patch fixes it by setting tunnel
type to GRE type.

Bugs: 13511
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agoconfig: Add explicit support for building on ESX.
Ethan Jackson [Fri, 5 Oct 2012 20:24:21 +0000 (13:24 -0700)]
config: Add explicit support for building on ESX.

The ESX userspace looks quite a bit like linux, but has some key
differences which need to be specially handled in the build.  To
distinguish between ESX and systems which use the linux datapath
module, this patch adds two new macros "ESX" and "LINUX_DATAPATH".
It uses these macros to disable building code on ESX which only
applies to a true Linux environment.  In addition, it adds a new
route-table-stub implementation which is required for the build to
complete successfully on ESX.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agodatapath: 64-bit GRE support
Pravin B Shelar [Sat, 6 Oct 2012 00:55:02 +0000 (17:55 -0700)]
datapath: 64-bit GRE support

Extend GRE to have a 64-bit key. Use GRE sequence number to
store upper 32-bits of the key, but this is not standard way of
using GRE sequence number.

Bug #13186
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agotimeval: Recover from failed timer_create() calls.
Ethan Jackson [Fri, 5 Oct 2012 01:38:59 +0000 (18:38 -0700)]
timeval: Recover from failed timer_create() calls.

The timer_create() system call is not supported in ESX and returns
an error when called.  Aborting when this system call fails seems a
bit extreme. So instead, this patch simply falls back to disabling
the cached time optimization.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agotimeval: Don't require signals for time_alarm().
Ethan Jackson [Fri, 5 Oct 2012 00:57:16 +0000 (17:57 -0700)]
timeval: Don't require signals for time_alarm().

Before this patch, time_alarm() used the SIGALRM handler to notify
the poll loop that it should exit the program.  Instead, this patch
simply implements time_alarm() directly in the pool loop.  This
significantly simplifies the code, while removing a call to
timer_create() which is not currently supported on ESX.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agoofproto-dpif: Avoid zeroing tunnel info in handle_miss_upcalls().
Ben Pfaff [Thu, 4 Oct 2012 22:11:39 +0000 (15:11 -0700)]
ofproto-dpif: Avoid zeroing tunnel info in handle_miss_upcalls().

Commit 296e07ace0f (flow: Extend struct flow to contain tunnel outer
header.) changed the tunnel ID parameter of flow_extract() from an integer
passed by value to a structure passed by pointer.  Before flow_extract()
reads the tunnel ID, it zeros the entire flow parameter.  This means that,
if a caller passes the address of the tunnel member of the flow as the
tunnel ID, then flow_extract() zeros the tunnel data before it reads and
copies the tunnel data (that it just zeroed).  The result is that the
tunnel data is ignored.

This commit fixes the problem by making the caller that did this use a
separate flow structure instead of trying to be clever.

Bug #13461.
CC: Pankaj Thakkar <thakkar@nicira.com>
Reported-by: Michael Hu <mhu@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoovsdb/jsonrpc-server: ovsdb-server closes accepted connections immediately.
Mehak Mahajan [Thu, 4 Oct 2012 19:33:05 +0000 (12:33 -0700)]
ovsdb/jsonrpc-server: ovsdb-server closes accepted connections immediately.

2012-09-14T05:38:26Z|00001|jsonrpc|WARN|tcp:127.0.0.1:6634: receive error: Con
ovsdb-client: transaction failed (Connection reset by peer)
NOTE: This occurs intermittently depending on how ovsdb-server runs.
      Running ovsdb-client on a remote machine increases the possibility.

This is because ovsdb-server closes newly accepted tcp connection.
The following changesets caused it. struct jsonrpc_session::dscp isn't set
based on listening socket's dscp value.
- ovsdb-server creates passive connection and listens on it.
- ovsdb-server accepts connection by ovsdb_jsonrpc_server_run().
  The accepted socket inherits from the listening sockets.
  ovsdb_jsonrpc_server_run() creates json session, but leaves dscp of
  struct jsonrpc_session zero.
- On calling reconfigure_from_db(), it resets dscp value to
  all jsonrpc sessions. Eventually jsonrpc_session_set_dscp() is called.
  Then jsonrpc_session_force_reconnect() closes the connection.

With this patch,
- struct jsonrpc_session::dscp is correctly set based on
  listening sockets dscp value.
- dscp of listening socket is changed dynamically by setsockopt.
  This leaves a window where accepted socket may have old dscp.
  But it is ignored for now because it would complicates codes
  too much.

The related change sets:
0442efd9b1a88d923b56eab6b72b6be8231a49f7
  Reapplying the dscp changes: No need to restart DB/OVS on changing
  dscp value.
59efa47adf3234ec51541405726d033173851285
  Revert DSCP update changes.
b2e18db292cd4962af3248f11e9f17e6eaf9c033
  No need to restart DB / OVS on changing dscp value.
f125905cdd3dc0339ad968c0a70128807884b400
  Allow configuring DSCP on controller and manager connections.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
12 years agoAvoid requiring autom4te when it won't necessarily be needed.
Ben Pfaff [Thu, 4 Oct 2012 22:55:43 +0000 (15:55 -0700)]
Avoid requiring autom4te when it won't necessarily be needed.

Commit 7fd3e43db07 (tests: Allow environment specified autom4te.) added a
requirement for Autom4te without anyone noticing it in advance.  This
caused a build failure in the XenServer DDK, which doesn't have Autom4te.
Since Autom4te is only needed if the testsuite is modified, this commit
makes it optional.

(Autom4te is part of Autoconf.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoFix vswitch-idl.ovsidl build rule with separate source and build dirs.
Ben Pfaff [Thu, 4 Oct 2012 22:53:14 +0000 (15:53 -0700)]
Fix vswitch-idl.ovsidl build rule with separate source and build dirs.

Before commit e3a880272 (lib: Specify idl location more precisely.), the
files named in VSWITCH_IDL_FILES were relative to the source directory.
That commit made them inconsistent: one remained relative to the source
directory, the other became relative to the build directory.  This meant
that if the source and build directories differed, the ovsdb-idlc
invocation had no change of succeeding.

This commit fixes the problem by making the file names consistently
relative to the build directory and then adjusting the ovsdb-idlc
invocation to expect that.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agodatapath: Print device when warning about over MTU packets.
Jesse Gross [Thu, 4 Oct 2012 20:34:36 +0000 (13:34 -0700)]
datapath: Print device when warning about over MTU packets.

If an attempt is made to transmit a packet that is over the device's
MTU then we log it using the datapath's name.  However, it is much
more helpful to use the device name instead.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agotests: Allow environment specified autom4te.
Ethan Jackson [Wed, 3 Oct 2012 22:58:54 +0000 (15:58 -0700)]
tests: Allow environment specified autom4te.

In the ESX build system, autom4te is in a funny location specified
by an environment variable.  Before this patch, this environment
variable was overridden by the tests automake file.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agolib: Specify idl location more precisely.
Ethan Jackson [Wed, 3 Oct 2012 22:58:27 +0000 (15:58 -0700)]
lib: Specify idl location more precisely.

For some reason, the ESX build tools seem to be confused about the
location of 'lib'.  This patch specifies it more directly.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agoofp-util: Set Packet In Format: Use prevailing OpenFlow version
Simon Horman [Thu, 4 Oct 2012 02:41:16 +0000 (11:41 +0900)]
ofp-util: Set Packet In Format: Use prevailing OpenFlow version

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoflow: Fix struct flow size build assertion failure.
Jesse Gross [Wed, 3 Oct 2012 18:29:05 +0000 (11:29 -0700)]
flow: Fix struct flow size build assertion failure.

The new struct flow_tnl contains an extra four bytes of padding on
64-bit machines but we currently assert that the total struct flow
is a fixed size.  The size difference isn't actually a problem
because both are multiples of 4 and the build assertion is only
intended to remind people to update FLOW_WC_SEQ when new fields are
added.  This changes the assertion to fix just the non-tunnel field
size.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
12 years agoflow: Extend struct flow to contain tunnel outer header.
Jesse Gross [Fri, 14 Sep 2012 03:11:08 +0000 (20:11 -0700)]
flow: Extend struct flow to contain tunnel outer header.

Soon the kernel will begin supplying the information about the outer
IP header for tunneled packets and userspace will need to be able to
track it as part of the flow.  For the time being this is only used
internally by OVS and not exposed outwards to OpenFlow.  As a result,
this threads the information throughout userspace but simply stores
the existing tun_id in it.

Signed-off-by: Jesse Gross <jesse@nicira.com>
12 years agotests: jemalloc debug config for FreeBSD 9 and 10.
Ed Maste [Tue, 2 Oct 2012 15:45:23 +0000 (15:45 +0000)]
tests: jemalloc debug config for FreeBSD 9 and 10.

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agotests: Also enable FreeBSD libc debugging
Ed Maste [Mon, 1 Oct 2012 21:11:31 +0000 (21:11 +0000)]
tests: Also enable FreeBSD libc debugging

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agotests: Enable glibc malloc debugging features in testsuite.
Ben Pfaff [Mon, 1 Oct 2012 20:37:57 +0000 (13:37 -0700)]
tests: Enable glibc malloc debugging features in testsuite.

I don't know of a reason not to use these features for testing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agoovs-ctl: Add support for glibc malloc debugging.
Ben Pfaff [Mon, 1 Oct 2012 20:37:47 +0000 (13:37 -0700)]
ovs-ctl: Add support for glibc malloc debugging.

Unlike valgrind, glibc's built-in features for malloc debugging are cheap
enough that one can run with them enabled all the time, at least in test
scenarios.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agoFAQ: Describe how bonded ports interact with OpenFlow.
Ben Pfaff [Mon, 1 Oct 2012 20:22:35 +0000 (13:22 -0700)]
FAQ: Describe how bonded ports interact with OpenFlow.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoofp-util: Use table_id in OF1.1 and OF1.2 Flow Remove Messages
Simon Horman [Mon, 1 Oct 2012 07:51:49 +0000 (16:51 +0900)]
ofp-util: Use table_id in OF1.1 and OF1.2 Flow Remove Messages

Previously this field was ignored on decode and
set to zero on encode

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com changed "missing" value, removed OFPTT_ALL]
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto: Add del-flow based on table-id tests
Simon Horman [Mon, 1 Oct 2012 07:24:21 +0000 (16:24 +0900)]
ofproto: Add del-flow based on table-id tests

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agolib: Add xpipe_nonblocking helper
Ed Maste [Fri, 28 Sep 2012 21:06:41 +0000 (21:06 +0000)]
lib: Add xpipe_nonblocking helper

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-actions: Add parsing of set_field actions
Simon Horman [Fri, 28 Sep 2012 05:59:10 +0000 (14:59 +0900)]
ofp-actions: Add parsing of set_field actions

Based heavily on work by Isaku Yamahata <yamahata@valinux.co.jp>

Cc: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com adjusted documentation, added test]
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto: Rationalise comments in handle_flow_mod().
Simon Horman [Fri, 28 Sep 2012 06:07:08 +0000 (15:07 +0900)]
ofproto: Rationalise comments in handle_flow_mod().

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoidl: Optionally warn when writing to read-write columns.
Ethan Jackson [Thu, 20 Sep 2012 18:13:15 +0000 (11:13 -0700)]
idl: Optionally warn when writing to read-write columns.

ovs-vswitchd should only write to write-only columns.  Furthermore,
writing to a column which is not write-only can cause serious
performance degradations.  This patch causes ovs-vswitchd to log
and reject writes to read-write columns.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agopython/ovs/db/idl: getattr(Row) raises TypeError, not AttributeError.
Isaku Yamahata [Thu, 27 Sep 2012 09:29:45 +0000 (18:29 +0900)]
python/ovs/db/idl: getattr(Row) raises TypeError, not AttributeError.

In some cases getattr(Row instance, attrname) doesn't raise AttributeError,
but TypeError

> File "python/ovs/db/idl.py", line 554, in __getattr__
>     datum = self._data[column_name]
> TypeError: 'NoneType' object has no attribute '__getitem__'

So getattr(Row instance, attrname, default value) doesn't work.
This occurs when row._changes doesn't include attrname and row._data is None.
So teach Row.__getattr__ _data=None case.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agopstream: Add set_dscp method.
Isaku Yamahata [Thu, 27 Sep 2012 02:18:16 +0000 (11:18 +0900)]
pstream: Add set_dscp method.

Introduce set_dscp method to pstream.
This will be used by dynamic dscp change of listening socket.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agosocket-util: export set_dscp()
Isaku Yamahata [Wed, 26 Sep 2012 07:12:06 +0000 (16:12 +0900)]
socket-util: export set_dscp()

It will be used later for dynamic dscp change to listening socket.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agostream-provider: remove stale declaration of stream_set_dscp()
Isaku Yamahata [Wed, 26 Sep 2012 07:12:05 +0000 (16:12 +0900)]
stream-provider: remove stale declaration of stream_set_dscp()

It isn't defined anywhere.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodpif-netdev: Remove unneeded 'key' parameter from dp_netdev_flow_used().
Ben Pfaff [Wed, 26 Sep 2012 17:02:40 +0000 (10:02 -0700)]
dpif-netdev: Remove unneeded 'key' parameter from dp_netdev_flow_used().

The 'key' passed to dp_netdev_flow_used() is the same as the 'key' member
in the struct dp_netdev_flow also passed to the function.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoofproto-dpif: Report in trace "output" if an "output" action is ignored.
Ben Pfaff [Wed, 26 Sep 2012 16:59:21 +0000 (09:59 -0700)]
ofproto-dpif: Report in trace "output" if an "output" action is ignored.

This would have saved some time and puzzlement earlier today.

Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoDeprecate referring to ports by name in ovs-ofctl.
Ben Pfaff [Wed, 26 Sep 2012 16:57:28 +0000 (09:57 -0700)]
Deprecate referring to ports by name in ovs-ofctl.

This is a necessary step toward supporting full 32-bit OF1.1+ port numbers
in a later version of OVS.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoofp-actions: Add support for OpenFlow 1.2 "set-field" action.
Isaku Yamahata [Mon, 24 Sep 2012 20:11:11 +0000 (13:11 -0700)]
ofp-actions: Add support for OpenFlow 1.2 "set-field" action.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com extracted this code from a larger patch by above, so:]
Signed-off-by: Ben Pfaff <blp@nicira.com>
[regarding final version of patch:]
Reviewed-by: Simon Horman <horms@verge.net.au>
12 years agoofp-actions: Allow OF1.1+ actions to be variable-length.
Ben Pfaff [Mon, 24 Sep 2012 20:18:38 +0000 (13:18 -0700)]
ofp-actions: Allow OF1.1+ actions to be variable-length.

Previously there was no need for this, because all implemented standard
OpenFlow actions had a fixed length, but the OF1.2 "set-field" action (soon
to be implemented) is variable length.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
12 years agoofp-actions: Prepare to treat OF1.2 actions as OF1.1 actions.
Ben Pfaff [Tue, 25 Sep 2012 17:23:38 +0000 (10:23 -0700)]
ofp-actions: Prepare to treat OF1.2 actions as OF1.1 actions.

The numbering of OpenFlow 1.0 actions overlaps with the numbering
of OpenFlow 1.1+ actions, so the two sets of actions have to be
distinguished for input and output.  But OpenFlow 1.1 and 1.2
actions are numbered to avoid this problem, so there is no need
to distinguish them in the same way.  Therefore, this commit
prepares to treat them together.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
12 years agoopenflow-1.2: Remove OFPAT12_* definitions that duplicate OFPAT11_* ones.
Ben Pfaff [Mon, 24 Sep 2012 20:11:37 +0000 (13:11 -0700)]
openflow-1.2: Remove OFPAT12_* definitions that duplicate OFPAT11_* ones.

OpenFlow 1.1 and 1.2 action numbering is compatible, in that no
OpenFlow 1.2 action uses an OpenFlow 1.1 action number in a different
way from OpenFlow 1.1.  So it's confusing and unnecessary to have
separate definitions for these numbers.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
12 years agopackets: Add ECN constants.
Jesse Gross [Wed, 19 Sep 2012 16:36:19 +0000 (09:36 -0700)]
packets: Add ECN constants.

Upcoming tunnel code will be able to handle ECN encapsulation/
decapsulation in userspace.  This adds the necessary constants for ECN
manipulation.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agonetdev-vport: Fix ToS/TTL mixup in unparsing.
Jesse Gross [Tue, 25 Sep 2012 20:22:08 +0000 (13:22 -0700)]
netdev-vport: Fix ToS/TTL mixup in unparsing.

When unparsing the kernel tunnel configuration, TTL was incorrectly
converted to "tos".  Although it leads to confusing configuration
output, actual operation is not affected.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agoovsdb-server: Add support for multiple databases.
Ben Pfaff [Fri, 7 Sep 2012 17:07:03 +0000 (10:07 -0700)]
ovsdb-server: Add support for multiple databases.

The OVSDB protocol has supported multiple databases for a long time, but
the ovsdb-server implementation only supported one database at a time.
This commit adds support for multiple databases.

Feature #12353.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoovsdb-server: Add --enable-dummy option for unit tests.
Ben Pfaff [Fri, 21 Sep 2012 18:16:34 +0000 (11:16 -0700)]
ovsdb-server: Add --enable-dummy option for unit tests.

This will allow an upcoming unit test to use the "time/warp" ovs-appctl
command with ovsdb-server.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoovsdb-server: Fix null pointer deref when bool "is_connected" is empty.
Ben Pfaff [Fri, 21 Sep 2012 18:12:39 +0000 (11:12 -0700)]
ovsdb-server: Fix null pointer deref when bool "is_connected" is empty.

The ovsdb-server supports obtaining its remote connection targets from a
database table and updating that table with connection status information.
One of the supported connection status columns is a boolean column named
"is_connected".  The code in ovsdb-server blindly assigned a bool into
this column without checking that it actually had space allocated for one.
This was and is fine with the ovs-vswitchd schema, which always has exactly
one value in this column.  However, if a database schema makes this column
optional, and there are actually no values in it, then this assignment
dereferences a null pointer.

This commit fixes the problem by allocating space for a bool if none has
yet been allocated.

Noticed while adding an extra test for the connection status feature.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoovsdb-client: Make "list-dbs" print the list of databases in sorted order.
Ben Pfaff [Thu, 6 Sep 2012 18:11:45 +0000 (11:11 -0700)]
ovsdb-client: Make "list-dbs" print the list of databases in sorted order.

This makes the command's behavior more predictable when there is more than
one database.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoovsdb-client: Use svec instead of sset for list of database.
Ben Pfaff [Thu, 6 Sep 2012 18:11:12 +0000 (11:11 -0700)]
ovsdb-client: Use svec instead of sset for list of database.

This will make it easier to print a list of databases in sorted order,
which will happen in a followup commit.

This commit should have no effect on visible OVS behavior.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoovs-lib: Move DAEMON_CWD initialization to top of file.
Ben Pfaff [Thu, 6 Sep 2012 23:20:17 +0000 (16:20 -0700)]
ovs-lib: Move DAEMON_CWD initialization to top of file.

All the other variables are initialized at the top and I don't see a reason
that this variable is special.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoovsdb-tool: Fix indentation in manpage.
Ben Pfaff [Thu, 6 Sep 2012 23:15:18 +0000 (16:15 -0700)]
ovsdb-tool: Fix indentation in manpage.

This paragraph is about show-log so it should be indented the same as the
other paragraph about show-log.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agounixctl: Fix comment on unixctl_command_register().
Ben Pfaff [Thu, 6 Sep 2012 22:41:11 +0000 (15:41 -0700)]
unixctl: Fix comment on unixctl_command_register().

The arguments to the callback were changed some time ago but the comment
still described the older form.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoflow: Only show IPv4 flow information for IPv4 flows
Simon Horman [Fri, 21 Sep 2012 00:26:43 +0000 (09:26 +0900)]
flow: Only show IPv4 flow information for IPv4 flows

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto: Fix uninitialized field in ofputil_flow_update.
Anupam Chanda [Thu, 20 Sep 2012 17:35:52 +0000 (10:35 -0700)]
ofproto: Fix uninitialized field in ofputil_flow_update.

Two instances of ofputil_flow_update had the priority field uninitialized.
This would cause flow updates to contain undefined priority values.

This bug was introduced by commit 81a76618 (classifier: Break cls_rule
'flow' and 'wc' members into new "struct match".)

Signed-off-by: Anupam Chanda <achanda@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agobridge: Omit alerts on the cfm_remote_opstate column.
Ethan Jackson [Thu, 20 Sep 2012 02:21:06 +0000 (19:21 -0700)]
bridge: Omit alerts on the cfm_remote_opstate column.

This column should be write only, otherwise every call to update it
has to make a trip to the database.  Since this column is updated
every time through the run loop as part of refresh_instant_stats(),
this patch fixes a significant performance degradation.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agoovs-ofctl: Accept port keywords, OF1.1 port numbers, reject port number 0.
Ben Pfaff [Thu, 20 Sep 2012 15:40:29 +0000 (08:40 -0700)]
ovs-ofctl: Accept port keywords, OF1.1 port numbers, reject port number 0.

OpenFlow 1.0 has special reserved ports in the range 0xfff8 to 0xffff.
OpenFlow 1.1 and later has the same ports in the range 0xfffffff8 to
0xffffffff and allows the OF1.0 range to be used for ordinary ("physical")
switch ports.  This means that, naively, the meaning of a port number in
the range 0xfff8 to 0xffff given on the ovs-ofctl command line depends on
the protocol in use.  This commit implements something a little smarter:

    - Accept keyword names (e.g. LOCAL) for special reserved ports
      everywhere that such a port can plausibly be used (previously they
      were only accepted in some places).

    - Translate 0xfff8...0xffff to 0xfffffff8...0xffffffff for now, since
      OF1.1+ isn't in widespread use and those particular ports aren't
      likely to be in use in OF1.1+ anyway.

    - Log warnings about those ports when they are specified by number, to
      allow users to fix their invocations.

Also:

    - Accept the OF1.1+ port numbers for these ports, without warning, for
      compatibility with the upcoming OF1.1+ support.

    - Stop accepting port number 0, which has never been a valid port
      number in OpenFlow 1.0 and later.  (This required fixing some tests
      that inadvertently used this port number).

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Simon Horman <horms@verge.net.au>
12 years agoofp-actions: Improve explanation of 'compat' member in struct ofpact.
Ben Pfaff [Wed, 19 Sep 2012 22:38:29 +0000 (15:38 -0700)]
ofp-actions: Improve explanation of 'compat' member in struct ofpact.

Suggested-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Remove unecessary semicolon
Peter Senna Tschudin [Wed, 19 Sep 2012 00:09:46 +0000 (17:09 -0700)]
datapath: Remove unecessary semicolon

Found by http://coccinelle.lip6.fr/

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
12 years agojsonrpc: Fix Python implementation of inactivity logic.
Ben Pfaff [Fri, 14 Sep 2012 20:09:33 +0000 (13:09 -0700)]
jsonrpc: Fix Python implementation of inactivity logic.

When a JSON-RPC session receives bytes, or when it successfully sends
queued bytes, then it should count that as activity.  However, the code
here was reversed, in that it used the wrong check in each place.  That is,
when it tried to receive data, it would check whether data had just been
sent, and when it tried to send data, it would check whether data had just
been received.  Neither one makes sense and doesn't work.

Bug #13214.
Reported-by: Luca Giraudo <lgiraudo@nicira.com>
CC: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoFAQ: Describe difference between ovs-dpctl and ovs-ofctl "dump-flows".
Ben Pfaff [Tue, 18 Sep 2012 17:08:56 +0000 (10:08 -0700)]
FAQ: Describe difference between ovs-dpctl and ovs-ofctl "dump-flows".

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agodatapath: Add version info for out-of-tree modules.
Jesse Gross [Tue, 18 Sep 2012 01:32:57 +0000 (18:32 -0700)]
datapath: Add version info for out-of-tree modules.

The upstream version of the module always has the version of the running kernel
but for out-of-tree modules it can be difficult to tell the current version.
This adds the information to the module where it can be read using modinfo for
the on-disk version or from /sys/module/openvswitch/version for the currently
loaded module.

Suggested-by: Duffie Cooley <dcooley@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agostream-unix: Reduce connection failure log level from ERR to WARN.
Ben Pfaff [Mon, 17 Sep 2012 16:09:30 +0000 (09:09 -0700)]
stream-unix: Reduce connection failure log level from ERR to WARN.

Sometimes this just means that the daemon we're connecting to is
restarting.

Bug #13177.
Reported-by: Scott Hendricks <shendricks@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agotests: Fix sensitivity to record ordering in test-netflow output.
Ben Pfaff [Fri, 14 Sep 2012 20:04:15 +0000 (13:04 -0700)]
tests: Fix sensitivity to record ordering in test-netflow output.

The order of records in a NetFlow message is essentially random, but the
test case was picky about it.  I started getting failures when I modified
apparently unrelated code, so here's a fix.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoovs-ofctl: Fix indentation in manpage.
Ben Pfaff [Fri, 14 Sep 2012 18:19:36 +0000 (11:19 -0700)]
ovs-ofctl: Fix indentation in manpage.

This .RE (to reduce the current indentation level) needs to go after all
the actions, but it was mistakenly put before the fin_timeout action.

Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-actions: helper functions for of12 set-field action
Simon Horman [Fri, 14 Sep 2012 03:05:44 +0000 (12:05 +0900)]
ofp-actions: helper functions for of12 set-field action

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-util: Allow decoding of Open Flow 1.1 & 1.2 Table Statistics Request Messages
Simon Horman [Wed, 12 Sep 2012 04:47:27 +0000 (21:47 -0700)]
ofp-util: Allow decoding of Open Flow 1.1 & 1.2 Table Statistics Request Messages

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com then made substantial changes that were then:]
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agopython/ovs/db/idl.py: Transaction._substitute doesn't handle list/tuple
Isaku Yamahata [Thu, 13 Sep 2012 04:41:04 +0000 (13:41 +0900)]
python/ovs/db/idl.py: Transaction._substitute doesn't handle list/tuple

Since Transaction._substitute doesn't substitute elements of list/tuple,
setting list references results in transaction error. Teach it such case.

Example:
{"op": "update",
 "row":{"bridges":["set",[["uuid",
                           "1f42bc19-307f-42e7-a9c0-c12178bd8b51"],
                          ["uuid",
                           "f97e0c76-7146-489d-9bed-29bc704f65fe"]]]},
 "table": "Open_vSwitch",
 "where":[["_uuid", "==", ["uuid",
                           "20c2a046-ae7e-4453-a576-11034db24985"]]]}

In the above case, uuid in "row" aren't replaced by "named-uuid" because
the function doesn't look into elements of lists.
When list/tuple is found, look into elements recursively.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-actions: Right-justify the value in ofpact_reg_load 'subvalue' member.
Ben Pfaff [Wed, 12 Sep 2012 18:37:53 +0000 (11:37 -0700)]
ofp-actions: Right-justify the value in ofpact_reg_load 'subvalue' member.

This is what I intended when I suggested using mf_subvalue, but I didn't
notice the difference until after applying the patch.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Simon Horman <horms@verge.net.au>
12 years agopython/ovs/db/idl: make SchemaHelper accept schema in json form
Isaku Yamahata [Thu, 13 Sep 2012 02:27:30 +0000 (11:27 +0900)]
python/ovs/db/idl: make SchemaHelper accept schema in json form

This is needed when using schema that was retrieved from ovsdb by get_schema
method.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agopython/ovs/db/idl: add counterpart of ovsdb_idl_add_table()
Isaku Yamahata [Thu, 13 Sep 2012 02:22:53 +0000 (11:22 +0900)]
python/ovs/db/idl: add counterpart of ovsdb_idl_add_table()

Add register_table method to SchemaHelper as Python counterpart of
ovsdb_idl_add_table() in the C version of the IDL.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agopython/ovs: socket_util uses select.poll
Isaku Yamahata [Wed, 12 Sep 2012 06:17:21 +0000 (15:17 +0900)]
python/ovs: socket_util uses select.poll

The changeset of ed815d9bd28422a490fe370d7804d24bcd676806 eliminated
the use of select.poll for eventlet/gevent.
It forgot to select.poll in socket_util.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agolib/ofp-actions: use mf_subvalue in struct ofpact_reg_load.
Isaku Yamahata [Wed, 12 Sep 2012 08:44:28 +0000 (17:44 +0900)]
lib/ofp-actions: use mf_subvalue in struct ofpact_reg_load.

Use a uninion mf_subvalue instead of a uint64_t for
the value member of struct ofpact_reg_load.

set_field action needs to hold values wider than 64 bits.
This is preparation for set_field action.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoINSTALL: Recommend installing kernel modules with "make modules_install".
Ben Pfaff [Mon, 10 Sep 2012 17:13:07 +0000 (10:13 -0700)]
INSTALL: Recommend installing kernel modules with "make modules_install".

Reported-by: Valentin Bud <valentin@hackaserver.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agojsonrpc: Treat receiving part of a message as activity.
Ben Pfaff [Wed, 5 Sep 2012 20:34:35 +0000 (13:34 -0700)]
jsonrpc: Treat receiving part of a message as activity.

Until now, the jsonrpc code has only counted receiving a full JSON-RPC
messages as activity.  This could theoretically time out, then, while a
very long message is in transit or if a slow link is involved.  This commit
changes this code to count receiving any part of a message as activity.

This isn't a problem for OpenFlow connections because OpenFlow messages are
at most 64 kB in size.

This problem hasn't actually been observed in practice.

Bug #12789.
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agojsonrpc: Treat draining data from send queue as activity.
Ben Pfaff [Fri, 7 Sep 2012 17:50:15 +0000 (10:50 -0700)]
jsonrpc: Treat draining data from send queue as activity.

Until now, the jsonrpc module has used messages received from the
remote peer as the sole means to determine that the JSON-RPC
connection is up.  This could in theory interact badly with a
remote peer that stops reading and processing messages from the
receive queue when there is a backlog in the send queue for a
given connection (ovsdb-server is an example of a program that
behaves this way).  This commit fixes the problem by expanding
the definition of "activity" to include successfully sending
JSON-RPC data that was previously queued.

The above change is exactly analogous to the similar change
made to the rconn library in commit 133f2dc95454 (rconn: Treat
draining a message from the send queue as activity.).

Bug #12789.
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoreconnect: Rename reconnect_received() to reconnect_activity().
Ben Pfaff [Wed, 8 Aug 2012 20:32:57 +0000 (13:32 -0700)]
reconnect: Rename reconnect_received() to reconnect_activity().

Receiving data is not the only reasonable way to verify that a connection
is up.  For example, on a TCP connection, receiving an acknowledgment that
the remote side has accepted data that we sent is also a reasonable means.
Therefore, this commit generalizes the naming.

Also, similarly for the Python implementation: Reconnect.received() becomes
Reconnect.activity().

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agothird-party: Fix tcpdump patch
Joe Stringer [Wed, 5 Sep 2012 03:25:58 +0000 (15:25 +1200)]
third-party: Fix tcpdump patch

Other parts of OVS have moved on since the tcpdump patch was created. This
commit brings the patch up to date and will compile cleanly against
tcpdump-4.3.0.

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agodpif-linux: Report packet loss as WARN instead of ERR.
Ben Pfaff [Wed, 5 Sep 2012 18:02:27 +0000 (11:02 -0700)]
dpif-linux: Report packet loss as WARN instead of ERR.

Packet loss is recoverable so it doesn't warrant an ERR.

Bug #12920.
Reported-by: Scott Hendricks <shendricks@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoovsdb: Enforce immutability of immutable columns.
Ben Pfaff [Wed, 5 Sep 2012 17:35:20 +0000 (10:35 -0700)]
ovsdb: Enforce immutability of immutable columns.

OVSDB has always had the ability to mark a column as "immutable", so that
its value cannot be changed in a given row after that row is initially
inserted.  However, we discovered recently that ovsdb-server has never
enforced this constraint.  This commit implements enforcement.

Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agoofp-errors: Use OFPERR_OFPBRC_BAD_TABLE_ID
Simon Horman [Wed, 5 Sep 2012 02:50:38 +0000 (11:50 +0900)]
ofp-errors: Use OFPERR_OFPBRC_BAD_TABLE_ID

* In the case of OpenFlow 1.1+ OFPERR_OFPBRC_BAD_TABLE_ID is defined
  in the specification and seems to be the most appropriate error
  to use when an unknown table id is encountered.

* In the case of OpenFlow 1.0 no appropriate error message
  seems to exist. Perhaps because an invalid port is not possible?
  I'm unsure.

  In any case, make use of a non-standard error code (1,512).
  This was formerly known as OFPERR_NXBRC_BAD_TABLE_ID but
  has been rolled into OFPERR_OFPBRC_BAD_TABLE_ID to allow the
  latter to be used without concern for the prevailing Open Flow version.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-errors: Use OFPERR_OFPBRC_BAD_PORT
Simon Horman [Wed, 5 Sep 2012 02:50:37 +0000 (11:50 +0900)]
ofp-errors: Use OFPERR_OFPBRC_BAD_PORT

* In the case of OpenFlow 1.2+ OFPERR_OFPBRC_BAD_PORT is defined
  in the specification and seems to be the most appropriate error
  to use when an invalid port is encountered in a Packet Out request.

* In the case of OpenFlow 1.0 and 1.1 no appropriate error message
  seems to exist. Perhaps because an invalid port is not possible?
  I'm unsure.

  In any case, make use of a non-standard error code (1,514).
  This was formerly known as OFPERR_NXBRC_BAD_IN_PORT but
  has been rolled into OFPERR_NXBRC_BAD_IN_PORT to allow the
  latter to be used without concern for the prevailing Open Flow version.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoextract-ofp-errors: Check that error codes are in the expected ranges.
Ben Pfaff [Wed, 5 Sep 2012 17:18:56 +0000 (10:18 -0700)]
extract-ofp-errors: Check that error codes are in the expected ranges.

All real OpenFlow error codes are small numbers, and for Nicira extensions
we've intentionally chosen large numbers.  This commit adds a check that
standard and extension codes are properly designated in the ofp-errors.h
header.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-errors: Ignore text enclosed in square brackets
Simon Horman [Wed, 5 Sep 2012 02:50:36 +0000 (11:50 +0900)]
ofp-errors: Ignore text enclosed in square brackets

Enhance to extract-ofp-errors to omit text enclosed in square brackets from
error description. This allows some commentary other than
the error description to be supplied in ofp-errors.h

As suggested by Ben Pfaff <blp@nicira.com>

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com added the large comment on enum ofperr.]
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agopython/ovs/poller: use select.select instead of select.poll.
Isaku Yamahata [Wed, 5 Sep 2012 10:38:26 +0000 (19:38 +0900)]
python/ovs/poller: use select.select instead of select.poll.

eventlet/gevent doesn't work well with select.poll because select.poll blocks
python interpreter as a whole instead of switching from the current thread
which is about to block to other runnable thread.
So ovsdb python binding can't be used with eventlet/gevent.
Emulate select.poll with select.select because using python means that
performance isn't so important.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agolib/ofp-util: preparation for OF12 of ofp-util
Simon Horman [Tue, 4 Sep 2012 01:32:48 +0000 (10:32 +0900)]
lib/ofp-util: preparation for OF12 of ofp-util

Add necessary macros to ofp-util for OF12 support.
This is just a placeholder.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-errors: Use standardised code for OFPERR_OFPBMC_BAD_VALUE
Simon Horman [Tue, 4 Sep 2012 06:52:03 +0000 (15:52 +0900)]
ofp-errors: Use standardised code for OFPERR_OFPBMC_BAD_VALUE

Use standardised code for Open Flow 1.1 OFPERR_OFPBMC_BAD_VALUE

OFPERR_OFPBMC_BAD_VALUE is defined in Open Flow 1.1 as (4,7),
so use that code instead of a non-standard one.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-errors: Remove OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED
Simon Horman [Tue, 4 Sep 2012 06:52:00 +0000 (15:52 +0900)]
ofp-errors: Remove OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED

OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED is currently only used in paths which
are part of a non-NX extension portions of the Open Flow 1.1+
implementation.

After recent discussion it has been decided to attempt to only use
standardised, albeit lest-specify, errors unless errors arise from use of
an NX extension.

With the above in mind it seems appropriate to:
* Use OFPERR_OFPFMFC_UNKNOWN in place of OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED.
* Remove OFPERR_NXFMFC_GROUPS_NOT_SUPPORTED as it is no longer used.

An unfortunate side-effect of this change is that the error for
the case in question is now less-specific.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-errors: Remove OFPERR_NXBIC_DUP_TYPE
Simon Horman [Tue, 4 Sep 2012 06:51:59 +0000 (15:51 +0900)]
ofp-errors: Remove OFPERR_NXBIC_DUP_TYPE

OFPERR_NXBIC_DUP_TYPE is currently only used in
decode_openflow11_instructions() which is part of a non-NX extension
portion of the Open Flow 1.1+ implementation.

After recent discussion it has been decided to attempt to only use
standardised, albeit less-specific, errors unless errors arise from use of
an NX extension.

With the above in mind it seems appropriate to:
* Use OFPERR_OFPIT_BAD_INSTRUCTION in place of OFPERR_NXBIC_DUP_TYPE.
* Remove OFPERR_NXBIC_DUP_TYPE as it is no longer used.

An unfortunate side-effect of this change is that the error for
the case in question is now less-specific.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoIntroduce sparse flows and masks, to reduce memory usage and improve speed.
Ben Pfaff [Tue, 4 Sep 2012 19:43:53 +0000 (12:43 -0700)]
Introduce sparse flows and masks, to reduce memory usage and improve speed.

A cls_rule is 324 bytes on i386 now.  The cost of a flow table lookup is
currently proportional to this size, which is going to continue to grow.
However, the required cost of a flow table lookup, with the classifier that
we currently use, is only proportional to the number of bits that a rule
actually matches.  This commit implements that optimization by replacing
the match inside "struct cls_rule" by a sparse representation.

This reduces struct cls_rule to 100 bytes on i386.

There is still some headroom for further optimization following this
commit:

    - I suspect that adding an 'n' member to struct miniflow would make
      miniflow operations faster, since popcount() has some cost.

    - It's probably possible to replace the "struct minimatch" in cls_rule
      by just a "struct miniflow", since the cls_rule's cls_table has a
      copy of the minimask.

    - Some of the miniflow operations aren't well-optimized.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agohash: Introduce an implementation of murmurhash.
Ben Pfaff [Tue, 21 Aug 2012 21:26:23 +0000 (14:26 -0700)]
hash: Introduce an implementation of murmurhash.

Murmurhash is generally superior to the Jenkins lookup3 hash according to
the available figures.  Perhaps we should generally replace our current
hashes by murmurhash.

For now, I'm introducing a parallel implementation to allow it to be used
in cases where an incremental one-word-at-a-time hash is desirable.  The
first user will be added in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>