Ben Pfaff [Mon, 14 Nov 2011 22:02:43 +0000 (14:02 -0800)]
packets: New function eth_pop_vlan(), formerly dp_netdev_pop_vlan().
An upcoming commit will add a new user.
Ben Pfaff [Thu, 10 Nov 2011 00:17:19 +0000 (16:17 -0800)]
vlan-bitmap: New function vlan_bitmap_from_array__().
Ben Pfaff [Thu, 10 Nov 2011 00:16:10 +0000 (16:16 -0800)]
vlandev: New library for working with Linux VLAN devices.
Ben Pfaff [Thu, 10 Nov 2011 00:52:16 +0000 (16:52 -0800)]
netdev-linux: Reorganize slightly.
Ben Pfaff [Tue, 8 Nov 2011 21:50:13 +0000 (13:50 -0800)]
netdev: Remove netdev_get_vlan_vid().
It has no remaining users.
Ben Pfaff [Tue, 8 Nov 2011 21:53:38 +0000 (13:53 -0800)]
vswitchd: Remove special case for VLAN devices.
We introduced this special case before the XenServer integration was
complete. At that point, we were using VLAN devices on XenServer, with a
separate bridge for each VLAN, so we needed this special case. But no
version of OVS for any supported XenServer version uses VLAN devices this
way, so we can delete the special case.
Ben Pfaff [Wed, 23 Nov 2011 18:26:02 +0000 (10:26 -0800)]
ofproto-dpif: Support differing user/kernel packet parsing support.
Feature #4886.
Ben Pfaff [Wed, 23 Nov 2011 00:46:05 +0000 (16:46 -0800)]
ofproto-dpif: Factor NetFlow active timeouts out of flow expiration.
NetFlow active timeouts were only mixed in with flow expiration for
convenience: both processes need to iterate all the facets. But
an upcoming commit will change flow expiration to work in terms of
a new "subfacet" entity, so they will no longer fit together well.
This change could be seen as an optimization, since NetFlow active
timeouts don't ordinarily have to run as often as flow expiration,
especially when the flow expiration rate is stepped up due to a
large volume of flows.
Ben Pfaff [Mon, 14 Nov 2011 18:28:31 +0000 (10:28 -0800)]
bridge: Fix incorrect comments.
Ben Pfaff [Mon, 14 Nov 2011 21:12:56 +0000 (13:12 -0800)]
ofproto: Add "const" to ->rule_execute's "flow" parameter.
Ben Pfaff [Wed, 23 Nov 2011 21:17:38 +0000 (13:17 -0800)]
bridge: Avoid reading other_config columns with ovsdb_idl_get().
ovsdb_idl_get() doesn't work with synthetic records. Upcoming commits
will start synthesizing more ports and interfaces, so we should avoid
using ovsdb_idl_get().
In the long term it's probably a good idea to come up with a better way
to do synthetic database records, one that causes less trouble.
Bug #8457.
Ethan Jackson [Thu, 17 Nov 2011 00:31:05 +0000 (16:31 -0800)]
vswitch: Implement dscp column of the Queue table.
The dscp column of the queue table instructs Open vSwitch to mark
all traffic egressing the queue with the given DSCP bits in its tos
field.
Bug #7046.
Ethan Jackson [Tue, 22 Nov 2011 03:25:19 +0000 (19:25 -0800)]
ofproto-dpif: Simplify commit logic.
Before executing an output action, ofproto-dpif must commit the
changes it's made to the flow so they are reflected in the
packet. This code has been unnecessarily complex. This patch
attempts to simplify the code in the following ways.
- Commit in fewer places.
In an attempt to provide some optimization, the ofproto-dpif code
separated the commit and output composition steps so things like
flood actions could avoid redundant commits. This is a case of
premature optimization that makes the code significantly more
difficult to reason about. With this patch, commits happen only
when really necessary.
- Only perform full commits.
In an attempt to provide some optimization, the ofproto-dpif code
would allow callers to only commit the part of the flow that they
had modified by directly calling the relevant subroutine. This
practice made the code difficult to reason about and is thus
discontinued.
- Perform all output logic in one function.
All of the logic surrounding the datapath output action has been
placed in the compose_output_action__() function. Most callers
will use the compose_output_action() function which simply passes
reasonable defaults through to compose_output_action__().
Ethan Jackson [Tue, 22 Nov 2011 03:18:14 +0000 (19:18 -0800)]
ofproto-dpif: Properly update tos and ttl fields.
ofproto-dpif failed to update the base flow's tos and ttl fields
when preparing for an output action. This could cause redundant
updates of those fields in the datapath. A future patch adds a
test which could have caught the issue for the tos bits.
Jesse Gross [Tue, 22 Nov 2011 19:39:50 +0000 (11:39 -0800)]
datapath: Fix build after global symbol rename.
ovs_netdev_get_vport() did not get renamed in one of the blocks
for older kernels.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Jesse Gross [Tue, 22 Nov 2011 01:15:20 +0000 (17:15 -0800)]
datapath: Scope global symbols with ovs_ prefix.
OVS has quite a few global symbols that should be scoped with a
prefix to prevent collisions with other modules in the kernel.
Suggested-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 13 Oct 2011 00:04:13 +0000 (17:04 -0700)]
nx-match: Fold all of its data structures into mf_field.
This is less redundant.
Ben Pfaff [Mon, 21 Nov 2011 22:14:02 +0000 (14:14 -0800)]
flow: New functions for setting a VLAN VID or PCP value.
Ben Pfaff [Sat, 22 Oct 2011 20:11:48 +0000 (13:11 -0700)]
meta-flow: Split ICMP into ICMPv4 and ICMPv6.
NXM breaks ICMP into v4 and v6. An upcoming commit will drop all of the
NXM specific data in favor of mf_field, and so at that point we need to
have a separate mf_field for each NXM field. So, this commit splits
ICMP into v4 and v6 for meta-flow also.
Ethan Jackson [Mon, 21 Nov 2011 21:36:17 +0000 (13:36 -0800)]
dpif-netdev: Allow enqueue actions.
The dpif-netdev implementation disallowed enqueue actions because
it did not support conversion from OVS 'queue_id' to dpif
'priority'. For testing purposes, this patch allows queues which
translate into NOOPs.
Ethan Jackson [Fri, 18 Nov 2011 21:47:25 +0000 (13:47 -0800)]
ofproto-dpif: Test basic output and flooding.
This patch adds basic tests to ofproto-dpif which verify that
output and flood actions respect the relevant OFPPC flags, and do
not loop back to the in_port.
Ethan Jackson [Mon, 21 Nov 2011 18:59:41 +0000 (10:59 -0800)]
ovs-ofctl: Support OFPPC_NO_FWD.
Currently, there is no way to disable forwarding on an OpenFlow
port from the command line. This patch adds support for the
OFPPC_NO_FWD flag to the ovs-ofctl utility.
Ethan Jackson [Mon, 21 Nov 2011 18:38:57 +0000 (10:38 -0800)]
utilities: Update gitignore.
Ethan Jackson [Sat, 19 Nov 2011 03:00:34 +0000 (19:00 -0800)]
ofp-util: Support OFPP_LOCAL in enqueue actions.
According to the specification the enqueue action should refer to
"a valid physical port", or OFPP_IN_PORT. It would be strange to
attach a queueing discipline to the local port, but I see no reason
to restrict it.
Jesse Gross [Sat, 19 Nov 2011 22:29:19 +0000 (14:29 -0800)]
datapath: Remove unused variable in dp_notify.c.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Sat, 19 Nov 2011 22:26:02 +0000 (14:26 -0800)]
datapath: Always notify in initial namespace for port deletions.
We currently notify for port deletions in the namespace of the device
that was deleted. In general this should be initial namespace because
that's the only place where we look but it's possible that the device
was moved after being attached. However, it's not semantically correct
because we really care about the namespace of the userspace process, not
that of the device. This switches to genlmsg_multicast() which always
uses the initial namespace and seems more appropriate anyways.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Sat, 19 Nov 2011 21:45:48 +0000 (13:45 -0800)]
datapath: Directly use methods for protecting RCU/RTNL data.
We currently have a wrapper to protect the datapath ports array.
However, this can lead to confusion over exactly what lock is
protecting the access (either RTNL or RCU). This removes the
wrapper in favor of directly accessing the data, which also has
the benefit of being less permissive about what lock we allow so
it can be restricted to the one that we expect.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Sat, 19 Nov 2011 21:25:43 +0000 (13:25 -0800)]
datapath: Add genl_dereference() and use it.
We currently use a specialized version of what amounts to
genl_dereference() to protect the flow table. This prepares to
propose genl_dereference() upstream and uses it instead of our
version.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Sat, 19 Nov 2011 17:08:56 +0000 (09:08 -0800)]
datapath: Use u64_stats_sync for datapath and vport stats.
We currently use a seqcount to prevent reading partial 64-bit stats
on 32-bit CPUs. u64_stats_sync uses the same logic but elides it on
64-bit and uniprocessor machines. This improves performance (primarily
on non-x86 architectures) at the cost of not guaranteeing that packet
and byte counts were necessarily read together.
Suggested-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Thu, 17 Nov 2011 23:54:10 +0000 (15:54 -0800)]
datapath: Better handle vlan packets sent to userspace.
We no longer clone packets that are sent via the userspace action
because placing them in Netlink attributes makes a copy so we
generally don't touch the original. The one exception to this is
accelerated vlan tags, which are currently inserted into the
original packet as long as it isn't cloned. Although the clone
check prevents us from causing problems for past packets it has
issues for future processing:
* It turns accelerated tags into non-accelerated tags. This isn't
inherently a problem but some cards may not properly support
offloads with in-band tags.
* It doesn't update CHECKSUM_COMPLETE if there is one.
* If the operation fails, it will free the packet resulting in a
later use-after-free.
This patch fixes the above issues with a conservative approach.
It's possible to do it more efficiently but it probably doesn't
matter in most cases.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Ethan Jackson [Fri, 18 Nov 2011 00:47:49 +0000 (16:47 -0800)]
ofproto-dpif: Simplify output action composition.
Before this patch, the logic for outputting to a port was scattered
all around ofproto-dpif. This patch simplifies the code by forcing
it to use one code path to check if a port is forwarding, and
output if appropriate. Future patches will rely on this
simplification to implement new features.
Ethan Jackson [Fri, 18 Nov 2011 00:52:09 +0000 (16:52 -0800)]
ofproto-dpif: Improperly handled OFPP_ALL action.
According to the OpenFlow specification, the OFPP_ALL output to
every port except the input port regardless of whether or not they
are "blocked or link down". This patch implements this logic, and
marginally simplifies the interface of flood_packets().
Ethan Jackson [Fri, 18 Nov 2011 01:11:40 +0000 (17:11 -0800)]
ofproto-dpif: Enqueue incorrectly calls add_output_action().
The add_output_action() function takes an OpenFlow port number, but
the enqueue action passes it a datapath port number.
Ethan Jackson [Fri, 18 Nov 2011 01:11:04 +0000 (17:11 -0800)]
ofproto-dpif: Consistently set NetFlow Output Interface.
Some parts of the code set the NetFlow Output Interface to the
OpenFlow port. Other set it to the datapath port. This patch
consistently sets it to the OpenFlow port.
Ethan Jackson [Fri, 18 Nov 2011 00:56:17 +0000 (16:56 -0800)]
ofproto-dpif: Remove trailing whitespace.
Ethan Jackson [Fri, 18 Nov 2011 02:06:55 +0000 (18:06 -0800)]
tests: Allow unit tests to run as root.
The unit tests did not allow users to run them as root because
ovs-vswitchd would destroy all of the existing 'system' datapaths.
This patch prevents ovs-vswitchd from registering 'system'
datapaths when running unit tests preventing the issue.
Ansis Atteka [Fri, 18 Nov 2011 21:11:46 +0000 (13:11 -0800)]
packaging: Fix Xen and RH packaging error that was introduced with ovs-test utility
My previous ovs-test utility commit broke Xen and RH packaging.
This commit will address this issue by not including any ovs-test related
files into those two packages.
Jesse Gross [Fri, 18 Nov 2011 18:54:12 +0000 (10:54 -0800)]
datapath: Fix unaligned access when storing stats.
Both datapath and vport stats contain 64-bit members in a struct
but we write them directly in Netlink attributes which only
guarantee 32-bit alignment. This causes problems on RISC
architectures that care about alignment so this computes the stats
on the stack and then memcpy's them.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Ethan Jackson [Tue, 15 Nov 2011 01:02:44 +0000 (17:02 -0800)]
bond: Remove dead conditional.
Pravin B Shelar [Fri, 18 Nov 2011 19:48:01 +0000 (11:48 -0800)]
datapath: Fix pop_vlan().
Following patch fixes bug in pop_vlan code by updating ethernet
header len.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Ansis Atteka [Mon, 31 Oct 2011 21:56:08 +0000 (14:56 -0700)]
ovs-test: A new tool that allows to diagnose connectivity and performance issues
This tool will be a replacement for the current ovs-vlan-test
utility. Besides from connectivity issues it will also be able
to detect performance related issues in Open vSwitch setups.
Currently it uses UDP and TCP protocols for stressing.
Issue #6976
Ben Pfaff [Fri, 18 Nov 2011 01:11:53 +0000 (17:11 -0800)]
Implement a new port setting "other-config:priority-tags".
Linux hosts (and probably others) tend to ignore priority-tagged frames, so
this new setting allows Open vSwitch to suppress sending them.
Reported-by: Michael Mao <mmao@nicira.com>
Bug #8320.
Ethan Jackson [Thu, 17 Nov 2011 23:26:00 +0000 (15:26 -0800)]
ovs-dpctl: Suppress compiler warning on 64 bit linux.
utilities/ovs-dpctl.c:851:42: error: cast to pointer from integer
of different size [-Werror=int-to-pointer-cast]
Ethan Jackson [Thu, 17 Nov 2011 23:14:08 +0000 (15:14 -0800)]
ofproto: Remove dead variable.
Fixes the following gcc warning:
"error: variable ‘flow_vid’ set but not used
[-Werror=unused-but-set-variable]"
Justin Pettit [Thu, 17 Nov 2011 22:08:09 +0000 (14:08 -0800)]
ofproto-dpif: Fix segfault in mirror_update_dups().
Fixes crash introduced in 9ba15e (ofproto-dpif: Improve RSPAN
translation performance from O(n**2) to O(n).) The code always
dereferenced the members of the "mirrors" array in ofproto even if they
were null.
Jesse Gross [Thu, 17 Nov 2011 21:24:21 +0000 (13:24 -0800)]
datapath: Update startup banner.
The (to be) upstream version prints out "Open vSwitch switching
datapath" on module load. This updates the OVS tree to keep
them in sync.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Jesse Gross [Thu, 17 Nov 2011 21:21:39 +0000 (13:21 -0800)]
datapath: Fix whitespace error.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Ben Pfaff [Thu, 17 Nov 2011 18:46:03 +0000 (10:46 -0800)]
ofproto-dpif: Get rid of "struct dst".
struct dst is an intermediate form for OFPP_NORMAL translation that
has existed since the beginning of Open vSwitch development. It
has always been a bit ugly, since ideally we wouldn't need any intermediate
form at all. This commit eliminates it, which speeds up OFPP_NORMAL
translation.
struct dst was used earlier to eliminate duplicate packets in OFPP_NORMAL
output. Now, we have rules that eliminate duplicate packets in a cheaper
way.
OFPP_NORMAL outputs packets for two different reasons, forwarding and
mirroring, so those are the two possible sources of packet duplication.
Forwarding by itself never outputs two copies of a packet to a single port
on a given VLAN, and this is also true of mirroring by itself since commit
"ofproto-dpif: Improve RSPAN translation performance from O(n**2) to O(n)".
The only remaining possibility, then, is that forwarding and mirroring
between them duplicate an output packet. However, the algorithms are now
designed to prevent this. Forwarding will never output to a mirroring
destination output port. Forwarding will only output to a mirroring
output VLAN if the packet arrived on a mirroring output VLAN, and in that
case mirroring is disabled.
This commit has the side effect of improving behavior for VLAN output.
Previously, a packet that arrived with an 802.1Q tag with both VID and PCP
of 0 would be output with a similar tag in some cases; now it is
consistently stripped. This change is reflected in the unit test change.
We really need some unit tests for mirroring. I have not tested mirroring
behavior, only theorized about it (see above).
Ben Pfaff [Thu, 17 Nov 2011 18:24:05 +0000 (10:24 -0800)]
tests: Rewrite code for comparing sets of ODP actions.
The compare-odp-actions.pl utility isn't fully general, even for its
intended purpose of allowing sets of ODP actions to be compared
ignoring unimportant differences in ordering of output actions and
VLAN set actions. I decided that the proper way to do it was to have
a utility that can actually parse the actions, instead of just
doing textual transformations on them. So, this commit replaces
compare-odp-actions.pl by "ovs-dpctl normalize-actions", which is
sufficiently general for the intended purpose.
The new ovs-dpctl functionality can be easily extended to handle
differences in fields other than VLAN, but only VLAN is needed so
far.
This will be needed in an upcoming commit that in some cases
introduces redundant "set vlan" actions into the ODP actions, which
compare-odp-actions.pl doesn't tolerate.
Ben Pfaff [Fri, 11 Nov 2011 23:22:56 +0000 (15:22 -0800)]
odp-util: New function odp_actions_from_string().
An upcoming commit will add a user. The only planned users for now are
part of unit tests themselves, so it doesn't seem important to unit test
it.
Ben Pfaff [Wed, 26 Oct 2011 17:01:32 +0000 (10:01 -0700)]
odp-util: Add support for named ports to odp_flow_key_from_string().
Really the "trace" command should support this but in fact I need it for
an upcoming update to a test.
Ben Pfaff [Tue, 25 Oct 2011 23:54:42 +0000 (16:54 -0700)]
odp-util: New function factored out of put_userspace_action().
An upcoming patch to odp-util will add a new user, but this seems like a
reasonable change in any case.
Ben Pfaff [Tue, 25 Oct 2011 23:55:29 +0000 (16:55 -0700)]
odp-util: Code formatting improvements.
Ben Pfaff [Thu, 17 Nov 2011 17:57:40 +0000 (09:57 -0800)]
shash: New function shash_find_len().
This will acquire a user in an upcoming commit that uses it in parsing
without modifying the text being parsed or copying it.
Ben Pfaff [Tue, 25 Oct 2011 23:33:38 +0000 (16:33 -0700)]
flow: Rename flow_compare() to flow_compare_3way().
I like the _3way suffix convention. It makes the interpretation of the
return value clear. We use it elsewhere in the tree, so use it here too.
There weren't any users of flow_compare() outside of flow.h, but there soon
will be.
Ben Pfaff [Wed, 5 Oct 2011 23:33:57 +0000 (16:33 -0700)]
ofproto-dpif: Improve RSPAN translation performance from O(n**2) to O(n).
This code previously checked whether each individual mirror output was
already in the set of destinations. This is O(n**2) in the number of
ports in a bridge.
The new code uses a smarter algorithm to eliminate duplicates, one that is
O(n) in the number of ports in a bridge.
Ben Pfaff [Wed, 5 Oct 2011 22:42:17 +0000 (15:42 -0700)]
ofproto-dpif: Make compose_mirror_dsts() harder to screw up.
I came close to add a "continue;" inside the main "while" loop in
compose_mirror_dsts(), which would have turned it into an infinite loop.
This commit changes it to a "for" loop that is harder to screw up.
Ben Pfaff [Fri, 11 Nov 2011 23:25:49 +0000 (15:25 -0800)]
ofproto-dpif: Remove duplicate VLAN logic.
flow_get_vlan() duplicated the logic in input_vid_to_vlan() in an
unclear way and added some logic of its own to detect invalid
input VLANs. This commit eliminates the duplication and makes the
code easier to understand.
Ben Pfaff [Wed, 5 Oct 2011 22:26:49 +0000 (15:26 -0700)]
ofproto-dpif: Do not output RSPAN packets to SPAN ports.
It's always been my intention that ports used as port mirroring
destinations (SPAN) be reserved solely for that purpose. When SPAN and
RSPAN are both configured, however, RSPAN mirror packets could get directed
to SPAN ports, which was unintentional.
This commit also updates the documentation to make it clear (if that is
even necessary) that this behavior is intentional.
Found by inspection.
Ben Pfaff [Thu, 17 Nov 2011 18:11:12 +0000 (10:11 -0800)]
odp-util: Reorder OVS_KEY_ATTR_* cases for consistency.
This matches the order of their definition in openvswitch.h.
Reported-by: Justin Pettit <jpettit@nicira.com>
Alexey I. Froloff [Thu, 3 Nov 2011 17:30:04 +0000 (10:30 -0700)]
rhel: Add Red Hat network scripts integration.
[Spec file changes and some documentation updates by Ben Pfaff.]
Pravin B Shelar [Thu, 17 Nov 2011 00:52:24 +0000 (16:52 -0800)]
datapath: Dont export get_dp().
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@jessegross.com>
Jesse Gross [Thu, 17 Nov 2011 00:01:32 +0000 (16:01 -0800)]
datapath: Fix flow table sparse RCU annotations.
Some overzealous marking of pointers as __rcu caused sparse to flag
errors.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Jesse Gross [Wed, 16 Nov 2011 21:39:40 +0000 (13:39 -0800)]
datapath: Reformat copyright messages.
Many of our kernel copyright messages make reference to code being
copied from the Linux kernel, which is a bit odd for code in the
kernel. This changes them to use the standard GNU GPL boilerplate
instead. It does not change the actual license, which continues to
be GPLv2.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Ethan Jackson [Wed, 16 Nov 2011 02:35:26 +0000 (18:35 -0800)]
flow: flow_extract() improperly parses IPv6 TOS bits.
This problem could cause userspace to automatically evict IPv6
flows from the datapath which had TOS bits set.
Bug #8323.
Ben Pfaff [Wed, 16 Nov 2011 00:02:39 +0000 (16:02 -0800)]
datapath: Properly validate length of OVS_KEY_ATTR_ENCAP attributes.
Without this, every VLAN packet goes to userspace because VLAN flows
cannot be set up.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Justin Pettit [Tue, 15 Nov 2011 09:33:08 +0000 (01:33 -0800)]
ofproto: Disable STP when unregistering a port.
If a port is removed when spanning tree was configured on it, then the
system may crash, since the STP library will try to send packets out a
now non-existent port. This commit disables STP on ports when they are
destroyed.
Justin Pettit [Tue, 15 Nov 2011 08:20:09 +0000 (00:20 -0800)]
stp: Fix tick remainder calculation.
The spanning tree library keeps track of time to know how often it
should update its state and send out BPDUs. OVS is able to track time
in milliseconds, but STP uses a coarser-grained count (256 ticks per
second). To prevent losing milliseconds that didn't account for an
entire tick, the library keeps track of these remaining milliseconds. A
bug miscalculated the remainder and made it too high, which caused the
library to think time was passing more quickly than it was.
This bug wasn't noticeable on a quiet system, since STP only asks to be
woken every second. However, a system with a lot of activity would wake
OVS more frequently and have it call the subsystems' "run" functions.
Bug #8283
Justin Pettit [Mon, 14 Nov 2011 23:04:14 +0000 (15:04 -0800)]
stp: Track BPDU tx and rx counts.
When debugging spanning tree, it's useful to have counters about how
many BPDUs have been sent and received. This commit keeps track of
these counters and stores them in a new "statistics" column of the Port
table.
Feature #8103
Ben Pfaff [Tue, 15 Nov 2011 01:19:41 +0000 (17:19 -0800)]
datapath: Don't drop packets with partial vlan tags.
In the future it is likely that our vlan support will expand to
include multiply tagged packets. When this happens, we would
ideally like for it to be consistent with our current tagging.
Currently, if we receive a packet with a partial VLAN tag we will
automatically drop it in the kernel, which is unique among the
protocols we support. The only other reason to drop a packet is
a memory allocation error. For a doubly tagged packet, we will
parse the first tag and indicate that another tag was present but
do not drop if the second tag is incorrect as we do not parse it.
This changes the behavior of the vlan parser to match other protocols
and also deeper tags by indicating the presence of a broken tag with
the 802.1Q EtherType but no vlan information. This shifts the policy
decision to userspace on whether to drop broken tags and allows us to
uniformly add new levels of tag parsing.
Although additional levels of control are provided to userspace, this
maintains the current behavior of dropping packets with a broken
tag when using the NORMAL action because that is the correct behavior
for an 802.1Q-aware switch. The userspace flow parser actually
already had the new behavior so this corrects an inconsistency.
Reported-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Ben Pfaff [Mon, 14 Nov 2011 23:56:43 +0000 (15:56 -0800)]
datapath: Describe policy for extending flow key, implement needed changes.
When the datapath was converted to use Netlink attributes for describing
flow keys, I had a vague idea of how it could be smoothly extensible, but
I didn't actually implement extensibility or carefully think it through.
This commit adds a document that describes how flow keys can be extended
in a compatible fashion and adapts the existing interface to match what
it says.
This commit doesn't actually implement extensibility. I already have a
separate patch series out for that. This patch series borrows from that
one heavily, but the extensibility series will need to be reworked
somewhat once this one is in.
This commit is only lightly tested because I don't have a good test setup
for VLANs.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Ben Pfaff [Mon, 14 Nov 2011 23:09:01 +0000 (15:09 -0800)]
datapath: Allow flow key Netlink attributes to appear in any order.
This is more conventional use of Netlink.
For upstreaming, 'u64 attrs' can be changed to u32 and the uses of 1ULL
can be changed to 1.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Simon Horman [Mon, 14 Nov 2011 08:41:28 +0000 (17:41 +0900)]
Make unixctl_command_register() idempotent
The assert() statement in unixctl_command_register() implies that it is
intended to be idempotent but inserting the same name and callback twice
would fail because:
* The callback is not stored directly in the hash, rather it the
cb element of a struct unixctl_command which is stored in the hash.
* Insertion would be attempted even if the entry was already present.
Tyler Coumbes [Mon, 14 Nov 2011 17:08:03 +0000 (09:08 -0800)]
rhel: Add ability to enable bridge compatibility mode in /etc/sysconfig/openvswitch
Add the ability to enable bridge compatibility mode through BRCOMPAT
variable in /etc/sysconfig/openvswitch for the rhel build. When
BRCOMPAT is set to 'yes' the brcompat_mod will be loaded and
ovs-brcompatd daemon will be started.
Ben Pfaff [Thu, 10 Nov 2011 00:15:36 +0000 (16:15 -0800)]
openvswitch.h: Change OVS_KEY_ATTR_TUN_ID from 100 to 63.
It's useful to be able to track sets of attributes by using their values as
bit indexes. That's easier if the values are all in the range of a basic
C integer type.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Ben Pfaff [Fri, 11 Nov 2011 18:28:48 +0000 (10:28 -0800)]
datapath: Rearrange ovs_key_lens.
This seems clearer to me. It should not cause any behavioral change.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Sat, 12 Nov 2011 00:09:20 +0000 (16:09 -0800)]
datapath: Use correct ethernet addr len.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Ben Pfaff [Fri, 11 Nov 2011 23:10:55 +0000 (15:10 -0800)]
docs: Always build ovs-vswitchd.conf.db.5 in srcdir.
Otherwise we build it in the build directory by default, which breaks the
Debian package build (unless we're working from a "make dist" created
tarball since that has ovs-vswitchd.conf.db.5 in the srcdir as part of
the distribution).
Reported-by: Ansis Atteka <aatteka@nicira.com>
Tested-by: Ansis Atteka <aatteka@nicira.com>
Ben Pfaff [Thu, 10 Nov 2011 17:09:36 +0000 (09:09 -0800)]
ovs-ofctl: Document behavior when table=255 is specified.
Reported-by: Michael Mao <mmao@nicira.com>
Ben Pfaff [Thu, 10 Nov 2011 00:24:19 +0000 (16:24 -0800)]
classifier: Use HMAP_FOR_EACH, HMAP_FOR_EACH_CONTINUE.
I like how this removes over 20 lines of code and ends up more readable.
Ben Pfaff [Mon, 7 Nov 2011 17:21:03 +0000 (09:21 -0800)]
netlink: Refactor and simplify nl_policy_parse().
Ben Pfaff [Tue, 1 Nov 2011 21:48:44 +0000 (14:48 -0700)]
netlink: Use NL_ATTR_FOR_EACH in nl_policy_parse().
I don't see a reason not to use it and it simplifies the code a lot.
Ben Pfaff [Mon, 7 Nov 2011 17:21:17 +0000 (09:21 -0800)]
netlink: New macro NL_POLICY_FOR.
Ben Pfaff [Mon, 7 Nov 2011 21:19:38 +0000 (13:19 -0800)]
odp-util: Use ovs_key_attr_to_string() names in format_odp_key_attr().
Ben Pfaff [Mon, 7 Nov 2011 17:14:46 +0000 (09:14 -0800)]
odp-util: Adjust style.
Usually we don't put a new-line in prototypes unless we have to. I also
think that this comment deserves to be higher up in the file, so I moved
it.
Ben Pfaff [Mon, 7 Nov 2011 17:13:53 +0000 (09:13 -0800)]
odp-util: Trigger warning for unhandled attrs in format_odp_key_attr().
I usually do things this way but must have overlooked this one a while ago.
Ben Pfaff [Mon, 7 Nov 2011 21:13:36 +0000 (13:13 -0800)]
odp-util: New function ovs_key_attr_to_string().
This seems like a worthwhile improvement in itself, but it will also see
additional users in upcoming commits.
Ben Pfaff [Wed, 2 Nov 2011 00:13:06 +0000 (17:13 -0700)]
openvswitch.h: Improve comments.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Fri, 11 Nov 2011 03:35:37 +0000 (19:35 -0800)]
datapath: remove actions.h
There are only two symbols in actions.h. Compatibility function
is moved to compat.h and execute_actions() declaration is moved
to datapath.h
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Fri, 11 Nov 2011 03:34:27 +0000 (19:34 -0800)]
datapath: Don't use Nicira's OUI for generating mac-address.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Fri, 11 Nov 2011 03:33:15 +0000 (19:33 -0800)]
datapath: Remove unnecessary definition of is_internal_vport()
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Pravin B Shelar [Fri, 11 Nov 2011 03:31:24 +0000 (19:31 -0800)]
datapath: Use skb_copy_and_csum_dev() to csum upcall packet.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Justin Pettit [Thu, 10 Nov 2011 07:54:33 +0000 (23:54 -0800)]
flow: htons() zero initializers to make their size more clear.
Justin Pettit [Thu, 10 Nov 2011 07:39:16 +0000 (23:39 -0800)]
flow: Use FWW_ flags to wildcard IP DSCP and ECN.
It's no longer necessary to maintain a "nw_tos_mask" wildcard member,
since we only care about completely wildcarding the DSCP and ECN
portions of the IP TOS field. This commit makes that change. It also
goes a bit further in internally using "tos" to refer to the entire TOS
field (ie, DSCP and ECN). We must still refer to the DSCP portions as
"nw_tos" externally through OpenFlow 1.0, since that's the convention it
uses.
Justin Pettit [Thu, 10 Nov 2011 01:49:49 +0000 (17:49 -0800)]
ofp-util: Rename MAY_IPV6_ADDR to MAY_IPV6.
The MAY_IPV6_ADDR function now includes the IPv6 flow label, so it is
clearer to just call it MAY_IPV6.
Justin Pettit [Thu, 10 Nov 2011 01:42:17 +0000 (17:42 -0800)]
classifier: Don't check masks when adding IPv4/IPv6 addresses.
The meta-flow code enforces IPv4/IPv6 masks, so there's no reason to do
it again in the classifier. This allows a number of functions to be
removed, since the only callers were in this classifier code.
Justin Pettit [Thu, 10 Nov 2011 01:10:27 +0000 (17:10 -0800)]
Prepend "nw_" to "frag" and "tos" elements.
Most of the members in structures referring to network elements indicate
the layer (e.g., "tl_", "nw_", "tp_"). The "frag" and "tos" members
didn't, so this commit add them.
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>
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>
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>