2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 05:47:55 +00:00

19894 Commits

Author SHA1 Message Date
Ian Campbell
55bc65533f xenserver: use ovs-vsctl for VIF VLANs instead of separate state files
ovs-vsctl did not exist when this code was originally written, but it
provides exactly what is needed to get rid of those separate state
files.

The vif hotplug script diff is against the xs5.7 branch but I think is
applicable to master and/or citrix with just context changes.

I was thinking of using ovs-vsctl exclusively for configuration
modifications from the vif hotplug script but that would need a
mechanism to pass the additional vif details to ovs-vsctl add-port as
well as perhaps making the bridge optional to del-port. The other option
would be to use the --no-reload option and split the config mods into
two parts, but I don't like that idea much.
2009-10-05 10:07:28 -07:00
Ian Campbell
7744280b18 xenserver: Include bridge.*.xs-network-uuids for all networks
Previously I advised that only networks which were currently attached to
the host be listed in /etc/ovs-vswitchd.conf. However I've just realised
that this interacts badly with the slightly ugly special case used for
PIF.currently-attached when reading from dbcache instead of talking to
Xapi. This bites on boot when /etc/init.d/management-interface tries to
plug a selection of PIFs which are deemed to be somehow required by
xapi. (not helped by a bug in XenServer 5.7.0 which can cause this list
to be larger than it should be and not internally consistent).

For now I think it prudent to simply list all networks which could
potentially be attached to a given datapath, until I can figure out what
the sane fix is on the XenServer end.

(I think there are two options for a proper fix, either inspect the
current state of the network devices or assume dbcache represents the
desired final state after devices are plugged on boot. I'm leaning
towards the later since the dbcache should indicate the set of PIFs
which were attached on shutdown, which xapi will likely be trying to
replug on boot... Needs more thought though).
2009-10-05 09:49:34 -07:00
Ben Pfaff
52df17e745 vswitch: Allow user to set Ethernet address of any internal interface.
Until now the vswitch configuration file has allowed the user to configure
the MAC address on bridge local ports only.  This commit adds the ability
to configure them on any internal interface.

It would be logical to extend this to any bridge port, period, but many
network devices must be brought down before their Ethernet addresses may be
changed.  Bringing a network interface down and then back up can reset a
lot of state, so as we don't actually need the ability to change any bridge
port's MAC address yet this commit does not implement it.

CC: Ian Campbell <Ian.Campbell@citrix.com>
2009-10-02 17:12:31 -07:00
Ben Pfaff
557d8e6cbf vswitch: Factor out detection of internal interfaces into a new function.
The following commit needs to use this same logic, so break it out into
a function to avoid redundancy.
2009-10-02 17:12:31 -07:00
Ben Pfaff
6cfaf517a3 secchan: Clarify logic in add_output_action().
The code and the logic here was too terse for anyone to reasonably
understand it.  Add some comments.

This should not cause any behavioral change.

CC: Jean Tourrilhes <jt@hpl.hp.com>
2009-10-02 17:12:31 -07:00
Justin Pettit
f17d7bd838 dpif-linux: Clarify bad device warning message
The message warning that the device number is wrong for the Open vSwitch
devices could have been clearer.

Thanks to Ben Pfaff for the suggested wording.
2009-10-02 16:59:28 -07:00
Justin Pettit
57aaff8a99 dpif-linux: Fail earlier if OVS kernel module isn't loaded
When the kernel module isn't loaded, the bridge tries to open all the
possible minor devices, regardless.  This change first checks that there
is a major device number for Open vSwitch and only then tries to open the
minor devices.

This change also removes the assumption that there's a default Open vSwitch
major device number, since the kernel module always attempts to get a
dynamic one.  Maybe one day we'll have one...

Bug #1179
2009-10-02 16:07:32 -07:00
Ian Campbell
0b8870d4a5 xenserver: Rework interface-reconfigure.
Substantially reworks interface-reconfigure, with the following fixes:

      * Create and use ifcfg files only for ipdev, use vswitch
        configuration for topology setup.

      * Take care over moving from bond to slave and back to tear down
        any residual sibling devices

      * Take care to leave datapath present when manipulating VLANs to
        avoid interrupting traffic on the slave PIF as well as other
        VLANs.

      * Lots of minor stuff
2009-10-02 11:35:42 -07:00
Ian Campbell
aeb4cedaa1 xenserver: Clear vlan.* from /etc/ovs-vswitchd.conf on boot too 2009-10-02 11:11:06 -07:00
Ian Campbell
31118b510e Correct whitespace in xenserver/etc_init.d_vswitch 2009-10-02 11:09:08 -07:00
Ben Pfaff
eb395f2ebf netdev-linux: Improve netdev_linux_set_etheraddr().
Fixes a bug whereby netdev_linux_set_etheraddr() would update the cached
Ethernet address but not mark it valid.  (This potentially wasted a system
call later but wasn't harmful.)

As an added optimization, don't set the Ethernet address at all if the
new address is the same as the current address.
2009-10-02 11:04:06 -07:00
Jesse Gross
c0e5f6cabe netdev-linux: Return correct error codes on receive.
netdev_linux_receive was returning positive error codes while the
interface specifies that it should be returning negative errors.
This difference causes a huge increase in (non-existant) packet
processing with the userspace datapath.
2009-10-02 10:36:41 -07:00
Ben Pfaff
254e1d7946 xenserver: Clear stale configuration keys on boot, but not on later starts 2009-10-01 15:56:36 -07:00
Ian Campbell
378e1f9854 xenserver: Clear stale configuration keys on boot 2009-10-01 15:56:26 -07:00
Ben Pfaff
3f3879d205 xenserver: Clear stale configuration keys on boot, but not on later starts 2009-10-01 09:53:11 -07:00
Ian Campbell
e1563fefb2 xenserver: Clear stale configuration keys on boot 2009-10-01 09:53:11 -07:00
Jesse Gross
0a6d2aa673 netdev: Add classes which don't require initialization.
If a class requires does not require initialization, still add it
to the list of netdev classes.
2009-09-30 12:43:19 -07:00
Jesse Gross
1a487cec00 netdev-linux: Fix tap device using wrong FD.
Tap devices were doing ioctls on the AF_INET socket, instead of the
FD opened on the tap device.
2009-09-30 12:43:05 -07:00
Jesse Gross
effb3acf60 netdev: Fix memory leak in netdev_open.
The name of the netdev is copied but is never freed.
2009-09-30 12:42:10 -07:00
Jesse Gross
362424c31e netdev: Fix typo in netdev provider enumerate. 2009-09-30 12:41:47 -07:00
Ben Pfaff
c38cd4bc70 xenserver: In xsconsole plugin, log via XSConsoleLog module.
Part of a patch from Ian Campbell <ian.campbell@citrix.com>.
2009-09-30 12:24:46 -07:00
Ian Campbell
5990cd4619 Drop separate vswitch-cfg-update.log.
xapi will log any error returned by the plugin.
2009-09-30 12:18:26 -07:00
Jesse Gross
a7a31d2d18 Document issues with RSPAN and MAC learning.
Bug #2118
2009-09-29 11:02:04 -07:00
Ben Pfaff
2b71f01160 xenserver: Add script refresh-xs-network-uuids.
On pool join, the bridge.<bridge>.xs-network-uuids key is not updated
properly for the primary management interface.  We don't have a proper
fix for this problem yet, and probably won't ever have one for XenServer
5.5.0, so this commit adds a script that works around the problem.
Running the script is a shortcut for rebooting the XenServer host,
which should also solve the problem.

Bug #2097.
2009-09-28 16:03:49 -07:00
Ben Pfaff
ed7cd1f8c4 Document per-port round-robin during controller rate limiting.
CC: Peter Balland <peter@nicira.com>

Bug #2072.
2009-09-28 10:39:24 -07:00
Ben Pfaff
1840902cac debian: Make dependencies on openvswitch packages specify exact version.
NOX packages depend on a particular version of openvswitch-pki, which
depends on openvswitch-common without specifying a version.  This meant
that the installed versions of openvswitch-pki and openvswitch-common
could easily get out of sync.  This commit makes all of the dependencies
among openvswitch packages specify an explicit version, which should fix
this problem.

CC: Dan Wendlandt <dan@nicira.com>
2009-09-28 10:15:22 -07:00
Ben Pfaff
d855aeadfd shash: Fix memory leak in shash_destroy().
hmap_destroy() has to be called so that sh->map.buckets gets freed.
2009-09-24 10:23:22 -07:00
Ben Pfaff
576e26d7b4 Merge citrix branch into master. 2009-09-22 10:17:44 -07:00
Ben Pfaff
36becebea2 brcompatd: Delete VLAN tags only for the correct port in del_port().
vlan.%s.* will match e.g. eth0.123 if the %s expands to eth0.  We only
want it to match eth0 in that case.

This is based on code inspection.  It may or may not fix a real problem.
2009-09-22 10:08:10 -07:00
Justin Pettit
f928967abe Get ready to tag 0.90.5 release. 2009-09-21 17:04:18 -07:00
Justin Pettit
3c708eb8ae Add ChangeLog to track changes 2009-09-21 17:04:18 -07:00
Ben Pfaff
2a6cb303b0 fatal-signal: Add clarifying comments.
Suggested by Justin Pettit.
2009-09-21 16:56:37 -07:00
Ben Pfaff
56192221b7 vconn-unix: Unlink Unix sockets for vconns at close and free memory.
The make_unix_socket() function that Unix vconns use to create their
bindings calls fatal_signal_add_file_to_unlink() to make sure that the
binding socket gets unlinked from the file system if the process is killed
by a fatal signal.  However, this doesn't happen until the process is
actually killed, even if the vconn that owns the socket is actually closed.

This wasn't a problem when the vconn-unix code was written, because all
of the unix vconns were created at process start time and never destroyed
during the normal process runtime.  However, these days the vswitch can
create and destroy unix vconns at runtime depending on the contents of its
configuration file, so it's better to clean up the file system and free
the memory required to keep track of these sockets.

This commit makes unix vconns and pvconns delete their files and free
the memory used to track them when the (p)vconns are closed.

This is only a very minor leak most of the time.

Bug #1817.
2009-09-21 16:44:58 -07:00
Ben Pfaff
6a0061cbf5 fatal-signal: New function fatal_signal_unlink_file_now().
This is a helper function that combines two actions that callers commonly
wanted.  It will have an additional user in an upcoming commit.
2009-09-21 16:44:58 -07:00
Ben Pfaff
411baaacb8 fatal-signal: Clean up code by using shash.
This simplifies the code here and should speed it up, too, when there are
lots of files to unlink on a fatal signal.
2009-09-21 16:44:57 -07:00
Ben Pfaff
85ab0a0215 vconn: Remove unused "reconnectable" member from vconn.
This member is initialized, but nothing ever reads it, so get rid of it.
2009-09-21 16:44:57 -07:00
Ben Pfaff
c77dc7705b vswitchd: Fix memory leak in bridge_reconfigure().
Bug #1817.
2009-09-21 16:10:44 -07:00
Ben Pfaff
0b9eaeb911 netdev: Fix memory leak in get_stats_via_netlink().
Bug #1817.
2009-09-21 16:10:42 -07:00
Justin Pettit
6643c03b4f vswitch: More accurately identify slave status for compatibility
Ben Pfaff dug through the kernel sources and reported that
bond_miimon_inspect() supports four BOND_LINK_* states:

       * BOND_LINK_UP: carrier detected, updelay has passed.

       * BOND_LINK_FAIL: carrier lost, downdelay in progress.

       * BOND_LINK_DOWN: carrier lost, downdelay has passed.

       * BOND_LINK_BACK: carrier detected, updelay in progress.

And that bond_info_show_slave() only considers BOND_LINK_UP to be "up"
and anything else to be "down".

Thanks for doing this and suggesting a fix, Ben!
2009-09-17 23:04:08 -07:00
Ben Pfaff
ba25c9d14a util: Add comments. 2009-09-17 15:12:34 -07:00
Ben Pfaff
d0c9d304ff vswitchd: Fix unimportant memory leak.
Free dpif_names when we're done with it.

This memory leak is not a big deal since bridge_init() is only ever called
once in a given ovs-vswitchd execution.
2009-09-17 14:46:18 -07:00
Ben Pfaff
bbb18ba723 bitmap: Don't allocate excessive memory.
ROUND_UP rounds up to a multiple of a given value.  That means that
bitmap_allocate() was allocating one byte for each bit in the bitmap,
which is clearly excessive.

Instead, just allocate one bit for every bit in the bitmap.
2009-09-17 14:45:18 -07:00
Justin Pettit
850887473a in-band: Document logic behind in-band's design.
There have been numerous attempts at getting in-band correct.  If
history is at all an example, it probably still isn't.  However, this is
an attempt to document its current design, so that we can understand
what our current thinking is.
2009-09-17 13:45:56 -07:00
Justin Pettit
30ee1c4dad Add ChangeLog to track changes 2009-09-17 13:45:53 -07:00
Justin Pettit
d4260cb4ee ovs-appctl: Correct "target" option synopsis in man page
The synopsis section of the man page for ovs-appctl incorrectly stated
that the target option takes "pid" as an argument.  This commit corrects
that to say "socket".
2009-09-17 13:42:54 -07:00
Ian Campbell
fa2bec94d0 xenserver: Synchronize interface-reconfigure from Citrix.
* Drop "--test-mode" option -- it was never wired up to anything.

* Add some additional checks for valid parameter combinations

* Raise some errors for unimplemented (but not currently used in
  XenServer) options.
2009-09-17 11:33:00 -07:00
Ben Pfaff
7d9809efd8 ovs-vswitchd: Define missing .IQ macro in manpage.
This manpage was using a nonstandard macro that it did not define.  Fix
the problem by adding the definition.

Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
2009-09-17 09:32:33 -07:00
Ian Campbell
e0644b6125 vswitchd: implement bond/hash unixctl
Our test case automation has a requirement to know which hash value a
given MAC address hashes to, in order to validate that balancing is
happening as expect etc.. Rather than attempt to reimplement the hash
algorithm used by vswitchd in python instead expose an appctl which
returns this information.
2009-09-17 09:29:53 -07:00
Ben Pfaff
d1a328a65d xenserver: Remove vswitch dbcache file during RPM uninstall.
It's good to clean up.

Ported from "citrix" to "master" branch with file name updated.

CC: Keith Amidon <keith@nicira.com>
CC: Henrik Amren <henrik@nicira.com>
2009-09-17 09:26:55 -07:00
Ben Pfaff
057fed2b5c xenserver: Drop "init-dbcache" by making PIF optional for "rewrite".
Commit ac9634f0af "xenserver: Make RPM install work again" introduced a
new command "init-dbcache" for the interface-reconfigure script.  However
it is cleaner to simply make the PIF argument to the "rewrite" command
optional.

CC: Ian Campbell <Ian.Campbell@citrix.com>
2009-09-17 09:23:18 -07:00