Ben Pfaff [Mon, 14 Jan 2013 07:19:32 +0000 (23:19 -0800)]
Describe dummy test model. Work on OpenFlow intro.
Ben Pfaff [Fri, 28 Dec 2012 19:01:41 +0000 (11:01 -0800)]
work on testing docs
Ben Pfaff [Sat, 8 Dec 2012 18:18:46 +0000 (10:18 -0800)]
work
Ben Pfaff [Wed, 28 Nov 2012 07:31:39 +0000 (23:31 -0800)]
work on manual
Simon Horman [Tue, 27 Nov 2012 18:12:26 +0000 (10:12 -0800)]
lib: Add helpers for OpenFlow version command line options
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com renamed some functions and options and revised
the documentation]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Tue, 27 Nov 2012 15:44:22 +0000 (17:44 +0200)]
Initial OpenFlow 1.3 support
Initial OpenFlow 1.3 support with new include/openflow/openflow-1.3.h.
Most of the messages that differ from 1.2 are implemented. OFPT_SET_ASYNC
is implemented via NX_SET_ASYNC_CONFIG, other new message types are yet to
be implemented. Stats replies that add duration fields are implemented at
encode/decode level only. Test cases for implemented features are included.
Remaining FIXME:s should not cause runtime aborts. Make check comes out
clean.
Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 27 Nov 2012 16:32:42 +0000 (08:32 -0800)]
AUTHORS: Add Jarno Rajahalme.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Mon, 26 Nov 2012 17:44:38 +0000 (09:44 -0800)]
ofp-util: Check out_group on flow_mod only for "delete" commands.
This conforms with OpenFlow 1.1+ wording.
Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Mon, 26 Nov 2012 16:17:08 +0000 (18:17 +0200)]
Fix handling of OFPP_ANY in OpenFlow 1.1 and later.
Add OFPP_ANY to include/openflow/openflow-1.1.h, and allow it as a port in
queue stats request. Make ovs_ofctl use OFPP_ANY instead of OFPP_ALL for queue
stats requests on OF 1.1+.
This patch changes "none" ports print out. "none" is still accepted on input
for backwards compatibility, but it prints out as "ANY". To make this less
confusing, I changed the test cases to use "controller" or "any" instead of
"none". The test case that tests for both "none" and "controller" still tests
for them.
Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Gurucharan Shetty [Tue, 20 Nov 2012 11:34:03 +0000 (03:34 -0800)]
vswitchd: Make Interface's ofport a persistent column.
Currently, the 'ofport' column in Interface table is
ephemeral and is populated by vswitchd everytime it is
started or when a new interface is created with vswitchd
running.
Making it persistent lets vswitchd try and assign the
same ofport number to a particular interface across
restarts. This is just a fallback option when
'ofport_request' column is empty.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Gurucharan Shetty [Tue, 6 Nov 2012 19:11:30 +0000 (11:11 -0800)]
ovs-ctl.in: Don't save kernel datapath config.
Commit
a41754333f6 (ovs-ctl.in: Ability to save flows and kernel
datapath config.) made ovs-ctl able to usefully save and restore
the flow table across loading and unloading the OVS kernel module
and stopping and starting the OVS daemons. To ensure that the
flow table was still meaningful, it ensured that the datapath port
numbers were the same with the old and new versions of the kernel
module.
However, later commit
e1b1d06afde (Separate OpenFlow port numbers
from datapath ones.) changed the OpenFlow implementation so that
keeping the same datapath port numbers no longer ensured that the
OpenFlow port numbers would be the same. This caused a regression
in saving and restoring the flow table. Although the flow table
was still saved and restored, it was no longer useful, since the
datapath port numbers might change.
This commit does not fix the regression, but it does drop the code
that saves and restores the port datapath numbers, since it is no
longer useful. The following commit fixes the regression.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Ansis Atteka [Thu, 22 Nov 2012 21:00:05 +0000 (13:00 -0800)]
vswitchd: fix 32-bit builds
My previous
72e8bf28bb38e8816435c64859fb350215b6a9e6 (datapath:
add skb mark matching and set action) commit broke 32-bit builds.
This patch assures that size of struct flow is equal on both
32-bit and 64-bit architectures so that build asserts would
not fire anymore.
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Ben Pfaff [Thu, 22 Nov 2012 06:09:55 +0000 (22:09 -0800)]
python/ovs/stream: Fix Stream.connect() retval for incomplete connection.
If the loop condition in Stream.connect() was false, which is especially
likely for TCP connections, then Stream.connect() would return None,
which violates its documented behavior. This commit fixes the problem.
Reported-by: Isaku Yamahata <yamahata@valinux.co.jp>
Tested-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Pravin B Shelar [Thu, 22 Nov 2012 02:51:36 +0000 (18:51 -0800)]
vswitchd: Log all tunnel parameters of given flow.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Ansis Atteka [Tue, 13 Nov 2012 17:19:36 +0000 (19:19 +0200)]
datapath: add skb mark matching and set action
This patch adds support for skb mark matching and set action.
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Ben Pfaff [Mon, 19 Nov 2012 23:56:47 +0000 (15:56 -0800)]
socket-util: Remove get_socket_error().
It has no remaining users.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Ben Pfaff [Mon, 19 Nov 2012 23:55:54 +0000 (15:55 -0800)]
socket-util: Avoid using SO_ERROR.
ESX doesn't implement it, and there's another approach that should work
everywhere, so drop back to that.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Ethan Jackson [Wed, 10 Oct 2012 20:33:54 +0000 (13:33 -0700)]
ovs-ofctl: Don't rely on stat() to check unix sockets.
ESX supports unix sockets, but they don't manifest themselves in
file system like they do on Linux. Instead of using stat to check
if a unix socket exist, this patch simply tries to open it instead.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Ansis Atteka [Tue, 20 Nov 2012 21:40:12 +0000 (13:40 -0800)]
ovs-appctl: fix help message for ofproto/trace command
The usage message for this command was wrong, because it did not
specify priority as one of its arguments.
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Gurucharan Shetty [Tue, 20 Nov 2012 11:18:11 +0000 (03:18 -0800)]
ofproto: Fix ofport allocation.
Currently running the following 3 commands results
in vswitchd running in an infinite loop.
ovs-vsctl add-port br1 port1 -- set interface port1 \
type=internal ofport_request=1
ovs-vsctl add-port br1 port2 -- set interface port2 \
type=internal ofport_request=2
ovs-vsctl add-port br1 port3 -- set interface port3 \
type=internal
This patch lets us go through all the possible ofport
values to find a free ofport.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Ben Pfaff [Tue, 20 Nov 2012 21:09:07 +0000 (13:09 -0800)]
bridge: Fix typo in comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 20 Nov 2012 15:46:41 +0000 (07:46 -0800)]
dpif-netdev: Make odp_flow_key_to_flow() check more explicit.
ODP_FIT_PERFECT has value 0 but this 'if' statement doesn't make much sense
unless you happen to know that.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Ben Pfaff [Tue, 20 Nov 2012 15:45:56 +0000 (07:45 -0800)]
python/ovs/socket_util: Fix error path in set_nonblocking.
'e' is an exception, not a socket, so get_exception_errno() is the
appropriate function to obtain an error code from it.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Simon Horman [Tue, 20 Nov 2012 01:50:39 +0000 (10:50 +0900)]
ofp-util: Flow Dump Protocol for OpenFlow 12
Allow only OpenFlow 12 as a flow dump protocol.
The implementation of set_protocol_for_flow_dump ensures that
this will only be selected if an OpenFlow12 connection has
been negotiated.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ethan Jackson [Thu, 15 Nov 2012 02:34:14 +0000 (18:34 -0800)]
daemon: Avoid the link() syscall.
make_pidfile() depends on the link() system call to atomically
create pidfiles when multiple daemons are started concurrently.
However, this system call isn't available on ESX so an alternative
strategy is necessary. Fortunately, the approach this patch takes
is cleaner than the original code.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Simon Horman [Mon, 19 Nov 2012 05:59:30 +0000 (14:59 +0900)]
vswitchd: Configuration of allowed OpenFlow versions
Versions may be configured using the protocols column of
the bridge table. The protocols column is a set which accepts zero
or more of the values: 'OpenFlow10' and 'OpenFlow12'.
If the protocols column is empty, then OpenFlow10 is used.
This default is consistent with the behaviour of ovs-vswtichd
prior to this patch.
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com adjusted comments and documentation]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 19 Nov 2012 17:49:13 +0000 (09:49 -0800)]
connmgr: Use version of underlying rconn
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com add OFPUTIL_P_NONE handling to ofconn_receives_async_msg()]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 19 Nov 2012 17:50:44 +0000 (09:50 -0800)]
connmgr: Mark ofconn_get_protocol() parameter const.
Signed-off-by: Ben Pfaff <blp@nicira.com>
FUJITA Tomonori [Sun, 18 Nov 2012 18:50:52 +0000 (03:50 +0900)]
don't use select.POLL* constants
Python doesn't have select.POLL* constants on some architectures
(e.g. MacOSX). This code needs to define the constants for itself. It
uses select.POLL* constants only internally (doesn't pass them
outside). So there is no harm even if the definition would conflict
with Python's those.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 16 Nov 2012 19:19:17 +0000 (11:19 -0800)]
CodingStyle: Fix indentation.
This got changed away from what I actually prefer in commit
be2c418b73fc
(Cleanup isdigit() warnings.).
Signed-off-by: Ben Pfaff <blp@nicira.com>
Shan Wei [Fri, 16 Nov 2012 21:21:36 +0000 (13:21 -0800)]
datapath: use this_cpu_ptr per-cpu helper
just use more faster this_cpu_ptr instead of per_cpu_ptr(p, smp_processor_id());
Signed-off-by: Shan Wei <davidshan@tencent.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Jesse Gross [Fri, 16 Nov 2012 21:20:58 +0000 (13:20 -0800)]
datapath: Backport this_cpu_ptr to kernels < 2.6.33
An upstream commit uses this_cpu_ptr for a small performance benefit,
so this provides an equivalent to kernels that don't have that
function.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Justin Pettit [Fri, 16 Nov 2012 06:30:41 +0000 (22:30 -0800)]
ofproto-dpif: Remove datapath flows of deleted ports.
Commit acf608 (ofproto-dpif: Use a single underlying datapath across
multiple bridges.) causes datapath flows from deleted ports to not be
removed. The issue is that the code that bulk deletes old flows doesn't
know the datapath port number that makes up the datapath flow
definition. This commit keeps track of the datapath port in the facet
for use when the datapath flow eventually needs to be removed.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Thu, 15 Nov 2012 22:42:10 +0000 (14:42 -0800)]
netdev-linux: Don't log vport warnings when kernel datapath not loaded.
The *_get_stats functions call get_stats_via_vport(), which tries to get
information about ports attached to the kernel datapath. When a pure
userspace switch is used (eg, the OVS kernel module isn't loaded), ports
are not attached to a kernel datapath, so warnings get logged. This
commit handles that case and doesn't log a warning. However, if the
kernel datapath is loaded, ports attached to a userspace datapath will
still log a warning.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Thu, 15 Nov 2012 22:27:28 +0000 (14:27 -0800)]
netdev-linux: "Down" tap devices before setting hw addr.
On Linux, it is not possible to set the mac address on "up" tap
interfaces. This commit temporarily "down"s the interface so the
address can be set for the netdev_linux_set_etheraddr() call.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Thu, 15 Nov 2012 21:55:06 +0000 (13:55 -0800)]
bridge: Always "up" internal devices.
The kernel datapath automatically "up"s internal devices, but this
wasn't happening for the userspace datapath. This change has the bridge
module always "up" them.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Thu, 15 Nov 2012 21:53:16 +0000 (13:53 -0800)]
bridge: Introduce iface_is_internal() function.
This will have an additional caller in the future.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Fri, 16 Nov 2012 07:00:39 +0000 (23:00 -0800)]
ofproto-dpif: Query port existence by name to prevent warnings.
The port_destruct() function checks if the port still exists in the
datapath to see if additional cleanup is necessary. It used
dpif_port_query_by_number(), since the datapath port number is readily
available and cheap to use as a lookup handle. Unfortunately, that
function logs a warning message if a port with that number doesn't exist
(because the datapath did remove it), which is confusing. The
dpif_port_query_by_name() function doesn't log such an warning, so use
it instead.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Thu, 15 Nov 2012 21:05:58 +0000 (13:05 -0800)]
dpif: Don't log warning for ENOENT with dpif_port_exists().
The caller wants to know whether 'devname' is attached to 'dpif', and
ENOENT is a legitimate response to that not being the case.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Tue, 13 Nov 2012 02:57:42 +0000 (18:57 -0800)]
ofproto-dpif: Correct in_port on send_packet().
The switch to a single datapath uncovered a long-standing bug in the
send_packet() function. The code had used an (invalid) ingress OpenFlow
port of 0, which happened to get translated to the datapath's local
port, which was always 0. With the single datapath, this invalid
OpenFlow port number no longer maps properly, so switch-generated
packets could not be transmitted. This patch properly sets the ingress
port to OFPP_LOCAL.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Wed, 14 Nov 2012 23:49:47 +0000 (15:49 -0800)]
bridge: Open internal ports with the correct type.
Use the new ofproto function that returns how a port should be opened
based on the datapath type. This fixes a problem with internal ports
being attached to userspace datapaths.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Wed, 14 Nov 2012 23:50:20 +0000 (15:50 -0800)]
Add functions to determine how port should be opened based on type.
Depending on the port and type of datapath, a port may need to be opened
as a different type of device than it's configured. For example, an
"internal" port on a "dummy" datapath should opened as a "dummy" port.
This commit adds the ability for a dpif to provide this information to a
caller. It will be used in a future commit.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Wed, 14 Nov 2012 23:58:19 +0000 (15:58 -0800)]
dpif-linux.c: Let the kernel pick a port number if one not requested.
With the single datapath change, we no longer depend on the kernel to
make sure that we don't reuse OpenFlow port numbers, since the ofproto
library now picks them. Remove the code that contained that logic.
Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Wed, 14 Nov 2012 01:57:11 +0000 (17:57 -0800)]
dpif-netdev: Don't special-case "br" bridges in create_dp_netdev().
With a single datapath, we no longer need to special case bridges
beginning with "br*" for testing, since all netdev-based bridges
are named "ovs-netdev". This removes that unnecessary code.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Ben Pfaff [Fri, 16 Nov 2012 06:10:56 +0000 (22:10 -0800)]
nicira-ext: Remove NXFF_OPENFLOW12.
This was meant to splice OXM support into OpenFlow 1.0, in place of NXM,
but I no longer see any value in it.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Ben Pfaff [Fri, 16 Nov 2012 06:09:07 +0000 (22:09 -0800)]
ofp-util: Make ofputil_encode_set_protocol() able to return failure.
Soon, it's not going to be possible to switch between every possible
protocol on an established OpenFlow connection, yet
ofputil_encode_set_protocol() didn't have a documented way to report such
a problem. This commit adds a means for reporting and makes its callers
able to handle the problem.
Also, initially make ofputil_encode_set_protocol() fail when the current
and requested protocols are for different OpenFlow versions.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Ben Pfaff [Fri, 16 Nov 2012 06:36:15 +0000 (22:36 -0800)]
ofp-util: Allow use of OpenFlow 12 flow format
This enables the use of the OpenFlow 12 flow format.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 16 Nov 2012 05:01:13 +0000 (21:01 -0800)]
ofp-util: Rename OFPUTIL_P_* constants and update comments for clarity.
It wasn't clear to me, at least, whether an OFPUTIL_P_* constant
indicated an OpenFlow version and a flow format or just a flow format.
After some reflection, I think it's more useful if it indicates both,
because otherwise it might be necessary to pass both an OpenFlow version
and an OFPUTIL_P_* constant in some contexts, but this way only the latter
is needed.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Ben Pfaff [Fri, 16 Nov 2012 05:28:56 +0000 (21:28 -0800)]
ovs-ofctl: Style fix.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Pravin B Shelar [Thu, 15 Nov 2012 05:10:54 +0000 (21:10 -0800)]
odp-utils: Print human readable ipv4-tunnel-key flags.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Pravin B Shelar [Thu, 15 Nov 2012 05:10:22 +0000 (21:10 -0800)]
odp-utils: Refactor slow_path_reason parse and format functions.
These functions are used in next patch.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Pravin B Shelar [Wed, 14 Nov 2012 01:20:22 +0000 (17:20 -0800)]
vswitchd: Fix function prototype of packet_set_ipv6()
Follwoing patch fixes sparse error:
lib/packets.c:643:1: error: symbol 'packet_set_ipv6' redeclared
with different type (originally declared at lib/packets.h:493)
- incompatible argument 6 (different base types)
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Ansis Atteka [Mon, 5 Nov 2012 13:53:32 +0000 (15:53 +0200)]
datapath: add ipv6 'set' action
This patch adds ipv6 set action functionality. It allows to change
traffic class, flow label, hop-limit, ipv6 source and destination
address fields.
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Ansis Atteka [Wed, 7 Nov 2012 17:14:34 +0000 (19:14 +0200)]
sparse: Add ip6_rthdr struct to the ip6.h
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Simon Horman [Wed, 7 Nov 2012 08:03:02 +0000 (17:03 +0900)]
ofproto, connmgr: Parameterise OpenFlow versions for adding controller
Allow allowed Open Flow versions to be passed rather
than relying on hard-coded defaults.
This is in preparation for allowing configuration of the
allowed OpenFlow versions.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 7 Nov 2012 08:03:01 +0000 (17:03 +0900)]
vonn: Allow snoops to use the OpenFlow version of the controller connection
Override the allowed versions of the snoop vconn so that
only the version of the controller connection is allowed.
This is because the snoop will see the same messages as the
controller.
Without this change the snoop will try to negotiate a connection
using the default allowed versions, or in other words only
allow OpenFlow 1.0. This breaks snoops for controller connections
using other OpenFlow versions, that is OpenFlow 1.2.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 7 Nov 2012 08:03:00 +0000 (17:03 +0900)]
rconn: Add allowed OpenFlow versions
Add allowed OpenFlow versions to struct rconn to allow
reconnect to use these parameters rather than hard-coded defaults.
This is in preparation for allowing configuration of the
allowed OpenFlow versions.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 9 Nov 2012 18:00:22 +0000 (10:00 -0800)]
tests: Add tests for encoding and decoding OpenFlow hello messages.
These tests helped me find the problems that I fixed in previous commits.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 9 Nov 2012 17:59:12 +0000 (09:59 -0800)]
ofp-util: Make ofputil_encode_hello() return a message with correct length.
This doesn't fix a visible bug, because code to send OpenFlow messages
updates the length itself, but it still seems like the right thing to do.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 9 Nov 2012 17:57:57 +0000 (09:57 -0800)]
ofp-util: Ignore invalid bitmaps in ofputil_decode_hello_bitmap().
This code has, until now, parsed and accepted invalid bitmaps. It seems
better to simply ignore them, leaving the original set of allowed versions
from the version field in the ofp_header.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 9 Nov 2012 17:55:12 +0000 (09:55 -0800)]
ofp-msgs: Accept all versions of OpenFlow "hello" messages.
Since the ofp-msgs code was introduced, only "hello" messages for versions
of OpenFlow actually understood (to some extent) by Open vSwitch could be
decoded correctly. This commit corrects that, by making every version of
OpenFlow immutable messages acceptable.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 7 Nov 2012 08:02:59 +0000 (17:02 +0900)]
ofp-util: Correct length of hello version bitmap
The length of the hello version bitmap is measured in bytes
so the return value of sizeof is sufficient. Dividing
this by CHAR_BIT (=8) seems to be an artifact of reworking
a previous version of this code.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Wed, 7 Nov 2012 15:57:22 +0000 (07:57 -0800)]
datapath: Move tun_key out of struct phy and union.
Tunneling metadata is important enough to move out of struct phy
and handled on its own. This makes it somewhat easier to tell
how well the other structures are packed and also the name shorter.
This also drops the union since it's not needed quite yet. We
can introduce it back when we have support for IPv6 tunneling.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Jesse Gross [Wed, 7 Nov 2012 15:35:14 +0000 (07:35 -0800)]
datapath: ipv6_skip_exthdr() is now fully upstream.
OVS required some extensions to ipv6_skip_exthdr() which have
since been accepted upstream. On kernels with these changes we can
now use the upstream version instead of our compatibility code.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Jesse Gross [Wed, 7 Nov 2012 01:55:43 +0000 (17:55 -0800)]
tunnel: Zero keys if marked as not present.
If a key used to find a port then we mark it as being not present
(previously this was accomplished by setting it to zero). However,
we also still pass the key to userspace which could lead to an
inconsistent state. This also zeros out the key as before in order
to make our reported results consistent.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Jesse Gross [Tue, 6 Nov 2012 21:22:28 +0000 (13:22 -0800)]
datapath: Allow GRE64 to use flow based tunneling.
There's no reason why GRE64 can't be configured using flow based
tunneling. Since that's the direction we are moving, everything
should support that. Once this special casing is removed, it's
possible to unify the tunnel parameter parsing code since both
GRE and CAPWAP are the same.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Jesse Gross [Tue, 6 Nov 2012 20:45:19 +0000 (12:45 -0800)]
datapath: Shorten flow tunneling flags.
The names for the flags used by flow based tunneling are pretty long.
This shortens them a little by removing the word FLOW, which is a
distinction that won't be meaningful in the near future.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Jesse Gross [Mon, 5 Nov 2012 23:47:41 +0000 (15:47 -0800)]
datapath: Don't allow flows installed with only TUN_ID.
Tunnel ports now always include full outer IP information, even if
userspace can't understand it. Since our flows our exact match this
information must also be provided when setting up flows. Since flows
with only OVS_KEY_ATTR_TUN_ID keys don't contain all of this information
they can never be hit and we should just reject them at setup time.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Jesse Gross [Mon, 5 Nov 2012 19:30:35 +0000 (11:30 -0800)]
datapath: Don't write into IPV4_TUNNEL data when using TUN_ID.
When the IPV4_TUNNEL action is executed, a pointer in the skb is
directly assigned the address of the action, which is protected by
RCU. If a TUN_ID action is later executed it will write into the
action, which is not allowed by RCU. This avoids the problem by
making a copy of the data and writing into the copy.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Jesse Gross [Mon, 5 Nov 2012 19:08:47 +0000 (11:08 -0800)]
datapath: Include OVS_KEY_ATTR_IPV4_TUNNEL in upstream range.
During development it was preferable to keep OVS_KEY_ATTR_IPV4_TUNNEL
in the non-upstream range of identifiers to avoid conflicts or
compatibility issues as it evolved. However, since the intention is
to get it upstream, it makes sense to move it down now to avoid issues
with compatibility when upgrading.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Ben Pfaff [Wed, 7 Nov 2012 20:55:53 +0000 (12:55 -0800)]
socket-util: Report fd of -1 on error in inet_open_active().
inet_open_active() is documented to report a fd of -1 when an error occurs.
All three of its callers rely on this, by checking only the fd to determine
whether there was an error. This means that if the call to
set_nonblocking() or set_dscp() or connect() failed, then the callers would
try to use a fd that had already been closed, wreaking havoc.
This fixes a bug introduced in commit
a4efa3fc5d (socket-util: Close socket
on failed dscp modification.)
Bug #13750.
Reported-by: Scott Hendricks <shendricks@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Ethan Jackson [Tue, 6 Nov 2012 03:00:07 +0000 (19:00 -0800)]
bridge: Fix a segmentation fault in bridge_init_ofproto().
When the database is initially created there may no be rows in the
Open_vSwitch table. In this case, the ovsrec_open_vswitch passed
to bridge_init_ofproto() is NULL and causes a segmentation fault.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Ethan Jackson [Tue, 6 Nov 2012 02:26:52 +0000 (18:26 -0800)]
netdev-vport: Fix warning due to new GRE type.
This patch fixes the following warning caused by a switch case
which was not handled.
lib/netdev-vport.c:144:5: error: enumeration value
‘OVS_VPORT_TYPE_FT_GRE’ not handled in switch
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Ansis Atteka [Tue, 6 Nov 2012 15:12:38 +0000 (17:12 +0200)]
datapath: improve ipv6_find_hdr() function for IPv6 'set' action
This patch prepares ipv6_find_hdr() function so that it could be
able to skip routing headers, where segements_left is 0. This is
required for us to handle multiple routing header case correctly.
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Ansis Atteka [Tue, 6 Nov 2012 11:39:58 +0000 (13:39 +0200)]
datapath: Add ipv6_find_hdr() compatibility function.
Implementation of the IPv6 'set' action depends on ipv6_find_exthdr()
function to find routing header. By looking at the routing headers,
it is possible to tell, whether L4 checksums will need to be
recalculated, whenever the destination address is changed in
the main IPv6 header.
This function will need to be customized so that it would skip all
routing headers, where segements_left is equal to 0.
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Jesse Gross [Tue, 30 Oct 2012 23:34:50 +0000 (16:34 -0700)]
datapath: Remove flow refcount functionality.
Header caching previously required the ability to maintain the lifetime
of flows across RCU boundaries. However, now that header caching is
gone we can simplfy the code and make it match the upstream version.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Pravin B Shelar [Mon, 5 Nov 2012 23:12:59 +0000 (15:12 -0800)]
datapath: Add missing bug.h file
Commit
51f4701be1 (datapath: Fix sparse warning for symbol
'BUILD_BUG_ON_NOT_POWER_OF_2') missed file bug.h. Commiting it now.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Pravin B Shelar [Mon, 5 Nov 2012 21:44:23 +0000 (13:44 -0800)]
datapath: Add support for 3.6 kernel.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Mon, 5 Nov 2012 21:44:00 +0000 (13:44 -0800)]
datapath: Remove tunnel header caching.
Tunnel caching was added to reduce CPU utilization on TX path
by caching packet header, So performance gain is directly proportional
to number of skbs transferred. But with help of offloads skb are getting
larger. So there are less number of skbs. Therefore header caching does
not shows similar gains we seen in past. And now kernel 3.6 has removed
dst caching from networking which makes header caching even more tricky.
So this commit removes header caching from OVS tunnelling.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Mon, 5 Nov 2012 21:41:02 +0000 (13:41 -0800)]
datapath: Fix sparse warning for symbol 'BUILD_BUG_ON_NOT_POWER_OF_2'
BUILD_BUG_ON_NOT_POWER_OF_2 symbol is moved from kernel.h to
bug.h in 3.4. Therefore sparse is giving warning:
include/linux/bug.h:15:9: warning: preprocessor token
BUILD_BUG_ON_NOT_POWER_OF_2 redefined
ovs/datapath/linux/compat/include/linux/kernel.h:44:9:
this was the original definition
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Mon, 5 Nov 2012 21:40:17 +0000 (13:40 -0800)]
netdev: Deprecate CAPWAP 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. As a result,
CAPWAP will be removed no earlier than February 2013.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Pravin B Shelar [Mon, 5 Nov 2012 21:39:00 +0000 (13:39 -0800)]
datapath: enable encap for capwap.
kernel 3.5 added a switch to turn on UDP encap, capwap needs
to enable it.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Mon, 5 Nov 2012 21:38:34 +0000 (13:38 -0800)]
datapath: Add Upstream id for GRE type.
Once GRE is upstream it will have new type to have continuous sequence
of ids for vport type. Following patch adds this ID to have
compatibility with it.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Mehak Mahajan [Mon, 5 Nov 2012 19:14:36 +0000 (11:14 -0800)]
Correct the warning for format specifier.
ofputil_format_version uses type 'size_t' to print version whereas
expected type is 'unsigned int'.
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Mehak Mahajan [Mon, 5 Nov 2012 19:05:18 +0000 (11:05 -0800)]
Update master to reflect updates on branch-1.9
This commit updates NEWS and debian/changelog to reflect that
commit
8087f5ff (Process RARP packets with ethertype 0x8035
similar to ARP packets.) is going to be backported intto 1.9.0, so
that they should no longer be listed as post-1.9 features.
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Simon Horman [Fri, 26 Oct 2012 02:35:52 +0000 (11:35 +0900)]
connmgr: Parameterize ofservice_create() over allowed OpenFlow versions
This is in preparation for allowing configuration of the
allowed OpenFlow versions.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 5 Nov 2012 06:04:55 +0000 (22:04 -0800)]
ofp-util: Add version bitmap support to hello messages.
Allow encoding and decoding of version bitmap in hello messages
as specified in Open Flow 1.3.1.
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com simplified and generalized decode/encode functions]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 5 Nov 2012 05:41:02 +0000 (21:41 -0800)]
vconn: Replace minimum version with bitmap of allowed versions.
This is in preparation for allowing the range of allowed OpenFlow versions
to be configured.
As part of this change pvconn_open() is now paramatised over the allowed
versions. this is to avoid avoids needing to provide version information
as a parameter to pvconn_accept(). This will in turn avoid the need to
pass version information to connmgr_run().
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com simplified slightly and generalize log messages]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Mon, 5 Nov 2012 05:40:54 +0000 (21:40 -0800)]
ofp-util: Add functions to support version number bitmaps.
The bitmap is simple a uint32_t, allowing for versions up until
wire-protocol number 31.
Bit offsets correspond to ofp_version numbers which in turn
correspond to wire-protocol numbers for Open Flow versions..
E.g. (1 << OFP10_VERSION) is the mask for Open Flow 1.1.
If the bit for a version is set then it is allowed, otherwise it is
disallowed.
This is in preparation for allowing the range of allowed OpenFlow
versions to be configured.
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com simplified some functions to constants, and rewrote
a few functions in terms of utility bitwise functions]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 1 Nov 2012 00:13:27 +0000 (17:13 -0700)]
util: New functions for the index of the leftmost or rightmost 1-bit.
These will acquire a user in an upcoming commit.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 1 Nov 2012 00:12:38 +0000 (17:12 -0700)]
util: Group functions for bitwise tests.
This only moves code around for more logical grouping.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Sun, 4 Nov 2012 01:00:39 +0000 (18:00 -0700)]
ofproto: Report 0 Mbps when speed not available instead of 100 Mbps.
When a link is down, or when a link has no speed because it is not a
physical interface, Open vSwitch previously reported that its rate is 100
Mbps as a default. This is counterintuitive, however, so this commit
changes Open vSwitch behavior to report 0 Mbps when a link is down or its
speed is otherwise unavailable.
Bug #13388.
Reported-by: Hiroshi Tanaka <htanaka@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Mehak Mahajan [Fri, 2 Nov 2012 18:43:46 +0000 (11:43 -0700)]
Process RARP packets with ethertype 0x8035 similar to ARP packets.
With this commit, OVS will match the data in the RARP packets having
ethertype 0x8035, in the same way as the data in the ARP packets.
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Ben Pfaff [Fri, 2 Nov 2012 17:37:59 +0000 (10:37 -0700)]
ofproto: Better hide hidden tables.
ofproto has a concept of "hidden" OpenFlow tables. Currently these are
used internally only for ofproto-dpif for a couple of unimportant
purposes. However, hidden tables were not hidden well enough, because
OFTest was able to spot ofproto-dpif's hidden table and, seeing that it
had a couple of flows in it even after OFTest had tried to delete all
flows, failed at least one test.
This commit hides the tables better:
- The number of tables reported in a feature reply no longer counts
hidden tables.
- Table stats replies omit hidden tables.
This commit introduces the requirement that hidden tables, if any, be the
highest-numbered tables. This is because it's not clear to me that
OpenFlow intends to allow tables to be numbered noncontiguously.
We could take this further, by not exposing hidden tables in any way, but
I have this pet theory that being able to get the statistics for these
tables will come in handy for debugging someday.
Found by openflow_protocol_messages.ModifyStateDelete in OFTest.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Ben Pfaff [Fri, 2 Nov 2012 17:21:08 +0000 (10:21 -0700)]
FAQ: Explain the difference between a switch and a bridge.
(There isn't any difference.)
Based on a conversation in #openvswitch.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Justin Pettit [Wed, 31 Oct 2012 00:41:22 +0000 (17:41 -0700)]
ofproto-dpif: Use a single underlying datapath across multiple bridges.
This commit switches to using a single backing datapath (called
"ovs-datapath") for all bridges of that datapath's type. Previously,
resources couldn't be shared across bridges, since each was in its own
datapath. This change will allow sharing of tunnels and cheaper patch
ports to be added in the future.
Since bridges share a common datapath, the ovs-dpctl commands won't
provide bridge-specific information. Users wishing to have that
information should use the new "ovs-appctl dpif/*" commands as
documented in ovs-vswitchd(8).
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Thu, 1 Nov 2012 23:16:16 +0000 (16:16 -0700)]
dpif-sflow: Remove unused parameter from dpif_sflow_create().
Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Thu, 1 Nov 2012 23:04:06 +0000 (16:04 -0700)]
dpif: Add function to get the dpif type.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Thu, 18 Oct 2012 06:11:53 +0000 (23:11 -0700)]
dpif: Add new dpif_port_exists() function.
Provide the ability to determine whether a port exists in a datapath
without having to deal with a "dpif_port" structure as with
dpif_port_query_by_name(). A future patch will use this function.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Justin Pettit [Fri, 12 Oct 2012 00:17:40 +0000 (17:17 -0700)]
ofproto: Add type "run", "run_fast", and "wait" provider methods.
Add the ability for ofproto providers to have top-level "run",
"run_fast", and "wait" methods, similar to the current ofproto ones.
There are no current users, but this will be useful in a future commit.
Signed-off-by: Justin Pettit <jpettit@nicira.com>