2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-17 14:28:02 +00:00
Commit Graph

47 Commits

Author SHA1 Message Date
Ben Pfaff
fba6bd1d3f ovs-vsctl: Try connecting only once for active connections by default.
Until now, ovs-vsctl has kept trying to the database server until it
succeeded or the timeout expired (if one was specified with --timeout).
This meant that if ovsdb-server wasn't running, then ovs-vsctl would hang.
The result was that almost every ovs-vsctl invocation in scripts specified
a timeout on the off-chance that the database server might not be running.
But it's difficult to choose a good timeout.  A timeout that is too short
can cause spurious failures.  A timeout that is too long causes long delays
if the server really isn't running.

This commit should alleviate this problem.  It changes ovs-vsctl's behavior
so that, if it fails to connect to the server, it exits unsuccessfully.
This makes --timeout obsolete for the purpose of avoiding a hang if the
database server isn't running.  (--timeout is still useful to avoid a hang
if ovsdb-server is running but ovs-vswitchd is not, for ovs-vsctl commands
that modify the database.  --no-wait also avoids that issue.)

Bug #2393.
Bug #15594.
Reported-by: Jeff Merrick <jmerrick@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-03-15 16:26:47 -07:00
Ben Pfaff
ea523221d4 vlog: Take advantage of relaxed "-v" syntax through the tree.
The vlog manpage implies that writing ANY explicitly is obsolete, but
examples elsewhere in the documentation and code still tend to add it.
This removes them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-22 10:17:06 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Ben Pfaff
c1a543a8d6 vlog: Add a new log level "off".
Until now, "emer" has effectively been "off" because no messages were ever
logged at "emer" level.  Justin points out that it is useful to use "emer"
for messages that indicate a fatal error.  This commit makes that change
and adds a new "off" level to really turn off all logging to a facility.
2011-08-01 13:23:19 -07:00
David Tsai
da7198b411 xenserver: allow dom0 traffic in secure pool host when controller unavailable.
A pool configured for secure fail-mode can block dom0 traffic on hosts joining
the pool or if the host reboots while the controller is unavailable.  This
commit sets default flows on a host under these conditions to allow management
traffic.  Once the connection with the controller is re-established, these
default flows are replaced by the controller.

tests/interface-reconfigure.at updated by Ben Pfaff.

NIC-376.

Signed-off-by: David Tsai <dtsai@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-06-17 10:54:38 -07:00
Ethan Jackson
c64540e3fe xenserver: Pull slave MTU from bond record.
The MTU of the fake bond interface and the slaves participating in
a bond should all agree.  The correct long term solution to this
problem is to remove the fake bond interface altogether.  Until
that's possible, we simply set the MTU of the slaves.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2011-05-19 16:33:11 -07:00
Ben Pfaff
431488e663 Support vlan_group workaround implemented in XenServer kernels.
Some Linux network drivers support a feature called "VLAN acceleration",
associated with a data structure called a "vlan_group".  A vlan_group is,
abstractly, a dictionary that maps from a VLAN ID (in the range 0...4095)
to a VLAN device, that is, a Linux network device associated with a
particular VLAN, e.g. "eth0.9" for VLAN 9 on eth0.

Some drivers that support VLAN acceleration have bugs that fall roughly
into the following categories:

    * Some NICs strip VLAN tags on receive if no vlan_group is registered,
      so that the tag is completely lost.

    * Some drivers size their receive buffers based on whether a vlan_group
      is enabled, meaning that a maximum size packet with a VLAN tag will
      not fit if a vlan_group is not configured.

    * On transmit some drivers expect that VLAN acceleration will be used
      if it is available (which can only be done if a vlan_group is
      configured).  In these cases, the driver may fail to parse the packet
      and correctly setup checksum offloading and/or TSO.

The correct long term solution is to fix these driver bugs.  To cope until
then, we have prepared a patch to the Linux kernel network stack that works
around these problems.  This commit adds support for the workaround
implemented by that patch.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-03-16 14:39:17 -07:00
Ethan Jackson
9ec4d255ac xenserver: Delete Bridge when creating vlan.
Commit 34edeccfd8 removed a
workaround which still applies to XenServer versions older than
5.5.  This could causes creation of vlans to fail in some cases.

CC: "David Tsai" <dtsai@nicira.com>
Bug #4877.
2011-03-10 10:26:23 -08:00
Andrew Evans
da54975c9d xenserver: Add support for disabling in-band management via XAPI.
Allow users or applications to enable or disable in-band management of
individual bridges by setting the 'vswitch-disable-in-band' key in the
'other_config' attribute of the corresponding network to 'true' or
'false'.

Bug #4749.
2011-02-28 18:26:48 -08:00
Justin Pettit
34edeccfd8 xenserver: Remove support for XenServer versions older than 5.6 FP1.
Commit 404c169247 breaks compatibility with
XenServers older than 5.6 FP1.  This commit removes the last vestiges of
support for those older XenServer versions.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
2011-02-11 13:12:59 -08:00
Andrew Evans
404c169247 xenserver: Merge upstream changes and drop pre-5.6.100 support.
Citrix have made modifications to the various interface configuration scripts
that OVS replaces, so at present those modifications are lost when OVS is
installed on e.g. XenServer 5.6.100. This commit applies those changes while
preserving OVS-specific modifications that have been made in the interim.

One major change introduced by these updates is the removal of support for
XenServer releases prior to 5.6.100.

This commit also updates the OVS-supplied xen-bugtool in similar fashion. We
will soon remove xen-bugtool from OVS altogether and move the added OVS
functionality to an XML extension as described in the Supplemental Pack DDK
guide.
2011-02-11 13:03:06 -08:00
Ethan Jackson
2776e40860 xenserver: Allow LACP configuration from xapi.
Makes required changes to interface reconfigure to allow LACP
configuration from xapi.  Conforms to XenServer style bonding
configuration which is slightly different from OVS.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Bug #4213.
2011-02-03 12:26:58 -08:00
Ethan Jackson
2dd2683703 xenserver: Support fail_mode override at network level.
This patch allows the Pool object's vswitch-controller-fail-mode
setting to be overridden on by Network object.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2011-01-26 18:17:37 -08:00
Ethan Jackson
c2875f43a2 xenserver: Fix interface reconfigure crash when setting fail_mode.
Interface reconfigure can crash when setting fail_mode if an
expected other_config setting is not set.
2011-01-19 18:12:01 -08:00
Ethan Jackson
0671665d93 xenserver: Allow NULL pool in configuration cache.
InterfaceReconfigure assumes the pool is in the configuration
cache.  This is always true except when upgrading from an older
version of openvswitch which does record the pool.  This can cause
upgrades to lock up.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2011-01-19 17:08:59 -08:00
Ethan Jackson
939e5a1bbf xenserver: Allow fail_mode to be set from xapi.
This commit allows xapi to set the fail mode through the
vswitch-controller-fail-mode other-config setting in the Pool
object.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2011-01-18 14:57:08 -08:00
Ethan Jackson
b9b627d543 xenserver: Add miimon configuration support for xenserver.
This commit makes necessary changes to Interface Reconfigure to
allow miimon bond-detect-mode and bond-miimon-interval to be
changed using xapi.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2011-01-12 15:50:21 -08:00
Ethan Jackson
aa98d0cd41 xenserver: Allow bond_mode configuration in xen.
This commit adds bond_mode configuration to Interface Reconfigure
so that it may be changed using standard XenServer commands.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2011-01-11 16:19:43 -08:00
Ethan Jackson
b13300c717 xenserver: Only put the primary XenServer UUID in default bridge-id
This patch defensively guarantees that the first id in
xs-network-uuids will belong to the primary network (as opposed to
a vlan).  Given that the primary network id comes first, it parses
xs-network-ids and only copies the primary id to bridge-id when
monitor-external-ids is run.

Feature #3647

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Reviewed-by: Ben Pfaff <blp@nicira.com>
2010-09-22 11:51:57 -07:00
Justin Pettit
c76fde78c5 xenserver: Prepend XenServer external ids with "xs-"
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2010-08-25 16:48:21 -07:00
Ben Pfaff
f51c1d9890 xenserver: Kill bond slaves' dhclients when bringing up bond master.
This fixes the converse of the problem addressed by commit fe19e820
"xenserver: Kill bond master's dhclient when bringing up bond slave".  In
that commit's log message, I claimed that the converse was not a problem,
but I was wrong.  I must have screwed up in testing, because it really is
a problem.  This commit fixes it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Dominic Curran <dominic.curran@citrix.com>
Reported-by: Michael Mao <mmao@nicira.com>
Bug #2668.
2010-07-16 09:22:28 -07:00
Ben Pfaff
ab32de001f xenserver: Avoid errors from ovs-vsctl at system shutdown.
Commit 823c5699 "interface-reconfigure: callout to datapath backend class
method on rewrite" changed "interface-reconfigure rewrite" to update
bridge external-ids in the vswitch database.  But this had the side effect
of causing errors at system shutdown, since ovsdb-server gets shut down
before the rewrite action is called.  This commit fixes the problem by
skipping the update if the database socket does not exist.  (It's just
fine to skip the update, since the external-ids will be re-set the next
time the system boots anyhow.)

This commit fixed the problem on 5.6.810-34773p for me.  I don't see the
problem at all on 5.5.0.  Presumably system shutdown order has changed.

NIC-136.

CC: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-06-28 10:59:25 -07:00
Ben Pfaff
fe19e820e4 xenserver: Kill bond master's dhclient when bringing up bond slave.
interface-reconfigure is never explicitly called to down a bond master.
However, when it is called to up a slave it is implicit that we are
destroying the master.  The "bridge" version of interface-reconfigure
always "ifdown"s the bond master in such a case, but until now the
"vswitch" version has not done so.  Usually, it doesn't matter, because
the bond master network device disappears when the slave is brought up,
but one case was missed: for a bond master with an IP address obtained
via DHCP, the dhclient process needs to be killed, and we were not doing
it.  This commit starts doing it (by invoking ifdown on the bond master).

The dhclient process that hangs around doesn't cause problems until the
bond master is brought back up, at which point "ifup" fails because it
refuses to start another dhclient for the same interface.

The converse behavior is also important; that is, when a bond PIF is
brought up, interface-reconfigure is expected to implicitly take down its
slave PIFs.  My testing (on 5.5.0) shows that this behavior is already
correct.  At any rate, this commit does not change that behavior.

Bug #2668.
Bug #2734.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-06-28 10:39:03 -07:00
Ian Campbell
92e906e484 interface-reconfigure: Handle CHIN Tunnel objects
Only the vswitch backend is able to implement CHIN.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-06-23 12:32:08 -07:00
Ian Campbell
823c5699d4 interface-reconfigure: callout to datapath backend class method on rewrite
Use this mechanism to allow the vswitch backend to update the vswitch
configuration's mapping from datapath to XenAPI datamodel Network
UUIDs. The vswitch needs a mechanism to update these when they change
(i.e. on pool join and eject).

Refactor the DatapathFactory method to return the class which the
caller can instantiate or not as the require.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-06-04 10:20:36 -07:00
Ian Campbell
16f2ae571f xenserver: Ensure that Bridge.other-config:hwaddr and Interface.MAC are set as appropriate.
Otherwise bridges can end up with a generated MAC address using Nicira OID
which has an impact when using DHCP on that devices.

tests/interface-reconfigure.at updated by Ben Pfaff.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-03-26 09:35:46 -07:00
Ben Pfaff
5c43922c13 vswitchd: Make names of Bridge external_ids generic.
Until now the names of the external_ids keys used for Bridge records have
implied that they are specific to XenServer, because they begin with "xs-".
They are more generic in intent, however, so this commit removes the "xs-"
prefix and explains them more generically.

This finishes the renaming process started in commit c0f9490 "vswitchd:
Make names of Interface external_ids generic."

CC: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-03-24 14:56:53 -07:00
Ben Pfaff
47a3c536c3 xenserver: Implement missing interface-reconfigure settings.
These settings are supported by the bridge, and they were supported
earlier by the vswitch, but support regressed when OVSDB was initially
introduced because at first ovs-vsctl did not support these settings.
This commit restores support.

Related to bug #2430, #2442.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-03-03 09:55:33 -08:00
Ian Campbell
df9a459ab6 vswitch: interface-reconfigure: bring down physical interfaces
This should be done when bringing down the last PIF which uses a
datapath in order to account for VLAN PIFs sharing a datapath.

The logic in bring_down() already acounts for this requirement by
clearing the dp variable if the datapath is still required so if we
get as far as deconfiguring that datapath then it is also correct to
bring down the physical devices.

With unit test suite update by Ben Pfaff.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-02-26 09:31:14 -08:00
Ian Campbell
9a2b117527 CP-1592: interface-reconfigure: Configure network device MTU from Network.MTU field
With override via other-config:mtu field on specific objects in the datamodel.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1267008538 0
# Node ID a91df72fd4bf6329831d3efcae45a5ff55e3ba2e
# Parent  219104a041786d7274b15800de5c3efccf0c4f42
2010-02-24 10:54:41 -08:00
Ben Pfaff
86e1bb44da xenserver: Add assertion and additional comments to ovs-vsctl commands.
I found these useful while debugging.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:55:41 -08:00
Ben Pfaff
7966caf4a0 xenserver: Remove a VLAN's bridge when bringing down its PIF.
Before, interface-reconfigure would only bring remove a VLAN's bridge
incidentally as part of removing its datapath's bridge.  This commit fixes
it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:55:39 -08:00
Ben Pfaff
2a75efe823 xenserver: Avoid doing unneeded work in deconfigure_datapath().
Deleting a bridge deletes all of its ports, too, so there's no benefit in
doing so manually beforehand.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:55:37 -08:00
Ben Pfaff
c0a50086d9 xenserver: Set xs-network-uuids for both datapath and VLAN bridges.
It makes sense to set xs-network-uuids for every bridge, so this commit
does so.  It also makes the code a bit more readable by factoring logic
out into a new function.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:55:35 -08:00
Ben Pfaff
56cac225ae xenserver: Always call ovs-vsctl in bring_down().
The datapath_modify_config() call here was at the wrong level of
indentation, so it was only getting called if 'dp' was to be deleted.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:52:39 -08:00
Ben Pfaff
d77ffabfbc xenserver: Fix bringing up VLAN PIFs.
In configure_datapath(), bringing up a VLAN PIF's datapath is no different
from bringing up a non-VLAN PIF's datapath, but the code was making
unnecessary distinctions.  Also, the test
	if parent and datapath:
did not work at all, because there was no variable named 'datapath' in
scope and no obvious source of one.

In preconfigure(), it then becomes necessary to create a VLAN bridge for a
VLAN PIF, in a straightforward way.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:52:18 -08:00
Ben Pfaff
96c7918c40 xenserver: Hoist identical bridge and vswitch functions into common code.
The previous commit made pif_bridge_name() in the bridge and vswitch
versions of interface-reconfigure functionally identical, so this commit
hoists them into a single common implementation in InterfaceReconfigure.py.

pif_is_bridged() also comes along for the ride because it is also generic
and because it is logically related.  Only the bridge code uses it at the
moment.

Suggested-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:52:13 -08:00
Ben Pfaff
6987c81c05 xenserver: Accept VLAN PIFs in pif_bridge_name().
pif_bridge_name() was written when the vswitch interface-reconfigure was
working with the raw Open vSwitch configuration via ovs-cfg-mod.  Then,
it made no sense to ask for the "bridge name" of a VLAN PIF, because a
VLAN PIF didn't have a bridge.

Now, however, the vSwitch interface-reconfigure works with ovs-vsctl, which
provides a thin layer over the OVS configuration that makes VLAN bridges
appear to exist.  So now it makes sense to ask for the bridge of a VLAN
PIF, and this commit enables that.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:51:59 -08:00
Ben Pfaff
7c79588e00 xenserver: Delete ports by interface name.
ovs-vsctl command "--if-exists del-port eth0" does nothing if eth0 is on
a bridge as part of a bond, because the bond's port name is not eth0 but
something else.  But interface-reconfigure needs to do that, so this commit
adds that ability to ovs-vsctl and modifies interface-reconfigure to use it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:51:44 -08:00
Ben Pfaff
3b1acc9955 xenserver: Fix comment in interface-reconfigure.
This comment was accurate, but didn't actually say what the function did.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:51:33 -08:00
Ben Pfaff
c69ee87c10 Merge "master" into "next".
The main change here is the need to update all of the uses of UNUSED in
the next branch to OVS_UNUSED as it is now spelled on "master".
2010-02-11 11:11:23 -08:00
Ben Pfaff
e91087c7f9 xenserver: Fix bond configuration.
This bug was introduced as part of the merge from "master" and does not
therefore exist in Citrix upstream code.
2010-02-10 16:57:48 -08:00
Ben Pfaff
7b09e42666 xenserver: Fix failure to bring up secondary management interfaces.
When a secondary management interface is configured on a XenServer,
interface-reconfigure would fail to bring it up because it would attempt
to add a bridge that already exists.  This commit makes it tolerate that
situation.
2010-02-09 12:13:52 -08:00
Justin Pettit
13ffee26f1 xenserver: Various cleanups to get OVS to work with XenServer 5.5 2010-02-06 20:48:48 -08:00
Justin Pettit
a4af00400a Merge branch 'master' into next
Conflicts:
	COPYING
	datapath/datapath.h
	lib/automake.mk
	lib/dpif-provider.h
	lib/dpif.c
	lib/hmap.h
	lib/netdev-provider.h
	lib/netdev.c
	lib/stream-ssl.h
	ofproto/executer.c
	ofproto/ofproto.c
	ofproto/ofproto.h
	tests/automake.mk
	utilities/ovs-ofctl.c
	utilities/ovs-vsctl.in
	vswitchd/ovs-vswitchd.conf.5.in
	xenserver/etc_init.d_vswitch
	xenserver/etc_xensource_scripts_vif
	xenserver/opt_xensource_libexec_interface-reconfigure
2010-02-05 17:14:55 -08:00
Ian Campbell
66aeba23bd CA-37154: vswitch: Use MAC address of tagged PIF for VLAN fake-bridge
This is because PIF.MAC for a VLAN is FE:FF:FF:FF:FF:FF. In bridge
mode the VLAN and the bridge naturally pick up the underlying MAC
address from the physical device but under vswitch we must explicitly
specify it and we are currently specifying
FE:FF:FF:FF:FF. interface-reconfigure needs to use the MAC address of
the tagged PIF not the untagged PIF.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1265020755 0
# Node ID d7fc59d6a274334377fdbb09dcaf80a76431bcdb
# Parent  a6f27b5a3096ce627b5003c7be19ca59f7dd9606
2010-02-01 09:50:14 -08:00
Ian Campbell
b3080599f6 xenserver: Update interface-reconfigure and vif integration scripts.
This patch updates the versions of the host integration scripts to
what is present in the recent XCP update and the next release of
XenServer (5.6). I think it probably works on 5.5 as well but I
haven't verified that.

These new versions support runtime selection of the Linux bridging vs
vswitch through the toolstack. The patch includes the necessary
reconfiguration (rewriting /etc/xensource/network.conf) to enable
vswitch in the RPM %post stage.

The RPM spec file integration is only lightly tested, seems to work
for me.

This commit is as provided by Ian Campbell, with a few minor tweaks:

    - Updated xenserver/automake.mk to distribute the added files.

    - Updated RPM spec file not to complain if the added files do
      not already exist (since they do not exist on XenServer 5.5.0).

    - Change location of dbcache back to /var/lib/openvswitch/dbcache
      so that this can coexist with our other internal builds.
      (Undoubtedly we will have to adopt the new location chosen by Ian
      eventually, however.)
2010-01-25 10:36:08 -08:00