openvswitch
15 years agosecchan: Support priorities over UINT16_MAX for internal use.
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.

15 years agoclassifier: Expand the classifier priority range to 32 bits.
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).

15 years agoRead netflow config from vswitchd.conf (Bug #1087).
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.

15 years agosecchan: Tolerate local port change in MAC address.
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.

15 years agosecchan: Get rid of static data in in-band control.
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.

15 years agosecchan: Remove idle flows from datapath even if their rules haven't expired.
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.

15 years agosecchan: Simplify code by making rule_uninstall() update stats.
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.

15 years agosecchan: Make expire_rule() slightly easier to read.
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.

15 years agosecchan: Track datapath actions in userspace, to avoid system calls.
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.

15 years agosecchan: Centralize creation of rules in new function rule_create().
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.

15 years agosecchan: Avoid dynamic allocation in xlate_actions().
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.

15 years agosecchan: Add explanatory comment.
Ben Pfaff [Mon, 16 Mar 2009 23:27:39 +0000 (16:27 -0700)]
secchan: Add explanatory comment.

15 years agodpctl: Add support for OFPAT_SET_DL_SRC and ..._DST actions.
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.

15 years agodpctl: Remove unused macro.
Ben Pfaff [Mon, 16 Mar 2009 21:37:15 +0000 (14:37 -0700)]
dpctl: Remove unused macro.

15 years agoNo longer need secchan to be on the executable search path for vswitchd
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

15 years agoDocument correct default nice level in default sysconfig file for vswitch.
Keith Amidon [Mon, 16 Mar 2009 20:26:24 +0000 (13:26 -0700)]
Document correct default nice level in default sysconfig file for vswitch.

15 years agoWait longer for userspace on brcompat changes.
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.

15 years agoAdd help and version options to vswitch init script.
Keith Amidon [Sun, 15 Mar 2009 03:58:30 +0000 (20:58 -0700)]
Add help and version options to vswitch init script.

15 years agoHack vswitchd init script to remove bridge ports at startup
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.

15 years agobrcompat: Tolerate a race condition in deleting bridge ports.
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.

15 years agodebian: Suppress printing out random numbers in init script.
Ben Pfaff [Fri, 13 Mar 2009 00:24:18 +0000 (17:24 -0700)]
debian: Suppress printing out random numbers in init script.

15 years agodatapath: Speed up ioctl fast paths.
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.

15 years agoAdd ability to snoop on the primary switch<->controller OpenFlow connection.
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.

15 years agodpctl: Allow requesting flow misses, expirations in "monitor" command.
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.

15 years agosecchan: Only let the controller connection set configuration flags.
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.

15 years agobrcompat: Fix sign of return value.
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.

15 years agobrcompat: When adding or removing datapath ports, wait for them to appear/disappear.
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.

15 years agobrcompat: Fix netdevice refcount in non-2.6.18 when sysfs is available.
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.

15 years agosecchan: Fix in-band ODP->OFP port translation.
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.

15 years agosecchan: Drop redundant 'in_port' args to in-band, fail-open miss handlers.
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.

15 years agoFix cfg_del_section() function that was recently broken.
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.

15 years agoLog error messages instead of calling printf.
Justin Pettit [Fri, 13 Mar 2009 20:30:14 +0000 (13:30 -0700)]
Log error messages instead of calling printf.

15 years agodpctl: Add dp-dump-flows, dp-dump-groups commands.
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.

15 years agodpif: Make higher-verbosity flow logging available.
Ben Pfaff [Fri, 13 Mar 2009 23:03:15 +0000 (16:03 -0700)]
dpif: Make higher-verbosity flow logging available.

15 years agodpif: Make dpif_port_group_get() work. (It was never tested until now.)
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.)

15 years agosecchan: Validate subrules before attempting to dereference their super-rules.
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.

15 years agosecchan: Remove unused function ofproto_set_actions().
Ben Pfaff [Fri, 13 Mar 2009 18:14:28 +0000 (11:14 -0700)]
secchan: Remove unused function ofproto_set_actions().

15 years agoDon't send mgmt OpenFlow messages if mgmt_rconn isn't set.
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.

15 years agodebian: Fix confusion between dp0 and of0.
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.

15 years agosecchan: Treat invalid table IDs in stats requests as requests for no flows.
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".)

15 years agodebian: Remove obsolete --monitor support from switch init script.
Ben Pfaff [Thu, 12 Mar 2009 21:38:50 +0000 (14:38 -0700)]
debian: Remove obsolete --monitor support from switch init script.

15 years agoUpdate documentation and fix up a few related inconsistencies in the code.
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.

15 years agoAdd retired Nicira entension types.
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.

15 years agovswitchd: Use datapath ID format instead of MAC format for management ID.
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.

15 years agovswitchd: Improve formatting of manpage.
Ben Pfaff [Thu, 12 Mar 2009 17:14:25 +0000 (10:14 -0700)]
vswitchd: Improve formatting of manpage.

15 years agosecchan: Remove unused variable.
Ben Pfaff [Thu, 12 Mar 2009 17:04:25 +0000 (10:04 -0700)]
secchan: Remove unused variable.

15 years agocfg: Make 'cfg_cookie' static.
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.

15 years agocfg: Write "# This file intentionally left blank.\n" to empty config file.
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.

15 years agosvec: Add new argument to svec_join().
Ben Pfaff [Thu, 12 Mar 2009 17:01:07 +0000 (10:01 -0700)]
svec: Add new argument to svec_join().

15 years agocfg: Write correct data when retrying a partial write, in cfg_write_data().
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().

15 years agoAllow ignoring "mgmt.controller" settings per bridge.
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.

15 years agoIndicate that SSL configuration is global in vswitchd.
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.

15 years agoFix copy/paste naming issue.
Justin Pettit [Thu, 12 Mar 2009 01:24:19 +0000 (18:24 -0700)]
Fix copy/paste naming issue.

15 years agoMake sure that the .man include files get into "make dist" output.
Ben Pfaff [Thu, 12 Mar 2009 00:19:49 +0000 (17:19 -0700)]
Make sure that the .man include files get into "make dist" output.

15 years agoVarious fixes for SSL configruation and mgmt id generation.
Justin Pettit [Thu, 12 Mar 2009 00:09:21 +0000 (17:09 -0700)]
Various fixes for SSL configruation and mgmt id generation.

To configure SSL options in vswitchd, one now uses the "mgmt.ssl" key
prefix.  This commit also fixes a problem where a management id would
change part way through the startup.  Also, documents how to configure
mgmt in vswitch.conf.

15 years agosecchan: Update documentation.
Ben Pfaff [Thu, 12 Mar 2009 00:07:56 +0000 (17:07 -0700)]
secchan: Update documentation.

15 years agosecchan: Drop configuration file support.
Ben Pfaff [Thu, 12 Mar 2009 00:10:42 +0000 (17:10 -0700)]
secchan: Drop configuration file support.

Configuration file support was added to secchan specifically to allow
vswitchd to change the set of NetFlow collectors at runtime without killing
and restarting secchan.  secchan is integrated into vswitchd, so vswitchd
can now do this through a function call instead of through a configuration
file.  This means that we can kill off the secchan configuration file
and add back the --netflow option that it replaced.

Also, add a --mgmt-id option to supplant the other use for the
configuration file that had appeared in the meantime.

15 years agodpctl: Update manpage.
Ben Pfaff [Tue, 10 Mar 2009 23:14:26 +0000 (16:14 -0700)]
dpctl: Update manpage.

15 years agoMake manpages come out better in PostScript format.
Ben Pfaff [Wed, 11 Mar 2009 23:22:03 +0000 (16:22 -0700)]
Make manpages come out better in PostScript format.

For some reason, "man -Tps" outputs a blank page at the beginning, at
least on my system, if there is a blank line between .ds and .TH.  This
fixes it.

15 years agodpctl: Remove nl: special case that no longer makes sense.
Ben Pfaff [Wed, 11 Mar 2009 23:22:53 +0000 (16:22 -0700)]
dpctl: Remove nl: special case that no longer makes sense.

It looks like this was always broken anyway, since the "name" that was
computed was never used.

15 years agoUpdate Xen init scripts & default config for changes to config file handling.
Keith Amidon [Wed, 11 Mar 2009 22:28:10 +0000 (15:28 -0700)]
Update Xen init scripts & default config for changes to config file handling.

15 years agovswitch: Don't delete all flows on SIGHUP if a controller is configured.
Ben Pfaff [Wed, 11 Mar 2009 22:38:22 +0000 (15:38 -0700)]
vswitch: Don't delete all flows on SIGHUP if a controller is configured.

This was intended to only take effect when we had been running standalone
and were now connecting to a controller, but the test was reversed.
Instead of just reversing the test, this change also deletes flows when
we switch from connected to standalone as well.

15 years agocfg: Fix cfg_unlock() to remove the lockfile unconditionally.
Ben Pfaff [Wed, 11 Mar 2009 21:43:53 +0000 (14:43 -0700)]
cfg: Fix cfg_unlock() to remove the lockfile unconditionally.

Calling remove_lockfile() does the wrong thing here, because it only
removes stale lockfiles.  Here, the lockfile is not stale, because we know
that we own it.  Therefore, we can remove it unconditionally.

15 years agocfg: Make lock_fd, dirty static.
Ben Pfaff [Wed, 11 Mar 2009 21:34:23 +0000 (14:34 -0700)]
cfg: Make lock_fd, dirty static.

These aren't used elsewhere, so there is no reason for them to be extern.

15 years agodpif: More consistently initialize dpifs in failure cases.
Ben Pfaff [Wed, 11 Mar 2009 21:32:50 +0000 (14:32 -0700)]
dpif: More consistently initialize dpifs in failure cases.

15 years agodpif: Fix fd leak in dpif_create().
Ben Pfaff [Wed, 11 Mar 2009 21:32:24 +0000 (14:32 -0700)]
dpif: Fix fd leak in dpif_create().

15 years agolockfile: Fix inverted comparison.
Ben Pfaff [Wed, 11 Mar 2009 21:33:32 +0000 (14:33 -0700)]
lockfile: Fix inverted comparison.

remove_lockfile() returns a negative errno value on error, 0 on success.

Minor style fix also.

15 years agolockfile: Remove fd parameter to remove_lockfile().
Ben Pfaff [Wed, 11 Mar 2009 21:24:39 +0000 (14:24 -0700)]
lockfile: Remove fd parameter to remove_lockfile().

There is no reason that remove_lockfile() should close a fd passed in to
it.  The caller can do that just as well.

15 years agocfg: Initialize lock_fd to -1.
Ben Pfaff [Wed, 11 Mar 2009 21:23:15 +0000 (14:23 -0700)]
cfg: Initialize lock_fd to -1.

Otherwise cfg_unlock() will close stdin on the first call.  Since
create_lockfile() calls remove_lockfile() as its first action, that's
on every useful execution.

15 years agoFix 64-bit alignment issue in management protocol message.
Keith Amidon [Wed, 11 Mar 2009 20:27:28 +0000 (13:27 -0700)]
Fix 64-bit alignment issue in management protocol message.

15 years agoExample configuration in comments in the configuration files.
Keith Amidon [Wed, 4 Mar 2009 23:35:59 +0000 (15:35 -0800)]
Example configuration in comments in the configuration files.

15 years agovswitch: Disallow bridges named "dpN" or "nl:N".
Ben Pfaff [Wed, 11 Mar 2009 20:43:47 +0000 (13:43 -0700)]
vswitch: Disallow bridges named "dpN" or "nl:N".

Natasha discovered that naming a datapath numerically, e.g.
"bridge.dp0.port = <device>", provokes an error.  The easiest fix is to
just disallow this.

Fixes bug #1030.

15 years agosecchan: Don't infinite-loop in switch_status_destroy().
Ben Pfaff [Wed, 11 Mar 2009 20:41:36 +0000 (13:41 -0700)]
secchan: Don't infinite-loop in switch_status_destroy().

Duh.

15 years agodatapath: Always return EFAULT to userspace when copy_to/from_user() fails.
Ben Pfaff [Wed, 11 Mar 2009 20:41:15 +0000 (13:41 -0700)]
datapath: Always return EFAULT to userspace when copy_to/from_user() fails.

copy_from_user() and copy_to_user() return the number of bytes that could
not be copied, not a conventional error code, so we need to translate it
into -EFAULT ourselves.

15 years agodatapath: Refuse module load if an active bridge exists.
Ben Pfaff [Wed, 11 Mar 2009 18:13:01 +0000 (11:13 -0700)]
datapath: Refuse module load if an active bridge exists.

Loading when an active bridge exists will cause an OOPS as soon as any
packet is received on a bridged interface, because the datapath will
attempt to interpret the bridge's "struct net_bridge_port" as a datapath
"struct net_bridge_port", which is completely wrong.

15 years agodatapath: End load-time greeting message with new-line.
Ben Pfaff [Wed, 11 Mar 2009 18:08:14 +0000 (11:08 -0700)]
datapath: End load-time greeting message with new-line.

15 years agoFix help output that indicated multiple config files can be read.
Justin Pettit [Wed, 11 Mar 2009 07:49:18 +0000 (00:49 -0700)]
Fix help output that indicated multiple config files can be read.

15 years agoFirst cut of management control protocol.
Justin Pettit [Wed, 11 Mar 2009 06:59:36 +0000 (23:59 -0700)]
First cut of management control protocol.

Defines a management control protocol between the switch and NOX.
Currently, this is only used by vswitchd.  It allows the configuration
and monitoring of a switch as a whole, as opposed to the flow table view
provided by OpenFlow.  To enable, add the appropriate "mgmt" keys to
"vswitchd.conf".  Better docs will be forthcoming...

15 years agoIgnore vim swap files.
Justin Pettit [Wed, 11 Mar 2009 06:48:50 +0000 (23:48 -0700)]
Ignore vim swap files.

15 years agovswitch: Choose the datapath ID more intelligently.
Ben Pfaff [Wed, 11 Mar 2009 00:01:52 +0000 (17:01 -0700)]
vswitch: Choose the datapath ID more intelligently.

The new algorithm needs to be documented (along with a lot of new vswitch
settings).

15 years agocfg: Add ability to parse datapath IDs.
Ben Pfaff [Wed, 11 Mar 2009 00:01:16 +0000 (17:01 -0700)]
cfg: Add ability to parse datapath IDs.

15 years agocfg: Fix collision between CFG_VLAN and CFG_REQUIRED.
Ben Pfaff [Tue, 10 Mar 2009 23:37:43 +0000 (16:37 -0700)]
cfg: Fix collision between CFG_VLAN and CFG_REQUIRED.

15 years agodpctl: New command "get-name", for symmetry with "get-idx".
Ben Pfaff [Tue, 10 Mar 2009 23:14:11 +0000 (16:14 -0700)]
dpctl: New command "get-name", for symmetry with "get-idx".

The utility of both commands is now seriously in question, however, since
all dpctl commands now accept both names and numbers.

15 years agodpctl: Allow initial set of interfaces to be specified on "adddp" command.
Ben Pfaff [Tue, 10 Mar 2009 23:13:35 +0000 (16:13 -0700)]
dpctl: Allow initial set of interfaces to be specified on "adddp" command.

Commands such as e.g. "dpctl adddp dp0 eth0 eth1 eth2" are now accepted.

15 years agovswitch: Fix sense of comparison.
Ben Pfaff [Tue, 10 Mar 2009 23:58:06 +0000 (16:58 -0700)]
vswitch: Fix sense of comparison.

We only want to reconnect if the controller is *different*, not if it
is the same.

15 years agosecchan: In ofproto_set_controller(), only reconnect if controller really changed.
Ben Pfaff [Tue, 10 Mar 2009 23:54:00 +0000 (16:54 -0700)]
secchan: In ofproto_set_controller(), only reconnect if controller really changed.

The vswitchd bridge code tries not to call this function if it doesn't
have to, but it's not doing a good job.  We should fix it in vswitchd, but
it's also a good idea to do it here.

15 years agodpctl: Accept port names (e.g. "NORMAL") on in_port in flow specifications.
Ben Pfaff [Tue, 10 Mar 2009 22:23:14 +0000 (15:23 -0700)]
dpctl: Accept port names (e.g. "NORMAL") on in_port in flow specifications.

15 years agoofp-print: Make flow statistics and actions slightly easier to read.
Ben Pfaff [Tue, 10 Mar 2009 22:15:06 +0000 (15:15 -0700)]
ofp-print: Make flow statistics and actions slightly easier to read.

15 years agoofp-print: Support printing NXAST_RESUBMIT Nicira action.
Ben Pfaff [Tue, 10 Mar 2009 22:12:05 +0000 (15:12 -0700)]
ofp-print: Support printing NXAST_RESUBMIT Nicira action.

15 years agosecchan: Fix segfault in handling OFPP_TABLE, NXAST_RESUBMIT actions.
Ben Pfaff [Tue, 10 Mar 2009 22:06:49 +0000 (15:06 -0700)]
secchan: Fix segfault in handling OFPP_TABLE, NXAST_RESUBMIT actions.

15 years agoImplement OFPP_NORMAL action in secchan and hook into vswitchd.
Ben Pfaff [Tue, 10 Mar 2009 21:03:13 +0000 (14:03 -0700)]
Implement OFPP_NORMAL action in secchan and hook into vswitchd.

Bonded interface accounting and rebalancing has been removed and needs to
be added back in.

Handling of ARP packets arriving on bonded interfaces is also known to
be broken.

15 years agovswitch: Work in terms of ODP port numbers.
Ben Pfaff [Tue, 10 Mar 2009 21:04:16 +0000 (14:04 -0700)]
vswitch: Work in terms of ODP port numbers.

The vswitch used to be an OpenFlow client, so all of its internals were in
terms of OpenFlow port numbering.  When it was converted to be a datapath
client instead, a shim layer that converted between OpenFlow and ODP port
numbering was inserted, so that it could still work internally in terms of
OpenFlow port numbers.

This commit makes the vswitch use ODP port numbering internally, removing
this shim layer.

15 years agosecchan: Purge buffered packets on startup.
Ben Pfaff [Tue, 10 Mar 2009 17:41:30 +0000 (10:41 -0700)]
secchan: Purge buffered packets on startup.

This keeps packets that can be minutes old from getting forwarded.

15 years agosecchan: Fix memory leak, and flush all flows on ofproto destruction.
Ben Pfaff [Tue, 10 Mar 2009 17:14:14 +0000 (10:14 -0700)]
secchan: Fix memory leak, and flush all flows on ofproto destruction.

15 years agosecchan: New function ofproto_flush_flows() to flush all flows.
Ben Pfaff [Tue, 10 Mar 2009 17:13:27 +0000 (10:13 -0700)]
secchan: New function ofproto_flush_flows() to flush all flows.

15 years agoclassifier: New enum CLS_INC_ALL, for convenience.
Ben Pfaff [Tue, 10 Mar 2009 17:12:40 +0000 (10:12 -0700)]
classifier: New enum CLS_INC_ALL, for convenience.

15 years agosecchan: Make ofproto_add_flow() able to add a permanent flow.
Ben Pfaff [Tue, 10 Mar 2009 16:55:41 +0000 (09:55 -0700)]
secchan: Make ofproto_add_flow() able to add a permanent flow.

15 years agosecchan: Add wildcard support to ofproto_add_flow(), ofproto_delete_flow().
Ben Pfaff [Tue, 10 Mar 2009 17:44:23 +0000 (10:44 -0700)]
secchan: Add wildcard support to ofproto_add_flow(), ofproto_delete_flow().

15 years agosecchan: Keep track of ofproto even when translating nested actions.
Ben Pfaff [Mon, 9 Mar 2009 18:28:01 +0000 (11:28 -0700)]
secchan: Keep track of ofproto even when translating nested actions.

Allowing vswitch to hook OFPP_NORMAL will require nested actions (via
NXAST_RESUBMIT) to access the ofproto, so we need to be able to get to it
in that case.

15 years agovswitch: Fix typo in comment.
Ben Pfaff [Tue, 10 Mar 2009 18:12:14 +0000 (11:12 -0700)]
vswitch: Fix typo in comment.