2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 13:27:59 +00:00

19894 Commits

Author SHA1 Message Date
Ben Pfaff
5792c5c64a dpif: Add new functions dp_run() and dp_wait().
The upcoming netdev-based dpif needs a hook where it can process packets
and throw them against the flow table, and this provides a suitable place.
2009-07-06 09:07:24 -07:00
Ben Pfaff
96fba48f52 dpif: Make dpifs abstract, to allow multiple datapath implementations.
This commit initially introduces only a single datapath implementation,
which is the same as the original one, but it paves the way for
additional implementations, such as the upcoming userspace datapath.
2009-07-06 09:07:24 -07:00
Ben Pfaff
a5225dd627 datapath: Drop unneeded local variable initialization. 2009-07-06 09:07:24 -07:00
Ben Pfaff
f4ba4c4f95 datapath: Change ODP_PORT_LIST semantics.
Until now, ODP_PORT_LIST has reported the number of ports actually copied
out.  It's better for the caller, however, if it reports the number of
ports that were available to be copied out.
2009-07-06 09:07:24 -07:00
Ben Pfaff
e86c8696eb datapath: Make openvswitch_ioctl() have a single point of exit.
This makes it easier to insert debug printk() calls in a single place if
necessary, and conforms at least as well with Linux kernel style.
2009-07-06 09:07:24 -07:00
Ben Pfaff
330a8abb28 datapath: Fix ODP_PORT_DEL handling of bad user memory read. 2009-07-06 09:07:24 -07:00
Ben Pfaff
1619019101 datapath: Style fix. 2009-07-06 09:07:24 -07:00
Ben Pfaff
f1aa2072c8 datapath: Get rid of query operations for single flows. 2009-07-06 09:07:24 -07:00
Ben Pfaff
9ee3ae3e0d datapath: Make the datapath responsible for choosing port numbers.
Soon we will allow for multiple datapath implementations.  By allowing
the datapath to choose the port numbers, we possibly simplify some datapath
implementations, and the datapath's clients don't have to guess (or to
check) what port numbers are free, so this seems like a better way to go.
2009-07-06 09:07:24 -07:00
Ben Pfaff
2f8c6cfb50 datapath: Remove unnecessary range check from put_actions().
This code checked that the number of actions in a flow query did not
exceed the maximum number of actions that are allowed on a given flow.
But this check is unnecessary, since the code will never copy out any
more actions than actually exist in a flow.  It would be a shame to refuse
a flow query simply on the basis that the caller allocated more memory
than necessary, so eliminate the check.
2009-07-06 09:07:24 -07:00
Ben Pfaff
8f24562aed dpif: Rename odp_msg related functions for more consistency.
This seems like a more consistent naming scheme, since all of these
functions are related but none of them were named similarly or grouped
together.
2009-07-06 09:07:24 -07:00
Ben Pfaff
bb8a9a2b0e dpif: Change dpif_port_group_get() semantics.
This function is easier for callers to use if they do not have to guess
how many ports are in the group.  Since it's not performance critical at
all, introduce these easier semantics.
2009-07-06 09:07:24 -07:00
Ben Pfaff
f7ef6533d8 dpif: Remove obsolete support for datapaths whose names begin with "nl:".
The use of "nl:" as a prefix for datapath names has been deprecated for
months.  That should be long enough for users to update their scripts.
2009-07-06 09:07:24 -07:00
Ben Pfaff
c228a3649a dpif: Hide the contents of struct dpif.
This helps prepare for multiple dpif implementations, and ensures that
code outside dpif.c does not depend on its internals.
2009-07-06 09:07:23 -07:00
Ben Pfaff
5c6d2a3f3a dpif: Make dpif_port_query_by_name() more useful by logging less on failure.
One potential user of dpif_port_query_by_name() actually open-coded the
function because it didn't want logging on failure.  There was only one
actual caller of the function, which didn't want logging on failure either.
So, clean up by reducing the failure log level to DBG and making the
open-coded version an actual caller.
2009-07-06 09:07:23 -07:00
Ben Pfaff
b29ba12809 dpif: Replace dpif_id() by dpif_name().
dpif_id() is often used in error messages, e.g. "dp%u: screwed up".  But
soon we will be generalizing the concept of a datapath, so it is better
to have a function that returns a full name, e.g. "%s: screwed up".
Accordingly, this commit replaces dpif_id() by a new function dpif_name()
that does so.
2009-07-06 09:07:23 -07:00
Ben Pfaff
53a4218dca dpif: New function dpif_get_netflow_ids().
The 'minor' member of struct dpif is used for two different purposes:
for printing in log messages and for encapsulating in NetFlow messages.
The needs in each case are different, so we should break up these uses.
This commit does half of that, by introducing a new function to retrieve
NetFlow ids and using it where appropriate.
2009-07-06 09:07:23 -07:00
Ben Pfaff
335562c0b9 dpif: Rename dpif_get_name() to dpif_port_get_name(), update interface.
With multiple kinds of datapaths, code should not just use
"dp%u" along with dpif_minor() to print a datapath name, because not all
datapaths can sensibly be named that way.  We want to use a function
with a name like dpif_get_name() to retrieve a datapath name for printing
to the user, in which case the existing dpif_get_name() function would be
confusing.  So rename the existing one to something more explicit.
2009-07-06 09:07:23 -07:00
Ben Pfaff
7efc68eb07 shash: New function shash_first(). 2009-07-06 09:07:23 -07:00
Ben Pfaff
732dcb37a8 shash: New function shash_is_empty(). 2009-07-06 09:07:23 -07:00
Justin Pettit
a1525581ae vswitchd: Enable updating resolv.conf by default when using discovery
When vSwitch does discovery, it is supposed to update resolv.conf by
default.  The way configuration parameters were being read, it would
disable this update by default.
2009-07-01 13:58:19 -07:00
Justin Pettit
98742ab865 Increase version number to 0.90.2. v0.90.2 2009-07-01 12:41:46 -07:00
Justin Pettit
e3fdfed11b Merge commit 'origin/citrix' 2009-07-01 11:31:37 -07:00
Justin Pettit
952efc486d vswitch: Set minimum probe interval to 5 seconds
In vSwitch, the minimum probe interval is supposed to be 5 seconds, but
that was not enforced.  If no interval was specified in the config file,
a value of 0 was being used, which would cause probes to never be sent
and the rconn not to move out of its ACTIVE state.

Possible fix to Bug #1466.
2009-06-30 15:24:54 -07:00
Ben Pfaff
7df824b7b2 Log more rconn status. 2009-06-26 16:00:07 -07:00
Ben Pfaff
7793a4aaeb datapath: Fix use-after-free error in datapath destruction.
When we create a datapath we do this:

	1. Create local port.
	2. Call add_dp hook.
	3. Allow userspace to add more ports.

When we deleted a datapath we were doing this:

	1. Call del_dp hook
	2. Delete all the ports.

Unfortunately step 1 destroys dp->ifobj, then dp_del_port on any port other
than the local port in step 2 tries to reference dp->ifobj through a call
to sysfs_remove_link().

This commit fixes the problem by changing datapath deletion to mirror
creation:

	1. Delete all the ports but the local port.
	2. Call dp_del hook.
	3. Delete local port.

Commit 010082639 "datapath: Add sysfs support for all (otherwise supported)
Linux versions" makes this problem obvious on a 2.6.25+ kernel configured
with slab debugging, because on such kernels the ifobj is a pointer to a
slab object that is freed by the del_dp hook function (when brcompat_mod
is loaded).  This bug may be just as present on older kernels, but there
the ifobj is part of struct datapath, not a pointer, and thus it is much
harder to trigger.

Bug #1465.
2009-06-26 14:15:46 -07:00
Justin Pettit
7e40e21d8f xenserver: Remove cacert when user reconfigures the controller
If a user moves from one controller to another, we did not remove the
cacert.  This prevents the switch from connecting to the new controller.
To ease confusion, we now delete the cacert when the user changes or
removes the controller in xsconsole.

Note: This commit has a minor security issue, since we do not remove
trust for the old certificate until the switch is restarted.  In
general, users should only be connected to trusted servers, so the
impact should be low.  Fixes this would require larger changes to the
vconn-ssl code, which we don't want to do so late in the release cycle.

Bug #1457
2009-06-26 12:39:50 -07:00
Ben Pfaff
312b427dab datapath: Remove redundant synchronize_rcu() call.
There is no benefit to synchronizing twice, and it might cost us a lot of
time.
2009-06-26 12:20:19 -07:00
Justin Pettit
37ea6436bd Adjust Open vSwitch mailing lists to reflect reality
We've gone through a couple of iterations for names of these mailing
lists.  Currently, there are three: announce, discuss, and git.  There
are aliases that point "bugs" and "dev" to the "discuss" mailing list.
This commit drops the "ovs-" prefix to mailing lists, since we're not
using them.
2009-06-25 00:36:42 -07:00
Justin Pettit
3dc6fca88b xenserver: Validate controller IP address in xsconsole
When a switch is using in-band control, the controller must be specified
in dotted quad format, since DNS names cannot be resolved until a
connection to the controller has been established.  This commit
validates the user input in the xsconsole plugin.
2009-06-24 21:52:34 -07:00
Justin Pettit
7c77c24dbd vswitchd: Adding and removing mgmt interface breaks connection
When a managment connection is configured and then removed, putting it
back causes the management connection to never be reestablished.  The
management code checks whether the configuration file has changed before
it attempts to reconfigure itself.  If the only thing that changed was
the lack of a management connection, then it tore down the connection
but didn't update its view of the configuration.  When the same
manager IP is configured, the cached version matches the new version, so
no changes are made.  This commit clears the cached version, so that a
removing and then adding the manager will be detected as a change.

Bug #1448
2009-06-24 18:03:44 -07:00
Ben Pfaff
cfe7c1f5e8 datapath: Ignore return value from rtnl_notify().
In Linux 2.6.30, the rtnl_notify() return type was changed from int to
void along with the following commit message:

    This patch also modifies the rtnetlink code to ignore the return
    value of rtnl_notify() in all callers. The function rtnl_notify()
    (before this patch) returned the error of the unicast notification
    which makes rtnl_set_sk_err() reports errors to all listeners. This
    is not of any help since the origin of the change (the socket that
    requested the echoing) notices the ENOBUFS error if the notification
    fails and should resync itself.

Thus there's no point in checking the return value, even in older versions
of the kernel, and so this commit changes our code to ignore it, even
on older kernel versions.  We also update the rtnl_notify() wrapper macros
to make the return type void on older kernel versions.

This has not been tested, just built.

Thanks to Mikio for spurring me to try building with Linux 2.6.29 and
2.6.30.
2009-06-24 14:58:57 -07:00
Justin Pettit
f30f26bef4 Remove references to Open vSwitch being a "virtual" switch
The Open vSwitch system is not limted to being a virtual switch.  This
commit removes these references.  We are now a "versatile" switch!
2009-06-23 14:18:43 -07:00
Ben Pfaff
083652d401 xenserver: Also log ovs-brcompatd messages at INFO level to syslog.
INFO level messages are meant to be logged in the ordinary case, and they
are useful for debugging problems, so turn them on by default.

It would be a good idea to do so for ovs-vswitchd also, but we have not
tested how much this would increase the log volume.
2009-06-23 11:03:52 -07:00
Ben Pfaff
f06b2aa9dd ovs-brcompatd: Turn up log level of port removal messages.
These messages proved useful during debugging, and they should not be too
common, so log them at a higher level.
2009-06-23 11:02:30 -07:00
Ben Pfaff
385533816c ovs-brcompatd: Handle XS Tools 5.0.0 destroying and recreating devices
XenServer Tools version 5.0.0 destroys and recreates network devices with
the same name on boot of (at least) Windows VMs.  We had a race such that
ovs-brcompatd would delete the new device from the vswitchd configuration
file (not the old one).  This commit fixes that problem.

Bug #1429.
2009-06-23 11:00:43 -07:00
Justin Pettit
887fd0ba64 Add some comments to description to netdev functions.
A few of the netdev functions lacked descriptions, so this adds them.
2009-06-22 19:01:34 -07:00
Justin Pettit
23834de273 vswitchd: Reduce number of calls to reconfigure() during mgmt updates
When we receive an OpenFlow management protocol Config Update, we
immediately force the switch to reconfigure itself.  This is
functionally correct, but it can cause long delays before return control
back to the switch.  We now keep track of whether there were any changes
and then only force a reconfigure once per management run.
2009-06-19 17:41:42 -07:00
Ben Pfaff
0c7af78c37 cfg: Log accurate waiting times in cfg_lock().
When cfg_lock() has to block for some time to obtain the configuration file
lock, it logs the amount of time that it waited.  However, it did not
refresh the current time before it began waiting, so the time that it
logged could be off by a significant amount, which make interpreting the
log file more challenging than it should have been.

This change should mainly affect log output.  It should have little or no
effect on Open vSwitch operation because the factor by which the timeouts
were off is an order of magnitude smaller than the actual timeouts that we
pass into the function.

This is related to bug #1426, but it is not a fix for this bug, which will
be committed separately.
2009-06-19 17:14:53 -07:00
Justin Pettit
6eab8112cf xenserver: xsconsole plugin doesn't need execute permissions
When the vSwitch xsconsole plugin is installed, it doesn't need execute
permissions.  This commit changes the permissions from 755 to 644 to
match the other plugins.
2009-06-18 14:17:32 -07:00
Justin Pettit
73945b1fdd xenserver: Handle slave disconnection more gracefully in xsconsole plugin
When a slave cannot connect to the master, the vSwitch xsconsole plugin
complained with some Python style errors on the main display.  This
commit cleans up that behavior.

Bug #1341
2009-06-18 14:13:00 -07:00
Justin Pettit
f304568eaa xenserver: Force reload of config file after VIF deleted
When a VIF is deleted, the "vif" script modifies "/etc/ovs-vswitchd.conf".
After changes are made to the config file, ovs-vswitchd should be told
to reload it, but this wasn't happening.  Now it does.

Thanks to Natasha for catching this.
2009-06-16 12:57:25 -07:00
Justin Pettit
cbcf0dc81c Increase version number to v0.90.1. v0.90.1 2009-06-15 16:19:08 -07:00
Ben Pfaff
510b55a2b6 Update license on file not in citrix branch to Apache 2.0.
On the citrix branch we changed the license to Apache 2.0.  Merging the
citrix branch into master hence updated the license of all the files that
existed in the citrix branch.  However one file was added in master that
wasn't in citrix, so this commit updates the license on that new file.
2009-06-15 16:08:34 -07:00
Ben Pfaff
34e63086ed Merge changes from citrix branch into master. 2009-06-15 16:04:54 -07:00
Ben Pfaff
5eccf35939 Replace SHA-1 library with one that is clearly licensed.
The SHA-1 library that we used until now was taken from RFC 3174.  That
library has no clearly free license statement, only a license on the text
of the RFC.  This commit replaces this library with a modified version of
the code from the Apache Portable Runtime library from apr.apache.org,
which is licensed under the Apache 2.0 license, the same as the rest of
Open vSwitch.
2009-06-15 16:03:28 -07:00
Ben Pfaff
a14bc59fb8 Update primary code license to Apache 2.0. 2009-06-15 15:11:30 -07:00
Ben Pfaff
01d15d868f xenserver: Fix stupid typo in previous commit (s/modudules/modules/). 2009-06-15 13:40:41 -07:00
Ben Pfaff
cc5b0099dd xenserver: Don't include veth_mod.ko in RPMs.
veth_mod.ko is built only for Linux 2.6.18 (since later versions already
have it).  Our XenServer build doesn't use it at all, so don't package it.

(This is in response to a build failure against a XenServer 5.7.0
prerelease, which uses a 2.6.27 kernel and thus for which veth_mod.ko is
not built.)
2009-06-15 13:18:15 -07:00
Ben Pfaff
e2ead27a72 vswitch: Avoid segfault when revalidating ARP flows.
The 'packet' argument to process_flow() is allowed to be null, but some of
the code was assuming that it was always non-null, which caused a segfault
while revalidating ARP flows.

Bug #1394.
2009-06-15 13:07:25 -07:00