Ben Pfaff [Wed, 1 Apr 2009 00:12:13 +0000 (17:12 -0700)]
Add forgotten header files, to fix "make dist".
Ben Pfaff [Tue, 31 Mar 2009 23:52:57 +0000 (16:52 -0700)]
boot.sh: Avoid the need for Git repository information
It should not be necessary to have a Git repository to run boot.sh; a
checked-out tree should be sufficient. This makes it so.
Some corresponding changes to ext are necessary also.
Ben Pfaff [Tue, 31 Mar 2009 21:46:27 +0000 (14:46 -0700)]
Be more liberal about what constitutes a virtual interface MAC on Xen.
The xapi sources indicate that FE:FE:FE:FE:FE:FE can sometimes be used for
virtual interfaces, in addition to the usual FE:FF:FF:FF:FF:FF, so accept
that (and other similar variants) as well.
Ben Pfaff [Tue, 31 Mar 2009 21:45:02 +0000 (14:45 -0700)]
vswitch: Do not use "xe" on XenServer, to avoid deadlock.
Commit
4ab581b949, "vswitch: Fix duplicated DPIDs observed under
XenServer," changed vswitchd to use the "xe" program to obtain the host
UUID and network name under XenServer. Unfortunately, on XenServer pool
slaves this causes a deadlock, because on such machines "xe" always
attempts to contact the master to perform database queries. Since vswitchd
is the entity that must set up the flow that "xe" initiates as part of
that connection, this will deadlock and fail.
Instead, get the host UUID from /etc/xensource-inventory and hash it with
the bridge name. Discussion with the NOX folks indicates that this should
provide sufficient stability and uniqueness.
Justin Pettit [Mon, 30 Mar 2009 20:46:58 +0000 (13:46 -0700)]
Fix newly introduced newline in brcompatd init script.
Justin Pettit [Mon, 30 Mar 2009 20:31:46 +0000 (13:31 -0700)]
Various fixes for vswitch-brcompatd init script.
Justin Pettit [Mon, 30 Mar 2009 15:58:33 +0000 (08:58 -0700)]
Fix missing newline suppression in vswitchd automake.mk.
Justin Pettit [Mon, 30 Mar 2009 08:17:49 +0000 (01:17 -0700)]
Break bridge compatibility daemon into separate process.
The user-space bridge compatibility code formally was part of the
vswitchd process. For better separation, the bridge compatibility code
has been broken into a separate process, brcompatd.
Justin Pettit [Mon, 30 Mar 2009 08:08:38 +0000 (01:08 -0700)]
Fix skipping of lines when deleting a section with the cfg library.
When deleting a section in the "cfg" library, the cfg_del_section
function would check each line in the configuration to see if it was
part of the section to be deleted. The way it deleted was essentially
to move all future lines "down" to replace the line to be deleted.
However, it always incremented the pointer to the next entry, which
could cause it to skip over other entries that should have been deleted.
We now only increment the pointer if we didn't delete a line.
Keith Amidon [Sat, 28 Mar 2009 00:06:09 +0000 (17:06 -0700)]
New init files to work with separate brcompatd program.
Justin Pettit [Wed, 25 Mar 2009 13:00:59 +0000 (06:00 -0700)]
Return error when multiple writers are modifying vswitchd.conf.
We now have multiple writers of vswitchd.conf. The bridge compatibility
module's attempts to write can now fail due to the file being locked.
This change notifies the caller of that.
Ben Pfaff [Fri, 20 Mar 2009 20:50:51 +0000 (13:50 -0700)]
vswitch: Fix duplicated DPIDs observed under XenServer.
The procedure for choosing a bridge MAC address will, in the most
ordinary case, also choose a unique MAC that we can use as a datapath
ID. In some special cases, though, multiple bridges will end up with
the same MAC address. This is OK for the bridges, but it will confuse
the OpenFlow controller, because each datapath needs a unique datapath
ID, so this commit adds some support for two common special cases on
XenServer where DPIDs were not unique.
It is also very desirable that they be stable from one run to the
next, so that policy set on a datapath "sticks".
The special cases handled by this commit are:
1. A bridge whose MAC address is taken from a VLAN network device
(that is, a network device created with vconfig(8) or similar tool)
will have the same MAC address as a bridge on the VLAN device's
physical network device.
We handle this case by hashing the physical network device MAC
along with the VLAN identifier.
2. A purely internal bridge, that is, one that has no non-virtual
network devices on it at all, is more difficult because it has no
natural unique identifier at all.
When the host is a XenServer, we handle this case by asking "xe"
for the internal bridge's plaintext name (e.g. "Internal Network
1") and hashing that together with the XenServer's host UUID.
When the host is not a XenServer, we punt by using a random MAC
address on each run.
Ben Pfaff [Fri, 20 Mar 2009 20:47:35 +0000 (13:47 -0700)]
process: New function process_search_path().
The process code already had the logic to search PATH for a file, but
it didn't export it, and it didn't return the executable that was found.
This exports it and returns the name, for the benefit of an upcoming
commit that wants to search the PATH for an executable only once per
program run.
Ben Pfaff [Fri, 20 Mar 2009 20:45:19 +0000 (13:45 -0700)]
sha1: New function SHA1Bytes().
This is convenient for hashing an array with less work.
Ben Pfaff [Fri, 20 Mar 2009 20:41:58 +0000 (13:41 -0700)]
sha1: Fix indentation.
Ben Pfaff [Fri, 20 Mar 2009 20:41:44 +0000 (13:41 -0700)]
packets: New function eth_addr_mark_random().
This function is useful for turning a sequence of random bits into a valid
MAC address, which we need for generating DPIDs under Xen.
Ben Pfaff [Fri, 20 Mar 2009 20:38:48 +0000 (13:38 -0700)]
netdev: New function for obtaining the VID of a VLAN network device.
This is needed for autogenerating a unique datapath ID on Xen, on which
a VLAN bridge reuses the bridge address of the VLAN device's physical
network device.
Keith Amidon [Fri, 20 Mar 2009 06:21:37 +0000 (23:21 -0700)]
Remove vswitchd.conf so blank file doesn't overwrite an existing one.
Currently the file does not have anything in it. There isn't much
reason to have anything in it for the normal Xen case because the file
contents are managed by other tools (xapi, etc.) In the future, if we
decide a commented version of the file is useful after all, we can
include a vswitchd.conf.example.
Ben Pfaff [Thu, 19 Mar 2009 21:02:07 +0000 (14:02 -0700)]
secchan: Remove ofproto hook functions that are no longer used.
Ben Pfaff [Thu, 19 Mar 2009 20:56:08 +0000 (13:56 -0700)]
secchan: Make fail-open work using a wildcard rule (and flush the flow table).
Fail-open was implemented by grabbing packets as they came in and then
shoving them into a learning switch, but this interacted badly with
vswitch. First, it didn't respect the vswitch architecture; e.g. VLAN
and bonding settings were ignored. Second, it didn't override any rules
that were still in the flow table from the last time we were connected to
a controller, which could cause other things to break if those rules were
bad (or if some host just wasn't authenticated etc.)
This commit fixes these problems by making fail-open use a wildcard rule
and OFPP_NORMAL, so that vswitch then implements VLANs etc., and by
flushing the flow table when we go into fail-open, getting rid of any
bad rules.
Ben Pfaff [Thu, 19 Mar 2009 20:52:03 +0000 (13:52 -0700)]
secchan: When we flush the flow table, add the in-band control rules back in.
ofproto_flush_flows() deletes all the flows from the flow table, even the
ones added by in-band control. If that happens we need to add them back
in.
This should be the only place that the in-band control rules can get
deleted, since their priorities are such that the controller cannot see
or modify them.
Ben Pfaff [Thu, 19 Mar 2009 20:50:06 +0000 (13:50 -0700)]
secchan: Force revalidation in ofproto_add_flow(), ofproto_delete_flow().
This code needs to have flows be revalidated if the rule includes
wildcards, just like add_flow() and modify_flow().
Ben Pfaff [Thu, 19 Mar 2009 19:59:34 +0000 (12:59 -0700)]
vswitch: Force local port into bridge when in-band control configured.
In-band control requires that local port be part of the bridge. This used
to not matter, because in-band control stole packet-in messages before they
got to any part of the code that cared about configured ports, but now that
in-band control goes through the same flow table as everything else, it
matters.
Ben Pfaff [Thu, 19 Mar 2009 19:39:00 +0000 (12:39 -0700)]
vswitch: Don't choose Xen's FE:FF:FF:FF:FF:FF address as bridge MAC or DPID.
Xen uses FE:FF:FF:FF:FF:FF as the mac address for every virtual interface.
If we have a bridge that has just virtual interfaces, then this will end
up as the bridge's MAC address and thus the datapath ID also. So, instead,
use the bridge's randomly chosen MAC address if this case comes up.
This is probably not the end of this issue, since we probably want the
DPID of such bridges to be predictable. Need to figure out how to do that.
Ben Pfaff [Thu, 19 Mar 2009 19:57:17 +0000 (12:57 -0700)]
Remove debug printf() that escaped.
Ben Pfaff [Thu, 19 Mar 2009 18:16:29 +0000 (11:16 -0700)]
vswitch: Add rate-limiting support.
Ben Pfaff [Thu, 19 Mar 2009 18:16:08 +0000 (11:16 -0700)]
pinsched: Move rate-limiting sanity checks into pinsched.
The vswitch will want to do the same sanity checks so it is better to
put them in a single place.
Ben Pfaff [Thu, 19 Mar 2009 18:14:55 +0000 (11:14 -0700)]
secchan: Fix rate-limiting statistics reporting.
The n_queue_dropped value wasn't being updated at all.
n_tx_dropped wasn't being updated either but the packet scheduler no longer
has enough information to track it, so this statistic has just been
dropped.
Ben Pfaff [Thu, 19 Mar 2009 17:41:37 +0000 (10:41 -0700)]
dpif: Accept 64 kB packets from the kernel.
Under virtualization (e.g. Xen) we sometimes receive packets as large as
64 kB, so the dpif code has to be prepared to accept it.
The only place where we keep these packets around for any amount of time
is when we need to schedule them for sending later, so trim them down
from 64 kB to their actual size in that case.
Ben Pfaff [Thu, 19 Mar 2009 17:39:32 +0000 (10:39 -0700)]
New function ofpbuf_trim(), for freeing up wasted space in ofpbufs.
The dpif code will start allocating 64 kB buffers in the next commit,
since sometimes we get packets that big under virtualization. But we
need to trim them down if we're going to store them for any time, so
we need a function to do it.
Keith Amidon [Thu, 19 Mar 2009 17:08:37 +0000 (10:08 -0700)]
In init script, redirect core files to known writable directory in Xen
"Embedded" XenServers don't have a writable "/" directory. For now
point cores to /var/log, which is known to be writable.
Keith Amidon [Thu, 19 Mar 2009 16:55:50 +0000 (09:55 -0700)]
Change init script to interact with xapi better at boot.
It seems that with a controller specified in vswitchd, previously
there was a bad interaction between vswitchd and xapi during boot that
prevented the management interface from ever coming up. The solution
here is to force all bridge interfaces up when vswitchd starts, so
they are already up when xapi attempts to bring them up. Since the
interfaces are coming up earlier as a result, we move vswitch back in
the boot sequence after iptables starts.
This patch also contains a bunch of lines that have only changed in
whitespace because half the indentation in this file was done using
tabs and the other half was done with spaces...
Ben Pfaff [Thu, 19 Mar 2009 00:12:25 +0000 (17:12 -0700)]
secchan: Aggregate multiple NetFlow messages into a single packet.
Completes feature #1012.
Ben Pfaff [Wed, 18 Mar 2009 23:32:19 +0000 (16:32 -0700)]
secchan: Make NetFlow work with any flow, not just exact-match.
NetFlow only worked with exact-match flows until now. This commit extends
it to also work with wildcarded flows, which is increasingly important now
that NOX sets up a lot of these.
Ben Pfaff [Wed, 18 Mar 2009 23:27:02 +0000 (16:27 -0700)]
vlog: Trim trailing new-lines from log messages.
Sometimes a message passed into a vlog function will have a trailing
new-line due to carelessness. Tolerate this situation by just
trimming them off in format_log_message().
Keith Amidon [Wed, 18 Mar 2009 18:20:07 +0000 (11:20 -0700)]
Fix vswitch init.d file
- Add options for restarting under strace and valgrind
- Make updating modules work again
- Optimize datapath add/remove using showdp output
Ben Pfaff [Wed, 18 Mar 2009 19:42:38 +0000 (12:42 -0700)]
Restore the default maximum backoff to 15 seconds for secchan and vswitchd.
15 seconds has always been the documented default maximum backoff, but the
secchan restructuring accidentally changed it to 1 second.
Thanks to Reid for noticing.
Ben Pfaff [Wed, 18 Mar 2009 17:59:48 +0000 (10:59 -0700)]
secchan: Properly maintain super-rule's list of subrules when revalidating.
When we revalidated a subrule and found that it had a new super-rule,
we changed the subrule's pointer to its super-rule (rule->super), but
we failed to actually transfer it from the previous super-rule's list
of subrules to the new super-rule's list. This fixes the problem.
Ben Pfaff [Wed, 18 Mar 2009 17:46:46 +0000 (10:46 -0700)]
secchan: Fix memory leak.
Ben Pfaff [Wed, 18 Mar 2009 17:28:27 +0000 (10:28 -0700)]
dpif: Clear stats before deleting or query flows.
This placates Valgrind, but it also makes results more reproducible if a
caller does not check the return value.
Ben Pfaff [Wed, 18 Mar 2009 17:20:09 +0000 (10:20 -0700)]
dpctl: Make examples in the manpage more generic.
Ben Pfaff [Wed, 18 Mar 2009 17:03:14 +0000 (10:03 -0700)]
dpctl: Allow datapath names to be given in place of switch names.
It is convenient to be able to type, e.g., "dpctl show xenbr0" instead of
"dpctl show unix:/var/run/xenbr0.mgmt", so this allows this form.
Justin Pettit [Wed, 18 Mar 2009 00:35:00 +0000 (17:35 -0700)]
Fix mirroring when no selection criteria provided. (Bug #1112)
Mirroring wouldn't occur when no selection criteria was provided. If a
source/destination port or vlan were provided, mirroring would work as
expected. This fixes that.
Justin Pettit [Tue, 17 Mar 2009 23:14:11 +0000 (16:14 -0700)]
Remove extraneous debug message.
Ben Pfaff [Wed, 18 Mar 2009 00:23:35 +0000 (17:23 -0700)]
secchan: Make default normal action do switching.
The default normal action is what OFPP_NORMAL does in secchan when vswitchd
is not running. Before, this was equivalent to OFPP_FLOOD. With this
change, the behavior changes to acting as a learning switch.
This makes the recent changes to in-band control more efficient when
running in secchan without vswitchd, since we don't really want to flood
all the packets to and from the controller.
Ben Pfaff [Wed, 18 Mar 2009 00:16:22 +0000 (17:16 -0700)]
Make ofproto manage the revalidation set, instead of vswitchd.
In an upcoming change, ofproto will want to add revalidation entries of its
own, so it is better to have it manage a single revalidation set rather
than having two separate sets, one in ofproto and one in vswitchd.
Ben Pfaff [Wed, 18 Mar 2009 00:14:23 +0000 (17:14 -0700)]
in-band: Use OFPP_NORMAL instead of OFPP_LOCAL for traffic to local port.
If we use OFPP_LOCAL then the code that implements the normal action won't
get a chance to learn from these packets.
This change seems somewhat risky, since in-band control is so touchy, which
is why it is broken out as a separate commit that can easily be reverted.
Ben Pfaff [Wed, 18 Mar 2009 00:02:20 +0000 (17:02 -0700)]
secchan: Implement in-band control using wildcard rules.
Until now, there has been a problem with flows set up by the controller
overriding in-band control decisions: if the controller sets up, say, a
flow that matches every packet, then the in-band control flow miss handler
will never be called, and the connection to the controller may well fail.
This commit fixes the problem by implementing in-band control in terms
of wildcard rules that have a higher priority than any rule that can be
set up by the OpenFlow controller.
This should also fix the issue that in-band control does not respect VLANs
and other structure set up by the vswitch, since the rules set up by
in-band control use OFPP_NORMAL.
Ben Pfaff [Tue, 17 Mar 2009 23:10:40 +0000 (16:10 -0700)]
secchan: Support priorities over UINT16_MAX for internal use.
The plan is for in-band control to use these higher priorities for flows
that are to be hidden from, and take precedence over, flows set up by the
controller.
Ben Pfaff [Tue, 17 Mar 2009 21:42:24 +0000 (14:42 -0700)]
classifier: Expand the classifier priority range to 32 bits.
secchan will reserve priorities above UINT16_MAX for its own purposes
(e.g. in-band control).
Justin Pettit [Tue, 17 Mar 2009 21:51:45 +0000 (14:51 -0700)]
Read netflow config from vswitchd.conf (Bug #1087).
The bridge wasn't reading the netflow configuration from vswitchd.conf,
so it was never generating NetFlow messages. This fixes that.
Ben Pfaff [Tue, 17 Mar 2009 20:50:13 +0000 (13:50 -0700)]
secchan: Tolerate local port change in MAC address.
Before, if the local port's MAC address changed, we would not notice, and
continue to set up flows only for the local port's current MAC address,
which completely broke in-band control.
Now, we notice changes and start to set up flows for the new MAC address
instead.
Fixes bug #1081.
Ben Pfaff [Tue, 17 Mar 2009 20:48:49 +0000 (13:48 -0700)]
secchan: Get rid of static data in in-band control.
The notion of the controller's IP and MAC address in in-band control was
global. This is incorrect if different switches within a process have
different controller. Make this data part of "struct in_band" instead.
Ben Pfaff [Tue, 17 Mar 2009 17:54:33 +0000 (10:54 -0700)]
secchan: Remove idle flows from datapath even if their rules haven't expired.
Ben Pfaff [Tue, 17 Mar 2009 17:53:22 +0000 (10:53 -0700)]
secchan: Simplify code by making rule_uninstall() update stats.
All the callers wanted to update the stats of the rule being uninstalled,
or at least didn't mind, so this makes the code easier to read and
maintain.
Ben Pfaff [Tue, 17 Mar 2009 17:51:21 +0000 (10:51 -0700)]
secchan: Make expire_rule() slightly easier to read.
Search-and-replace "expiration" by "expire". In the next commit this
will keep from needing to wrap more lines, making the code easier to read
there too.
Ben Pfaff [Tue, 17 Mar 2009 17:24:28 +0000 (10:24 -0700)]
secchan: Track datapath actions in userspace, to avoid system calls.
Until now, secchan had no way to determine when datapath actions actually
changed, and so it had to be conservative and update all flows' actions,
or almost all, in some circumstances.
With this commit, secchan keeps track of flows' actions in allocated memory
and only updates them in the datapath when they actually change.
As part of the change, this factors out common code into new functions
rule_install() and rule_uninstall(), which should make secchan more
maintainable.
Ben Pfaff [Tue, 17 Mar 2009 17:18:32 +0000 (10:18 -0700)]
secchan: Centralize creation of rules in new function rule_create().
This is code cleanup that should make maintenance easier.
Ben Pfaff [Tue, 17 Mar 2009 17:26:47 +0000 (10:26 -0700)]
secchan: Avoid dynamic allocation in xlate_actions().
The ofproto code currently does malloc()/realloc()/free() whenever it needs
to translate OpenFlow actions into datapath actions. This is more or less
OK as-is, but the next commits will start keeping the datapath actions as
part of the rule. That will require either wasting memory (because we
e.g. double the size of the malloc()'d buffer each realloc()) or making
a new malloc()'d copy of already malloc()'d memory. Both solutions seem
wasteful.
So this commit instead prepares by keeping the ODP actions on-stack while
accumulating them, with a fixed maximum size that is the same maximum
used by the kernel datapath anyhow.
Ben Pfaff [Mon, 16 Mar 2009 23:27:39 +0000 (16:27 -0700)]
secchan: Add explanatory comment.
Ben Pfaff [Mon, 16 Mar 2009 21:40:59 +0000 (14:40 -0700)]
dpctl: Add support for OFPAT_SET_DL_SRC and ..._DST actions.
Originally from a patch by Jean Tourrilhes, but the code here had moved
on so much in the meantime that none of the original changes applied any
longer.
Ben Pfaff [Mon, 16 Mar 2009 21:37:15 +0000 (14:37 -0700)]
dpctl: Remove unused macro.
Keith Amidon [Mon, 16 Mar 2009 20:29:49 +0000 (13:29 -0700)]
No longer need secchan to be on the executable search path for vswitchd
Keith Amidon [Mon, 16 Mar 2009 20:26:24 +0000 (13:26 -0700)]
Document correct default nice level in default sysconfig file for vswitch.
Keith Amidon [Mon, 16 Mar 2009 16:44:07 +0000 (09:44 -0700)]
Wait longer for userspace on brcompat changes.
We aren't returning to the caller of the bridge APIs until the
userspace vswitchd completes changes. This timeout exists to return
an error if that is taking too long. Extending it to error by being
too conservative (waiting too long) in an attempt to make sure vswitch
and the brcompat user don't get out of sync.
Keith Amidon [Sun, 15 Mar 2009 03:58:30 +0000 (20:58 -0700)]
Add help and version options to vswitch init script.
Keith Amidon [Sat, 14 Mar 2009 17:02:23 +0000 (10:02 -0700)]
Hack vswitchd init script to remove bridge ports at startup
XAPI will recreate all the bridges and reconnect the interfaces at
startup, so this is safe in the Xen environment. If we don't do this
stale vifs hang around in the configuration file.
This is a hack and not a true solution because it doesn't handle
port-related configuration, etc. A better solution needs to be
implemented in the future.
Ben Pfaff [Mon, 16 Mar 2009 20:14:18 +0000 (13:14 -0700)]
brcompat: Tolerate a race condition in deleting bridge ports.
When we delete a bridge port (e.g. "brctl delif"), the port could get
removed from the bridge we are interested in and then quickly added back
into another bridge while sleeping. Return immediately in this case,
since the port must really have been deleted from the bridge in question.
There is a remaining race that the port could get deleted from the bridge
and then added back to the same one.
Ben Pfaff [Fri, 13 Mar 2009 00:24:18 +0000 (17:24 -0700)]
debian: Suppress printing out random numbers in init script.
Ben Pfaff [Mon, 16 Mar 2009 18:37:34 +0000 (11:37 -0700)]
datapath: Speed up ioctl fast paths.
synchronize_rcu() was causing some common datapath ioctls to take up to
approx. 1 second (!) in some cases, which was killing our performance.
Use call_rcu() instead.
Ben Pfaff [Mon, 16 Mar 2009 17:50:42 +0000 (10:50 -0700)]
Add ability to snoop on the primary switch<->controller OpenFlow connection.
This is useful for debugging problems that may be in the switch or in the
controller.
Ben Pfaff [Mon, 16 Mar 2009 17:07:04 +0000 (10:07 -0700)]
dpctl: Allow requesting flow misses, expirations in "monitor" command.
This makes it possible to debug problems where one wonders whether
flow misses or flow expirations are making it up to the controller.
Ben Pfaff [Mon, 16 Mar 2009 17:05:52 +0000 (10:05 -0700)]
secchan: Only let the controller connection set configuration flags.
Each OpenFlow connection to secchan, both controller connection and
management connections, is allowed to set its own miss_send_len and
send_flow_exp configuration, because these are really per-connection
state, not global state. But management connection should not change
the global state (currently, just the treatment of fragments) when
they do this.
Ben Pfaff [Sun, 15 Mar 2009 03:49:58 +0000 (20:49 -0700)]
brcompat: Fix sign of return value.
Thanks to Justin for pointing this out.
Ben Pfaff [Sun, 15 Mar 2009 01:01:41 +0000 (18:01 -0700)]
brcompat: When adding or removing datapath ports, wait for them to appear/disappear.
Ben Pfaff [Sun, 15 Mar 2009 00:22:09 +0000 (17:22 -0700)]
brcompat: Fix netdevice refcount in non-2.6.18 when sysfs is available.
When sysfs is enabled, brcompat is responsible for releasing the netdevice
reference and freeing the net_bridge_port in brc_sysfs_del_if(). However,
when we're not building against 2.6.18, it was stubbed out to a function
that did nothing.
Ben Pfaff [Fri, 13 Mar 2009 23:52:37 +0000 (16:52 -0700)]
secchan: Fix in-band ODP->OFP port translation.
The in-band and fail-open code uses ODP port numbers internally, but
ofproto_add_flow() takes OpenFlow actions and thus needs to receive
OpenFlow port numbers.
This should fix a problem with in-band control.
Ben Pfaff [Fri, 13 Mar 2009 23:48:01 +0000 (16:48 -0700)]
secchan: Drop redundant 'in_port' args to in-band, fail-open miss handlers.
The in_band_handle_flow_miss() and fail_open_handle_flow_miss() functions
have 'in_port' arguments that are completely redundant with their
'flow' arguments' 'in_port' members. Drop the 'in_port' parameters.
Justin Pettit [Fri, 13 Mar 2009 23:36:20 +0000 (16:36 -0700)]
Fix cfg_del_section() function that was recently broken.
This was showing up when the bridge compatibiity module was attempting
to delete a bridge.
Justin Pettit [Fri, 13 Mar 2009 20:30:14 +0000 (13:30 -0700)]
Log error messages instead of calling printf.
Ben Pfaff [Fri, 13 Mar 2009 23:03:42 +0000 (16:03 -0700)]
dpctl: Add dp-dump-flows, dp-dump-groups commands.
These should make it easier to debug datapath-related problems.
Ben Pfaff [Fri, 13 Mar 2009 23:03:15 +0000 (16:03 -0700)]
dpif: Make higher-verbosity flow logging available.
Ben Pfaff [Fri, 13 Mar 2009 21:03:54 +0000 (14:03 -0700)]
dpif: Make dpif_port_group_get() work. (It was never tested until now.)
Ben Pfaff [Fri, 13 Mar 2009 20:17:01 +0000 (13:17 -0700)]
secchan: Validate subrules before attempting to dereference their super-rules.
rule_make_actions() is supposed to compose the datapath actions for an
exact-match rule, and to do so it needs to look up the super-rule (if the
rule is a subrule). The "super" pointer might be set to UNKNOWN_SUPER,
though, and before this commit that would cause a segfault.
This commit modifies the callers of rule_make_actions() to ensure that
the rule passed in can never have a "super" of UNKNOWN_SUPER. In most
cases, this was already impossible (e.g. we're passing in a new rule that
we just added to the table), but in two cases where the rule was obtained
from a bare classifier lookup we needed to validate the rule before
attempting to use it.
Fixes a crash reported by Keith.
Ben Pfaff [Fri, 13 Mar 2009 18:14:28 +0000 (11:14 -0700)]
secchan: Remove unused function ofproto_set_actions().
Justin Pettit [Fri, 13 Mar 2009 00:32:33 +0000 (17:32 -0700)]
Don't send mgmt OpenFlow messages if mgmt_rconn isn't set.
In some circumstances we try to send a configuration update to the
controller, regardless of whether we're actually connected. This fixes
that and warns if others try to do similar things.
Ben Pfaff [Fri, 13 Mar 2009 00:22:38 +0000 (17:22 -0700)]
debian: Fix confusion between dp0 and of0.
Earlier, 'nl:0' was changed to read 'dp0' in the Debian init script, but
this didn't take into account that this would also change the name of the
"local port" for the datapath from 'of0' to 'dp0'.
The "cleanest" fix would probably be to change all the instances of of0
to dp0, but this would also require changing the names of files in the
file system (e.g. /etc/openflow-switch/of0-cert.pem), so it's easier to
just change the dp0 instances to of0. Thanks to Reid for suggesting this
simpler fix.
Fixes bug #1056.
Ben Pfaff [Thu, 12 Mar 2009 21:45:36 +0000 (14:45 -0700)]
secchan: Treat invalid table IDs in stats requests as requests for no flows.
Before, we treated invalid table IDs as requests for any flows in the table
at all, but it makes more sense to treat them as requests for no flows at
all. (The value 0xff is explicitly defined by OpenFlow to mean "all
tables".)
Ben Pfaff [Thu, 12 Mar 2009 21:38:50 +0000 (14:38 -0700)]
debian: Remove obsolete --monitor support from switch init script.
Ben Pfaff [Thu, 12 Mar 2009 21:38:00 +0000 (14:38 -0700)]
Update documentation and fix up a few related inconsistencies in the code.
Justin Pettit [Thu, 12 Mar 2009 20:44:49 +0000 (13:44 -0700)]
Add retired Nicira entension types.
Old Nicira extension types must be kept around to prevent problems when
mixing and matching versions of the switch.
Ben Pfaff [Thu, 12 Mar 2009 17:17:44 +0000 (10:17 -0700)]
vswitchd: Use datapath ID format instead of MAC format for management ID.
A datapath ID is 12 hex digits: XXXXXXXXXXXX.
A MAC address is 12 delimited hex digits: XX:XX:XX:XX:XX:XX.
Discussed with Justin.
Ben Pfaff [Thu, 12 Mar 2009 17:14:25 +0000 (10:14 -0700)]
vswitchd: Improve formatting of manpage.
Ben Pfaff [Thu, 12 Mar 2009 17:04:25 +0000 (10:04 -0700)]
secchan: Remove unused variable.
Ben Pfaff [Thu, 12 Mar 2009 17:04:00 +0000 (10:04 -0700)]
cfg: Make 'cfg_cookie' static.
There is use of a variable of the same name in vswitchd/mgmt.c, but that
one is static so it's OK to make this one static too.
Ben Pfaff [Thu, 12 Mar 2009 17:00:35 +0000 (10:00 -0700)]
cfg: Write "# This file intentionally left blank.\n" to empty config file.
It's somewhat surprising to see an empty config file--it makes folks wonder
if something went wrong. If we write a comment, it is more reassuring.
The main part of the change is refactoring. This may be going a bit
overboard, but it should make the code more obvious and easier to
maintain, I hope.
Ben Pfaff [Thu, 12 Mar 2009 17:01:07 +0000 (10:01 -0700)]
svec: Add new argument to svec_join().
Ben Pfaff [Thu, 12 Mar 2009 16:36:58 +0000 (09:36 -0700)]
cfg: Write correct data when retrying a partial write, in cfg_write_data().
Justin Pettit [Thu, 12 Mar 2009 02:03:42 +0000 (19:03 -0700)]
Allow ignoring "mgmt.controller" settings per bridge.
By setting the "bridge.<name>.controller" key to an empty value, it is
now possible to perform local switching, while allowing the rest of
vswitchd to be remotely controlled.
Justin Pettit [Thu, 12 Mar 2009 01:41:12 +0000 (18:41 -0700)]
Indicate that SSL configuration is global in vswitchd.
The vconn-ssl library only supports global settings for keys and other
SSL configuration. Make vswitchd.conf mgmt use "ssl." instead of
"mgmt.ssl." to relect that the settings are shared with the bridges.