sliver-openvswitch.git
12 years agodatapath: Kernel flow metadata parsing should be less restrictive
Ansis Atteka [Tue, 8 Nov 2011 22:32:13 +0000 (14:32 -0800)]
datapath: Kernel flow metadata parsing should be less restrictive

The function flow_metadata_from_nlattrs() is very restrictive
about the ordering and type of metadata attributes that it receives.
This patch will change flow_metadata_from_nlattrs() behavior by
ignoring attributes that it does not understand and allowing them
to be passed in arbitrary order.

Issue #8167

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodebian: Strip epoch from version number used in directory names.
Ben Pfaff [Wed, 9 Nov 2011 16:35:33 +0000 (08:35 -0800)]
debian: Strip epoch from version number used in directory names.

This doesn't fix a visible bug, since there's no epoch in the Open vSwitch
version used in Debian, but some Nicira internal build scripts were
inserting an epoch so it was visible in our builds.

Reported-by: Edwin Chiu <echiu@nicira.com>
12 years agodatapath: Fix compiler warning on older kernel.
Pravin B Shelar [Thu, 10 Nov 2011 03:47:25 +0000 (19:47 -0800)]
datapath: Fix compiler warning on older kernel.

commit 6455100f38e9312346f4d58511595f695d813537 (datapath: Fix
coding style issues) introduced this issue.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodatapath: Fix comment formatting.
Jesse Gross [Wed, 9 Nov 2011 22:13:44 +0000 (14:13 -0800)]
datapath: Fix comment formatting.

A few of the recently added fields in struct sw_flow_key had
comments that weren't properly aligned.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Rename ipv6_tos to ipv6_tclass.
Justin Pettit [Wed, 9 Nov 2011 20:17:38 +0000 (12:17 -0800)]
datapath: Rename ipv6_tos to ipv6_tclass.

IPv6 uses the term "traffic class" for what IPv4 calls
"type-of-service".  This commit renames the the "ipv6_tos" field to
"ipv6_tclass" in the "ovs-key_ipv6" struct to be more consistent with
the IPv6 terminology.

Suggested-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoodp-util: Use PRIu8 instead of PRId8 when printing ip_proto.
Justin Pettit [Tue, 8 Nov 2011 07:47:38 +0000 (23:47 -0800)]
odp-util: Use PRIu8 instead of PRId8 when printing ip_proto.

Suggested-by: Ben Pfaff <blp@nicira.com>
12 years agoSupport matching and modifying IP TTL.
Justin Pettit [Sat, 5 Nov 2011 22:48:12 +0000 (15:48 -0700)]
Support matching and modifying IP TTL.

Add support matching the IPv4 TTL and IPv6 hop limit fields.  This
commit also adds support for modifying the IPv4 TTL.  Modifying the IPv6
hop limit isn't currently supported, since we don't support modifying
IPv6 headers.

We will likely want to change the user-space interface, since basic
matching and setting the TTL are not generally useful.  We will probably
want the ability to match on extraordinary events (such as TTL of 0 or 1)
and a decrement action.

Feature #8024

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoSupport matching and modifying IP ECN bits.
Justin Pettit [Thu, 3 Nov 2011 06:34:15 +0000 (23:34 -0700)]
Support matching and modifying IP ECN bits.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoDon't overload IP TOS with the frag matching bits.
Justin Pettit [Thu, 3 Nov 2011 01:17:36 +0000 (18:17 -0700)]
Don't overload IP TOS with the frag matching bits.

This will be useful later when we add support for matching the ECN bits
within the TOS field.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoSupport matching IPv6 flow label.
Justin Pettit [Tue, 1 Nov 2011 22:57:56 +0000 (15:57 -0700)]
Support matching IPv6 flow label.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoflow: Rearrange IPv6 addresses to remove potential hole in structure.
Justin Pettit [Thu, 3 Nov 2011 01:22:22 +0000 (18:22 -0700)]
flow: Rearrange IPv6 addresses to remove potential hole in structure.

On some platforms, the in6_addr structure is made up of 16- or 32-bit
members.  Depending on the members of the "flow" structure, this can
lead to holes in the middle.  Moving the IPv6 addresses to the middle
fixes that on these platforms.

12 years agoovs-ofctl: Clarify that nw_tos doesn't match on ARP.
Justin Pettit [Sat, 5 Nov 2011 22:51:37 +0000 (15:51 -0700)]
ovs-ofctl: Clarify that nw_tos doesn't match on ARP.

12 years agodatapath: Properly calculate checksum when updating TOS field.
Justin Pettit [Mon, 7 Nov 2011 07:37:21 +0000 (23:37 -0800)]
datapath: Properly calculate checksum when updating TOS field.

When updating the IP TOS field, the checksum was not properly calculated
on little endian systems.  This commit fixes the issue.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoofproto-dpif: Actually disable STP on port when disabling STP on port.
Justin Pettit [Wed, 9 Nov 2011 01:31:04 +0000 (17:31 -0800)]
ofproto-dpif: Actually disable STP on port when disabling STP on port.

When disabling STP on a port that has it enabled on the bridge, STP was
not actually being disabled on the port.  This commit directly calls the
update function in this situation.

Reported-by: Paul Ingram <paul@nicira.com>
12 years agodatapath: Update kernel support to 3.2.
Pravin B Shelar [Tue, 8 Nov 2011 23:25:12 +0000 (15:25 -0800)]
datapath: Update kernel support to 3.2.

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

12 years agodatapath: Fix vport tx_packets count.
Pravin B Shelar [Tue, 8 Nov 2011 19:16:24 +0000 (11:16 -0800)]
datapath: Fix vport tx_packets count.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agotunneling: Separate out multicast port pools.
Jesse Gross [Tue, 8 Nov 2011 04:01:52 +0000 (20:01 -0800)]
tunneling: Separate out multicast port pools.

Currently multicast and unicast tunnel ports share port pools but
there's no overlap between the two in the lookup, which means that
we can do a lookup that has no chance of ever finding a port.  This
separates them out.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agotunneling: Reduce priority of multicast tunnels.
Jesse Gross [Sun, 6 Nov 2011 00:18:04 +0000 (17:18 -0700)]
tunneling: Reduce priority of multicast tunnels.

It's possible to have an incoming packet that matches both a unicast
and multicast tunnel if the source address corresponds to the remote_ip
of a unicast tunnel and the destination is multicast.  Currently this
will match the multicast tunnel but in reality the unicast tunnel
should probably be considered more specific.  This is actually a
common situation in protocols that use a combination of multicast
for flooding and unicast for responses.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Renumber non-upstreamable interfaces.
Jesse Gross [Sun, 6 Nov 2011 03:13:55 +0000 (20:13 -0700)]
datapath: Renumber non-upstreamable interfaces.

The interfaces related to tunneling aren't finalized enough to be
sent upstream but we also still want to retain them in the OVS
repository.  Since userspace should be compatible with both versions
of the kernel, this renumbers the tunnel interfaces to high numbers
so that we can continue to add new interfaces without conflict.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Slim down the vport interface.
Jesse Gross [Sun, 6 Nov 2011 00:08:21 +0000 (17:08 -0700)]
datapath: Slim down the vport interface.

Many of the function in vport.c are simply pass throughs to their
underlying vport implementation and, of these, many are used only
for bridge compatibility code.  This allows users of these functions
to directly call through the ops structure, reducing boilerplate code
and keeping more of the compatibility code together.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Remove vport from OVS_CB.
Jesse Gross [Sat, 5 Nov 2011 23:43:34 +0000 (16:43 -0700)]
datapath: Remove vport from OVS_CB.

Now that most fix function logic (like sFlow) has been moved to
userspace, the vport member of OVS_CB is no longer used by anything,
so drop it.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Fix coding style issues.
Pravin B Shelar [Mon, 7 Nov 2011 23:53:01 +0000 (15:53 -0800)]
datapath: Fix coding style issues.

Most of issues are reported by checkpatch.pl

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

12 years agodebian: Fix build failure installing ovs-vswitchd.conf.db(5) manpage.
Ben Pfaff [Fri, 4 Nov 2011 20:53:44 +0000 (13:53 -0700)]
debian: Fix build failure installing ovs-vswitchd.conf.db(5) manpage.

ovs-vswitchd.conf.db is distributed so it's in the source directory not
the build directory.

This fixes a Debian package build failure introduced by commit 9840bdbd
"debian: Install ovs-vswitchd.conf.db(5) manpage."  I did test that commit
but the build failure didn't show up in my environment (probably I had a
stray file left over from development).

12 years agodatapath: Define net_device_ops->ndo_get_stats64() for internal_dev.
Pravin B Shelar [Fri, 4 Nov 2011 20:32:27 +0000 (13:32 -0700)]
datapath: Define net_device_ops->ndo_get_stats64() for internal_dev.

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

12 years agodatapath: Convert internal_dev to ndo_fix_features.
Pravin B Shelar [Fri, 4 Nov 2011 20:31:45 +0000 (13:31 -0700)]
datapath: Convert internal_dev to ndo_fix_features.

From 2.6.39 kernel netdev features are set using set_features and
fix_features APIs. Since internal-dev does not need any special
checks on setting feature, there is no need to define set_features
or fix_features. Only hw_features needs to be set to features that
are supported by internal-dev.

Following patch does same and drops discrete offload setting ops for
newer kernel.

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

12 years agometa-flow: Update mf_field description of size.
Justin Pettit [Sun, 30 Oct 2011 03:31:00 +0000 (20:31 -0700)]
meta-flow: Update mf_field description of size.

Commit 7257b5 (Implement new fragment handling policy.) added a new
"is_frag" meta-field that used fewer bits than the width of the field.
A comment in mf_field lists these cases, but "is_frag" wasn't included.
This commit updates that.

12 years agonx-match: Increase upper bound length for an nx_match.
Justin Pettit [Sun, 30 Oct 2011 03:04:21 +0000 (20:04 -0700)]
nx-match: Increase upper bound length for an nx_match.

Commits d2c0fed (nicira-ext: Bump number of registers to five from
four.) and 7257b5 (Implement new fragment handling policy.) added new
match fields, but didn't update the maximum length of an NXM message.
This commit increases the maximum NXM size to 384 bytes.

12 years agotests: Provide banner for ODP tests.
Justin Pettit [Mon, 31 Oct 2011 21:32:08 +0000 (14:32 -0700)]
tests: Provide banner for ODP tests.

Previously, the ODP tests were being grouped together with the ovs-ofctl
ones, which is clearly not right.  This commit puts it in its own
"datapath parsing and formatting" group.

12 years agoovs-ofctl: Correct bad reference in parse-flows error message.
Justin Pettit [Thu, 3 Nov 2011 06:27:24 +0000 (23:27 -0700)]
ovs-ofctl: Correct bad reference in parse-flows error message.

12 years agobond: Only drop packets that indicate moves on SLB bonds.
Ben Pfaff [Fri, 28 Oct 2011 20:27:27 +0000 (13:27 -0700)]
bond: Only drop packets that indicate moves on SLB bonds.

SLB bonds, for important reasons, drop most incoming packets that indicate
that a MAC has moved to the bond from another port.  These reasons do not
apply to other types of bonds, but until now OVS has still dropped them.

This fixes the problem.  It changes behavior of active-backup bonds and
stable bonds, neither of which has the same problem as SLB.  Behavior of
SLB bonds and TCP bonds in SLB fallback mode is unaffected.

Bug #7928.

12 years agodebian: Install ovs-vswitchd.conf.db(5) manpage.
Ben Pfaff [Fri, 4 Nov 2011 16:57:50 +0000 (09:57 -0700)]
debian: Install ovs-vswitchd.conf.db(5) manpage.

This manpage wasn't getting installed.  This fixes it.

The --language=C option to dh_installman is necessary to keep that script
from thinking that the ".db" suffix indicates a translation into the "db"
language (which doesn't actually exist) and therefore installing it into
the wrong directory with the .db suffix stripped.

Bug #8138.
Reported-by: Ethan Jackson <ethan@nicira.com>
12 years agodatapath: Don't set flags on internal vports.
Jesse Gross [Fri, 4 Nov 2011 01:12:09 +0000 (18:12 -0700)]
datapath: Don't set flags on internal vports.

We currently set netdev->flags to IFF_BROADCAST | IFF_MULTICAST
but this is unnecessary because it's already done by ether_setup().

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agocfm: Support tagged CCM PDUs.
Ethan Jackson [Thu, 3 Nov 2011 20:03:16 +0000 (13:03 -0700)]
cfm: Support tagged CCM PDUs.

This patch also causes eth_compose() to set the l2 and l3 pointers
of the packets which it modifies.

12 years agodatapath: Fix indentation in pop_vlan().
Ben Pfaff [Wed, 2 Nov 2011 17:46:53 +0000 (10:46 -0700)]
datapath: Fix indentation in pop_vlan().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoofproto-dpif: Use send_packet() instead of netdev_send().
Jesse Gross [Sun, 23 Oct 2011 00:22:11 +0000 (17:22 -0700)]
ofproto-dpif: Use send_packet() instead of netdev_send().

netdev_send() directly sends a packet using Linux mechanisms, skipping
our kernel module. Several upper layer abstractions are built on top of
the kernel module, so this means that we loose stats, sFlow, etc. on
these packets. This changes bonding, LACP, and STP to use send_packet()
as CFM does, which uses the standard kernel mechanisms and provides a
single place that needs to be updated.

12 years agodatapath: Drop useless WARN_ON_ONCE during flow conversion.
Jesse Gross [Tue, 1 Nov 2011 22:35:31 +0000 (15:35 -0700)]
datapath: Drop useless WARN_ON_ONCE during flow conversion.

This checks whether key_len is not zero but we set the key length
at the beginning of the function, so I don't see this as a useful
check.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Add IPv6 to list of parsed EtherTypes.
Jesse Gross [Tue, 1 Nov 2011 22:25:14 +0000 (15:25 -0700)]
datapath: Add IPv6 to list of parsed EtherTypes.

The kernel can parse IPv6, so if it receives a flow with an IPv6
EtherType then it expects to get IPv6 information as well.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agostream: Fix uninitialized values in stream_init().
Ben Pfaff [Wed, 2 Nov 2011 19:59:06 +0000 (12:59 -0700)]
stream: Fix uninitialized values in stream_init().

stream_init() didn't initialize the remote_ip, remote_port, local_ip, or
local_port members of the stream, so "unix" streams that don't have any of
those would get random values instead.

Reported-by: "Voravit T." <voravit@kth.se>
Reported-by: Jari Sundell <sundell.software@gmail.com>
12 years agoofproto: Reject invalid input ports in OFPT_PACKET_OUT requests.
Ben Pfaff [Thu, 8 Sep 2011 18:25:29 +0000 (11:25 -0700)]
ofproto: Reject invalid input ports in OFPT_PACKET_OUT requests.

Some invalid ports (those above the maximum port number supported by the
datapath, including OpenFlow reserved ports that are not translated by OVS
into some other number) will be rejected by the datapath.  It's better to
catch these early and send back an appropriate OpenFlow error code, rather
than to just get EINVAL from the kernel and have to guess at the problem.

Reported-by: Aaron Rosen <arosen@clemson.edu>
12 years agoofproto: Add error code for bad role.
Ben Pfaff [Thu, 8 Sep 2011 18:19:37 +0000 (11:19 -0700)]
ofproto: Add error code for bad role.

12 years agoofproto: Issue OpenFlow error for bad table IDs.
Ben Pfaff [Thu, 8 Sep 2011 18:18:53 +0000 (11:18 -0700)]
ofproto: Issue OpenFlow error for bad table IDs.

12 years agoofproto: Consistently log OpenFlow error replies.
Ben Pfaff [Thu, 8 Sep 2011 18:17:54 +0000 (11:17 -0700)]
ofproto: Consistently log OpenFlow error replies.

Until now, logging of OpenFlow error replies sent to controllers has been
haphazard.  This commit logs them centrally, ensuring that every OpenFlow
error sent to a controller is logged.

At the same time, we can eliminate the individual log messages that a few
OpenFlow errors triggered.

12 years agoofp-util: New function ofputil_decode_msg_type_partial().
Ben Pfaff [Thu, 27 Oct 2011 19:54:44 +0000 (12:54 -0700)]
ofp-util: New function ofputil_decode_msg_type_partial().

12 years agoovs-appctl: Add fdb/flush command
Ansis Atteka [Tue, 1 Nov 2011 19:08:04 +0000 (12:08 -0700)]
ovs-appctl: Add fdb/flush command

Added a new command that will allow to flush particular bridge's
MAC learning table.

Issue #7819

12 years agopackaging: dpkg --purge command fails on Ubuntu 11.04
Ansis Atteka [Tue, 1 Nov 2011 18:08:24 +0000 (11:08 -0700)]
packaging: dpkg --purge command fails on Ubuntu 11.04

The problem is that postrm script is unable to remove
contents of /var/log/openvswitch/ directory in case if
it contains any other directories. Steps to reproduce
on Ubuntu 11.04:
1. apt-get install openvswitch-switch
2. dpkg --purge openvswitch-switch
3. observe that purge failed, because of an empty "cores"
directory inside /var/log/openvswitch/

12 years agoopenvswitch.h: Add missing words in comment.
Ben Pfaff [Tue, 1 Nov 2011 21:16:41 +0000 (14:16 -0700)]
openvswitch.h: Add missing words in comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodatapath: Convert kernel priority actions into match/set.
Pravin B Shelar [Tue, 1 Nov 2011 17:13:16 +0000 (10:13 -0700)]
datapath: Convert kernel priority actions into match/set.

Following patch adds skb-priority to flow key. So userspace will know
what was priority when packet arrived and we can remove the pop/reset
priority action. It's no longer necessary to have a special action for
pop that is based on the kernel remembering original skb->priority.
Userspace can just emit a set priority action with the original value.

Since the priority field is a match field with just a normal set action,
we can convert it into the new model for actions that are based on
matches.

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

12 years agoAUTHORS: Add Edward Tomasz Napierała.
Ben Pfaff [Tue, 1 Nov 2011 16:25:03 +0000 (09:25 -0700)]
AUTHORS: Add Edward Tomasz NapieraÅ‚a.

12 years agoFix build on FreeBSD.
Edward Tomasz Napierała [Tue, 1 Nov 2011 12:25:49 +0000 (13:25 +0100)]
Fix build on FreeBSD.

Patch below fixes build on FreeBSD; tested on 10.0-CURRENT.

Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agonetdev-vport: Again allow "tap" devices to be added to bridges.
Ben Pfaff [Mon, 31 Oct 2011 17:54:30 +0000 (10:54 -0700)]
netdev-vport: Again allow "tap" devices to be added to bridges.

I did not check that tap devices otherwise work.  This at least allows
them to be part of a bridge again.

Reported-by: Janis Hamme <janis.hamme@student.kit.edu>
12 years agoofproto: Add OFPC_QUEUE_STATS to switch feature reply.
Ben Pfaff [Sat, 29 Oct 2011 17:08:42 +0000 (10:08 -0700)]
ofproto: Add OFPC_QUEUE_STATS to switch feature reply.

Open vSwitch has supported queue stats for a long time, but we forgot to
set the OFPC_QUEUE_STATS bit in the switch features reply to show that they
are supported.  This fixes it.

12 years agoovsdb-idl: Prevent occasional hang when multiple database clients race.
Ben Pfaff [Mon, 31 Oct 2011 16:15:14 +0000 (09:15 -0700)]
ovsdb-idl: Prevent occasional hang when multiple database clients race.

When a client of the IDL tries to commit a read-modify-write transaction
but the database has changed in the meantime, the IDL tells its client to
wait for the IDL to change and then try the transaction again by returning
TXN_TRY_AGAIN.  The "wait for the IDL to change" part is important because
there's no point in retrying the transaction before the IDL has received
the database updates (the transaction would fail in the same way all over
again).

However, the logic was incomplete: the database update can be received
*before* the reply to the transaction RPC (I think that in the current
ovsdb-server implementation this will always happen, in fact).  When this
happens, the right thing to do is to retry the transaction immediately;
if we wait, then we're waiting for an additional change to the database
that may never come, causing an indefinite hang.

This commit therefore breaks the "try again" IDL commit status code
into two, one that means "try again immediately" and another that means
"wait for a change then try again".  When an update is processed after a
transaction is committed but before the reply is received, the "try again
now" tells the IDL client not to wait for another database change before
retrying its transaction.

Bug #5980.
Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
Reproduced-by: Alex Yip <alex@nicira.com>
12 years agonicira-ext: New action "exit".
Ethan Jackson [Fri, 28 Oct 2011 21:46:42 +0000 (14:46 -0700)]
nicira-ext: New action "exit".

The exit action causes the switch to immediately halt processing of
further actions. It's intended to be used in conjunction with
multi table support.  It allows a table to force tables which call
it to discontinue processing a flow.

12 years agobundle: Parsing bug when using bracketed syntax.
Ethan Jackson [Thu, 27 Oct 2011 23:58:20 +0000 (16:58 -0700)]
bundle: Parsing bug when using bracketed syntax.

This patch fixes the issue and adds a test which would have caught
it.

Reported-by: Michael Mao <mmao@nicira.com>
Bug #8045.

12 years agonicira-ext: Fix stale documentation in the bundle action.
Ethan Jackson [Thu, 27 Oct 2011 18:58:31 +0000 (11:58 -0700)]
nicira-ext: Fix stale documentation in the bundle action.

12 years agobundle: Don't special case OFPP_LOCAL in bundle actions.
Ethan Jackson [Wed, 26 Oct 2011 23:13:31 +0000 (16:13 -0700)]
bundle: Don't special case OFPP_LOCAL in bundle actions.

The OFPP_LOCAL port is a real port with a carrier status.  There
isn't a good reason to ignore this data when implementing the
bundle action.

12 years agobundle: Allow OFPP_NONE in bundle actions.
Ethan Jackson [Wed, 26 Oct 2011 23:10:26 +0000 (16:10 -0700)]
bundle: Allow OFPP_NONE in bundle actions.

This patch special cases OFPP_NONE to be always up in bundle
actions.  Presumably, if a controller put OFPP_NONE in their bundle
action, they want it to be an available choice.

This patch also adds documentation to the bundle action about slave
liveness.

12 years agoofp-print: Pretty-print payloads in all error messages, except "hello"s.
Ben Pfaff [Fri, 30 Sep 2011 18:01:49 +0000 (11:01 -0700)]
ofp-print: Pretty-print payloads in all error messages, except "hello"s.

This function was only pretty-printing "bad request" error payloads.  I
don't know why.  It makes sense to pretty-print all of them except for
"hello" messages, which already have their own special cases.

Suggestion #7369.
Suggested-by: Reid Price <reid@nicira.com>
12 years agoovsdb-idl: Don't even try to modify synthetic rows, instead of segfaulting.
Ben Pfaff [Wed, 26 Oct 2011 22:46:48 +0000 (15:46 -0700)]
ovsdb-idl: Don't even try to modify synthetic rows, instead of segfaulting.

Synthetic rows lack a lot of important metadata that the IDL adds to rows
actually obtained from the database, and it's impractical to add that
metadata to synthetic rows.  This means that the IDL functions to modify
these rows dereference null pointers and segfault.  So, it's really
important not to pass synthetic rows to such functions.  However, we've
screwed this up a number of times now and in the end it seems that it's
probably better to just ignore attempts to modify these rows.  This commit
implements that.

Feature #8013.
Reported-by: Ethan Jackson <ethan@nicira.com>
12 years agoFix manpage-check on RHEL 5.
Ben Pfaff [Thu, 27 Oct 2011 16:39:24 +0000 (09:39 -0700)]
Fix manpage-check on RHEL 5.

The version of groff on RHEL 5 doesn't include the .SY, .OP, or .YS macros
that ovs-benchmark.1 uses, so the manpage-check target fails on that
platform.  This commit adds the groff definitions of those macros to a
file and includes it into ovs-benchmark.1.

I tested that this allows RHEL 5 to pass manpage-check.

12 years agotests: Fix intermittent failure in ovs-monitor-ipsec test.
Jesse Gross [Thu, 27 Oct 2011 04:14:46 +0000 (21:14 -0700)]
tests: Fix intermittent failure in ovs-monitor-ipsec test.

The ovs-monitor-ipsec test waits for a specific number of lines
of output before doing a comparison to the correct values.  However,
some copy and pasted code did not update the number of lines to
look for resulting in a race condition where the comparison could
happen before the script finished running.

12 years agoImprove manpage checking rule.
Ben Pfaff [Wed, 26 Oct 2011 23:11:32 +0000 (16:11 -0700)]
Improve manpage checking rule.

The coverage of the previous version of this rule was incomplete because
$(MANS) does not include $(noinst_man_MANS).   (Also, $(MANS) is
undocumented.)  Writing it out as the list of manpages variables that
Open vSwitch uses is better.

Also, the previous version of the rule didn't actually signal an error
when warnings appeared.  It looks like troff doesn't have a way to indicate
warnings as part of its exit status, so instead we grep the output for
"warning".

12 years agoImplement automatic dependency generation for manpages.
Ben Pfaff [Wed, 26 Oct 2011 23:06:37 +0000 (16:06 -0700)]
Implement automatic dependency generation for manpages.

This ensures that manpages actually get rebuilt if any of the lib/*.man
fragments that they depend upon are modified.

12 years agoMove soexpand.pl into build-aux and make it non-executable.
Ben Pfaff [Thu, 25 Aug 2011 18:15:27 +0000 (11:15 -0700)]
Move soexpand.pl into build-aux and make it non-executable.

Scripts for the build generally go in build-aux, so move soexpand.pl.
soexpand.pl had the "executable" bit set, but it doesn't have a #! line
and it's not a shell script, so that didn't make sense.

12 years agovswitch: Don't update STP on synthetic ports.
Ethan Jackson [Wed, 26 Oct 2011 18:39:46 +0000 (11:39 -0700)]
vswitch: Don't update STP on synthetic ports.

This can cause ovs-vswitchd to crash.

Bug #8007.
Reported-by: Krishna Miriyala <krishna@nicira.com>
12 years agoPrepare for post-1.3.0 (1.3.90).
Justin Pettit [Tue, 25 Oct 2011 19:37:26 +0000 (12:37 -0700)]
Prepare for post-1.3.0 (1.3.90).

12 years agoDeclare the version as "1.3.0".
Justin Pettit [Tue, 25 Oct 2011 06:37:11 +0000 (23:37 -0700)]
Declare the version as "1.3.0".

12 years agodatapath: Improve <linux/openvswitch.h> comments.
Ben Pfaff [Tue, 25 Oct 2011 21:03:35 +0000 (14:03 -0700)]
datapath: Improve <linux/openvswitch.h> comments.

Generally we've used the comments to the right of attribute enums to
explain the types of the arguments and the ones above them to explain their
meaning.  This is a reasonable separation since it ensures that the type
of the argument is obvious, which in my opinion is important.

This updates a few comments to match this pattern.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodebian: Start ovs-monitor-ipsec after ovsdb running.
Justin Pettit [Mon, 24 Oct 2011 21:40:58 +0000 (14:40 -0700)]
debian: Start ovs-monitor-ipsec after ovsdb running.

ovs-monitor-ipsec uses the OVS database to get configuration, so don't
bother starting the daemon until it's up.

Debian recently switched to using the LSB fields in the header of init
scripts to allow dependency-based boots.  This is described in the
following page:

    http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot

This commit makes use of those fields to get the ordering we want.

12 years agodatapath: Fully parenthesize ACTION macro.
Ben Pfaff [Mon, 24 Oct 2011 22:18:49 +0000 (15:18 -0700)]
datapath: Fully parenthesize ACTION macro.

This doesn't matter for any of the current users of ACTION, nor do I expect
it to matter, but it seems like a good idea nonetheless.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodatapath: Fix wrong indentation.
Ben Pfaff [Mon, 24 Oct 2011 22:14:56 +0000 (15:14 -0700)]
datapath: Fix wrong indentation.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodatapath: Add multicast tunnel support.
Ben Pfaff [Mon, 24 Oct 2011 19:27:36 +0000 (12:27 -0700)]
datapath: Add multicast tunnel support.

Something like this, on two separate vswitches, works to try it out:
    route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
    ovs-vsctl \
        -- add-port br0 gre0 \
        -- set interface gre0 type=gre options:remote_ip=224.0.0.1

Runtime tested on Linux 3.0, build tested on Linux 2.6.18, both i386.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoovs-dpctl: Add new "set-if" command.
Ben Pfaff [Mon, 17 Oct 2011 18:24:37 +0000 (11:24 -0700)]
ovs-dpctl: Add new "set-if" command.

I have found this useful for testing tunnel configuration.

12 years agodatapath: Disallow unknown attributes on OVS_ACTION_ATTR_SAMPLE action.
Ben Pfaff [Mon, 24 Oct 2011 17:40:52 +0000 (10:40 -0700)]
datapath: Disallow unknown attributes on OVS_ACTION_ATTR_SAMPLE action.

Bug #7932.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoofproto-dpif: Fix uninitialized struct member in xlate_actions().
Ben Pfaff [Mon, 24 Oct 2011 16:58:35 +0000 (09:58 -0700)]
ofproto-dpif: Fix uninitialized struct member in xlate_actions().

Commit 7257b535ab "Implement new fragment handling policy." moved around
a bunch of initialization code in xlate_actions() so that the assignment
to ctx->flow.tp_src and .tp_dst would not have to also assign to
ctx->base_flow.tp_src and .tp_dst.  However, this meant that the early-exit
"return" in the new switch statement exited without initializing a lot of
the context.  In particular 'may_set_up_flow' didn't get initialized, so
something the early-exit would produce a flow that couldn't be installed,
which wasn't the intent.

It seems that this optimization was a bad tradeoff, so this commit puts
all of the initialization up front and just assigns to both copies of the
tp_src and tp_dst members.

Fixes a nondeterministic "make check" failure in the VLAN handling test.

12 years agotest-openflowd: Remove.
Ben Pfaff [Mon, 24 Oct 2011 17:36:01 +0000 (10:36 -0700)]
test-openflowd: Remove.

Some users were still confused by its presence.

12 years agoofproto: Check for overlapping flows only in the target table.
Ben Pfaff [Wed, 19 Oct 2011 23:03:31 +0000 (16:03 -0700)]
ofproto: Check for overlapping flows only in the target table.

There's no reason to check for overlapping flows in table A if the flow
is going to be inserted into table B.

(I doubt anyone actually uses OFPFF_CHECK_OVERLAP though.)

12 years agoofproto-dpif: Fix htons() that should be ntohs().
Ben Pfaff [Mon, 24 Oct 2011 16:23:18 +0000 (09:23 -0700)]
ofproto-dpif: Fix htons() that should be ntohs().

Not a real bug since htons() and ntohs() do the same thing on all
interesting target platforms.

Found by sparse.

12 years agoovsdb-tool: Make "show-log" convert raw JSON to easier-to-read syntax.
Ben Pfaff [Thu, 6 Oct 2011 18:25:25 +0000 (11:25 -0700)]
ovsdb-tool: Make "show-log" convert raw JSON to easier-to-read syntax.

Now output that formerly looked like ["map", [["key1", "value1"], ["key2",
"value2"]]] is printed like {key1=value1, key2=value2}, which I find easier
to read.

12 years agoovsdb-tool: Add abbreviated UUIDs to "show-log" even when we have a name.
Ben Pfaff [Thu, 6 Oct 2011 18:23:54 +0000 (11:23 -0700)]
ovsdb-tool: Add abbreviated UUIDs to "show-log" even when we have a name.

The "show-log" command tries to give names to the rows to make it easier to
understand what's going on, but it's still important to see at least
partial UUIDs so that one can search the output for references to the rows
by UUID.

12 years agoDESIGN: Document multiple table support.
Ben Pfaff [Thu, 29 Sep 2011 18:34:03 +0000 (11:34 -0700)]
DESIGN: Document multiple table support.

Suggested-by: Justin Pettit <jpettit@nicira.com>
Suggested-by: Michael Mao <mmao@nicira.com>
12 years agoovs-bugtool: Improve how Open vSwitch log files are saved.
Ben Pfaff [Mon, 24 Oct 2011 16:14:12 +0000 (09:14 -0700)]
ovs-bugtool: Improve how Open vSwitch log files are saved.

This moves the OVS log files from the "network-status" capability, which
has a very small maximum size, to the "system-logs" capability, which is
much larger.  It ensures that the newest OVS log files are prioritized over
old versions of system log files (if we just added the OVS log files after
the existing file_output, then new OVS log files would only be included
*after* all archived system log files were added).

Bug #5443.

12 years agodatapath: Cleanup openvswitch.h formatting.
Jesse Gross [Sun, 23 Oct 2011 01:50:44 +0000 (18:50 -0700)]
datapath: Cleanup openvswitch.h formatting.

The userspace/kernel interface file had acquired a mixture of userspace
and kernel style, so this makes it use kernel style consistently.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Define constants for versions of GENL families.
Jesse Gross [Sun, 23 Oct 2011 01:22:18 +0000 (18:22 -0700)]
datapath: Define constants for versions of GENL families.

Currently we hard code the versions of our GENL families to 1 but it's
nicer to have symbolic constants.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agoovs-vswitchd: Add support for 802.1D STP.
Justin Pettit [Fri, 14 Oct 2011 16:48:17 +0000 (09:48 -0700)]
ovs-vswitchd: Add support for 802.1D STP.

Still alpha quality, since only tested for interoperability with Linux
bridge's STP implementation.

12 years agoofproto: Add function to set OpenFlow state and update controller.
Justin Pettit [Fri, 14 Oct 2011 22:45:14 +0000 (15:45 -0700)]
ofproto: Add function to set OpenFlow state and update controller.

This will be used in an upcoming commit.

12 years agoofproto: Mark 'ofproto' arg in is_mirror_output_bundle() as const.
Justin Pettit [Mon, 10 Oct 2011 23:44:28 +0000 (16:44 -0700)]
ofproto: Mark 'ofproto' arg in is_mirror_output_bundle() as const.

No changes are made to 'ofproto', so it's safe to mark the argument as
const.  This will be useful in a later commit.

12 years agoVarious bug fixes and cleanups to STP library.
Justin Pettit [Fri, 14 Oct 2011 16:48:43 +0000 (09:48 -0700)]
Various bug fixes and cleanups to STP library.

    - Don't apply endian conversions to flags, which are 8 bits.
    - Use #defines for default times for use outside library.
    - Clarify our behavior when in STP_DISABLED state.
    - Add "aux" member to STP port struct to be able to refer back to
      the owning port.
    - Define macros to print STP bridge and port ids.
    - New helper function to get port id.
    - New helper function to convert speed to cost.
    - New functions to describe current role of port.

12 years agoAdd back 802.1D Spanning Tree Protocol (STP) library code.
Justin Pettit [Tue, 20 Sep 2011 22:08:05 +0000 (15:08 -0700)]
Add back 802.1D Spanning Tree Protocol (STP) library code.

At one point, the OVS distribution contained an IEEE 802.1D Spanning
Tree Protocol (STP) library written by Ben Pfaff and based on the
802.1D-1998 reference code.  It was never integrated into ovs-vswitchd,
so it was removed as part of commit ba18611 (Remove vestigial support
for Spanning Tree Protocol.)

This commit reintroduces the library, cleans up a few spots, and makes
it build cleanly against new code.  A future commit will have
ovs-vswitchd use this library.

12 years agopackets.h: Fix STP destination MAC address.
Justin Pettit [Sat, 8 Oct 2011 01:24:12 +0000 (18:24 -0700)]
packets.h: Fix STP destination MAC address.

12 years agoofproto: Fix comment describing ofport_modified().
Justin Pettit [Fri, 14 Oct 2011 22:48:05 +0000 (15:48 -0700)]
ofproto: Fix comment describing ofport_modified().

12 years agoovs-vsctl: Fix small formatting error in man page.
Justin Pettit [Wed, 5 Oct 2011 07:13:56 +0000 (00:13 -0700)]
ovs-vsctl: Fix small formatting error in man page.

12 years agoofproto-dpif: Update bundle when OFPPC_NO_FLOOD changed.
Justin Pettit [Mon, 17 Oct 2011 17:27:35 +0000 (10:27 -0700)]
ofproto-dpif: Update bundle when OFPPC_NO_FLOOD changed.

When the OFPPC_NO_FLOOD flag is toggled on the port, the "floodable"
member of the bundle was not updated.  This would cause OFPP_NORMAL to
not include the proper ports when flooding.  With this commit,
OFPPC_NO_FLOOD changes will cause the floodable members to be
recalculated.

Found by inspection.

12 years agodatapath: Use kfree_skb() only on error paths.
Ben Pfaff [Fri, 21 Oct 2011 23:38:35 +0000 (16:38 -0700)]
datapath: Use kfree_skb() only on error paths.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodatapath: Fix uninitialized variable warning.
Jesse Gross [Fri, 21 Oct 2011 22:19:33 +0000 (15:19 -0700)]
datapath: Fix uninitialized variable warning.

Commit 4edb9ae90e4092f5f56b9d914d2b88783c49860d "datapath: Refactor
actions in terms of match fields." introduced a spurious warning
because the compiler thinks a value might not have been assigned to
'err'.  In practice this can't happen because we've already validated
the actions.

CC: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
12 years agovport-capwap: Fix use-after-free on error path.
Ben Pfaff [Fri, 21 Oct 2011 22:34:25 +0000 (15:34 -0700)]
vport-capwap: Fix use-after-free on error path.

I originally meant just to fix the use of kfree_skb() instead of
consume_skb() on the success path, but then I realized that the failure
path returned an skb that it had just freed.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoImplement new fragment handling policy.
Ben Pfaff [Thu, 20 Oct 2011 04:33:44 +0000 (21:33 -0700)]
Implement new fragment handling policy.

Until now, OVS has handled IP fragments more awkwardly than necessary.  It
has not been possible to match on L4 headers, even in fragments with offset
0 where they are actually present.  This means that there was no way to
implement ACLs that treat, say, different TCP ports differently, on
fragmented traffic; instead, all decisions for fragment forwarding had to
be made on the basis of L2 and L3 headers alone.

This commit improves the situation significantly.  It is still not possible
to match on L4 headers in fragments with nonzero offset, because that
information is simply not present in such fragments, but this commit adds
the ability to match on L4 headers for fragments with zero offset.  This
means that it becomes possible to implement ACLs that drop such "first
fragments" on the basis of L4 headers.  In practice, that effectively
blocks even fragmented traffic on an L4 basis, because the receiving IP
stack cannot reassemble a full packet when the first fragment is missing.

This commit works by adding a new "fragment type" to the kernel flow match
and making it available through OpenFlow as a new NXM field named
NXM_NX_IP_FRAG.  Because OpenFlow 1.0 explicitly says that the L4 fields
are always 0 for IP fragments, it adds a new OpenFlow fragment handling
mode that fills in the L4 fields for "first fragments".  It also enhances
ovs-ofctl to allow users to configure this new fragment handling mode and
to parse the new field.

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

12 years agodatapath: Refactor actions in terms of match fields.
Pravin B Shelar [Fri, 21 Oct 2011 21:38:54 +0000 (14:38 -0700)]
datapath: Refactor actions in terms of match fields.

Almost all current actions can be expressed in the form of
push/pop/set <field>, where field is one of the match fields. We can
create three base actions and take a field. This has both a nice
symmetry and avoids inconsistencies where we can match on the vlan
TPID but not set it.
Following patch converts all actions to this new format.

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

12 years agodatapath: Update supported kernel check.
Pravin B Shelar [Fri, 21 Oct 2011 21:17:38 +0000 (14:17 -0700)]
datapath: Update supported kernel check.

Signed-off-by: Pravin Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agotunnel: Handle hh_cache access for Linux kernel 3.1
Pravin B Shelar [Fri, 21 Oct 2011 21:16:59 +0000 (14:16 -0700)]
tunnel: Handle hh_cache access for Linux kernel 3.1

From 3.1 kernel, struct dst_entry no longer has direct ref to hh_cache.
Following patch handles this case.

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