Justin Pettit [Fri, 26 Aug 2011 22:05:53 +0000 (15:05 -0700)]
bridge: Make bridge_pick_local_hw_addr() easier to reason.
The use of eth_addr_is_multicast() to see if a reasonable address was
found always caused me momentary confusion. This commit uses a flag
instead, and also saves a bit of unnecessary array reading and writing.
Simon Horman [Fri, 26 Aug 2011 09:03:42 +0000 (18:03 +0900)]
debian: Transition to dh_python2
dh_pysupport that the packaging used until now is deprecated, with
dh_python2 as its successor.
This commit removes the PYTHONPATH setting from
debian/openvswitch-ipsec.init because it is not needed, as the Python
packaging is public. In fact, the Python packaging was public,
unintentionally, before, so the PYTHONPATH could have been removed earlier.
Chuck Short [Tue, 23 Aug 2011 22:37:11 +0000 (15:37 -0700)]
debian: Apply Ubuntu patch to add DKMS support.
I tested that installing openvswitch-datapath-dkms worked OK on my own
Debian machine.
The bulk of this patch is taken from downstream Ubuntu DKMS support written
by Chuck Short <zulcss@ubuntu.com>, version 1.2.0-1ubuntu1. I made the
following changes:
* Update debian/.gitignore.
* Update debian/automake.mk.
* Correct description in debian/control (it was a cut-and-paste from
the openvswitch-datapath-source description without editing).
* Fix up for --with-l26 to --with-linux and datapath/linux-2.6 to
datapath/linux transitions.
CC: Chuck Short <zulcss@ubuntu.com> CC: Dave Walker <DaveWalker@ubuntu.com> Acked-by: Simon Horman <horms@verge.net.au>
Ben Pfaff [Tue, 23 Aug 2011 16:36:39 +0000 (09:36 -0700)]
ovs.db.idl: Use top-level class to represent IDL rows.
According to Reid, there may be some disadvantages to having this class be
anonymous, for example, cannot do instance/typechecking, might be
allocating a new class for every row as well, which isn't the most memory
efficient.
Ben Pfaff [Tue, 23 Aug 2011 16:26:29 +0000 (09:26 -0700)]
ovs.db.idl: Actually use Idl.__modify_row()'s return value.
Idl.__parse_row_update() assumed that every change that the database server
sent down actually modified the database. This is generally true, but
since Idl.__modify_row() already returns whether there was a change, we
might as well use it.
Ben Pfaff [Mon, 22 Aug 2011 21:31:18 +0000 (14:31 -0700)]
python: Use getattr() and setattr() instead of __dict__.
This leaves one use of __dict__ used for iterating through attributes.
I could use dir() instead, but I was put off by this note in its
documentation in the Python Library Reference:
Because dir() is supplied primarily as a convenience for use at an
interactive prompt, it tries to supply an interesting set of names more
than it tries to supply a rigorously or consistently defined set of names,
and its detailed behavior may change across releases. For example,
metaclass attributes are not in the result list when the argument is a
class.
Ben Pfaff [Tue, 23 Aug 2011 18:09:46 +0000 (11:09 -0700)]
ovs.stream: Fix logic bug in Stream.connect().
The loop here is supposed to run at least once, and to continue looping as
long as the loop body changes the current state, but this bug caused it to
continue looping until the connection completed in success or failure. It
probably didn't cause many problems in practice because only Unix domain
socket connections are currently supported, and those connections normally
complete immediately.
Simon Horman [Wed, 24 Aug 2011 01:40:52 +0000 (10:40 +0900)]
docs: Suppress "warning: macro `DD' not defined" warning
Suppress "warning: macro `DD' not defined" warning for ovs-brcompatd.8.
As per the description by Ben Pfaff for the same problem effecting
other files:
deamon.man allows the file that is including it to include extra
text in the description of --detach by defining a macro named DD.
Only some of the manpages that included it did this (only those
manpages that needed extra text there). But it's better to be
quiet in "man --warnings", so this defines DD to an empty value in
the other manpages that include daemon.man.
Simon Horman [Wed, 24 Aug 2011 01:40:51 +0000 (10:40 +0900)]
Debian: Add dependency on ${misc:Depends}
Add dependency on ${misc:Depends} to openvswitch-brcompat and ovsdbmonitor.
As reported by Lintian:
The source package uses debhelper, but it does not include
${misc:Depends} in the given binary package's debian/control entry.
Any debhelper command may add dependencies to ${misc:Depends} that
are required for the work that it does, so recommended best
practice is always add ${misc:Depends} to the dependencies of each
binary package if debhelper is in use.
Refer to the debhelper(7) manual page for details.
Justin Pettit [Thu, 18 Aug 2011 17:35:40 +0000 (10:35 -0700)]
datapath: Use "OVS_*" as opposed to "ODP_*" for user<->kernel interactions.
The prefix "ODP_*" is not overly descriptive in the context of the
larger Linux tree. This commit changes the prefix to "OVS_*" for the
userpace to kernel interactions. The userspace libraries still use
"ODP_" in many of their interfaces since it is more descriptive in the
OVS oeuvre.
Ben Pfaff [Fri, 19 Aug 2011 21:29:27 +0000 (14:29 -0700)]
ofproto-dpif: Delete MAC learning entries when they expire.
Commit fa066f015f716c7 "bridge: Move packet processing functionality into
ofproto" deleted the call to mac_learning_run() that deletes MAC learning
table entries when they expire. This fixes the problem.
Justin Pettit [Thu, 18 Aug 2011 16:57:23 +0000 (09:57 -0700)]
datapath: Correct comment for vport_add().
The comment describing vport_add() incorrectly stated that the function
added the vport to the datapath. It is the responsibility of the caller
to do that.
Ben Pfaff [Thu, 18 Aug 2011 17:33:32 +0000 (10:33 -0700)]
odp-util: Fix parsing of Ethertypes 0x8000 and above.
An existing comment in the function being updated explains the problem:
* Many of the sscanf calls in this function use oversized destination
* fields because some sscanf() implementations truncate the range of %i
* directives, so that e.g. "%"SCNi16 interprets input of "0xfedc" as a
* value of 0x7fff. The other alternatives are to allow only a single
* radix (e.g. decimal or hexadecimal) or to write more sophisticated
* parsers.
Ethan Jackson [Tue, 16 Aug 2011 21:16:58 +0000 (14:16 -0700)]
ofproto: Fix over accounting of byte counters.
The update_stats() function in ofproto was attributing more bytes
to facets than they had actually accrued. This could potentially
throw off bond load balancing.
Ethan Jackson [Tue, 16 Aug 2011 20:50:00 +0000 (13:50 -0700)]
ofproto: Clear packet and byte counters on flow additions.
When a flow is added to the flow table, its packet and byte
counters should be reset. This patch efficiently approximates this
behavior. It also does some minor code refactoring.
Ben Pfaff [Wed, 10 Aug 2011 19:49:35 +0000 (12:49 -0700)]
poll-loop: Remove static variable n_waiters.
It's always a little risky to track the length of a list by hand, because
it is easy to miss a spot where the length can change. So it seems like
a small cleanup to just measure the length of the 'waiters' list at the
point where we need to know it. list_size() is O(n) in the length of the
list, but the function that calls it is already O(n) in that length so it
seems like a fair trade-off.
Ethan Jackson [Wed, 10 Aug 2011 20:32:51 +0000 (13:32 -0700)]
nx-match: New function nxm_read_field_bits().
nxm_read_field_bits() simplifies reading of NXM fields with an
ofs_nbits parameter. This patch updates nxm_execute_reg_move() to
use the new function. A user outside of the nx-match module will
be added in future patches.
Ethan Jackson [Fri, 29 Jul 2011 20:15:09 +0000 (13:15 -0700)]
flow: New FLOW_WC_SEQ build assertion.
Changing "struct flow" or its wildcards requires minor adjustments
in many places in the code. This patch adds a new FLOW_WC_SEQ
sequence number which when incremented will cause build assertion
failures aiding the developer in finding code which needs to
change.
Ben Pfaff [Wed, 10 Aug 2011 16:13:12 +0000 (09:13 -0700)]
debian: Avoid installing duplicate files in ovsdbmonitor package.
This is just a typo introduced in commit 57483aeda (debian: Fix bug from
commit 211b05b5 "debian: Modernize use of dh_install.) that caused the
ovsdbmonitor package to install too many files.
Ben Pfaff [Tue, 9 Aug 2011 20:46:51 +0000 (13:46 -0700)]
nicira-ext: Fix NXM example.
The code and the specification say that nxm_length includes both value
and mask, but this example showed nxm_length only including the value.
This commit fixes it.
Ben Pfaff [Tue, 9 Aug 2011 19:55:13 +0000 (12:55 -0700)]
ovs-ofctl: Fix reading flows from file for "replace-flows", "diff-flows".
Commit c821124b25e "ovs-ofctl: Accept only valid flow_mod and
flow_stats_request fields" caused actions read by read_flows_from_file()
to be ignored and treated as "drop". This fixes the problem.
Sanjay Sane [Tue, 9 Aug 2011 18:08:27 +0000 (11:08 -0700)]
Option to forward BPDU (Ethernet control class) frames
Currently, a NORMAL action bridge drops reserved-multicast-mac addresses;
01-80-c2-00-00-[f0:ff]. A node that does not implement STP should have an
option to forward such frames.
This commit proposes to have a configuration option to allow forwarding of
BPDU class frames. To ensure backward compatibility, this option is
disabled by default.
This config can be set using bridge's other-config column, for e.g
ovs-vsctl set bridge br0 other-config:forward-bpdu=true
Changing this option can revalidate all flows in a software-OVS
implementation (ofproto-dpif)
--------
unit tests:
------------
make config changes, test runtime behavior
-- test runtime behavior --
continuously send packets to br0 with dest-mac=01:80:c2:00:00:00