2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-28 21:07:47 +00:00

663 Commits

Author SHA1 Message Date
Justin Pettit
d49d354b7a vswitch: Set control_ip in sFlow configuration 2010-02-07 00:10:02 -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
Ben Pfaff
6468b79c63 ofproto: Remove support for OpenFlow-based management protocol.
Older versions of Open vSwitch supported a management protocol based on
OpenFlow message framing.  The current Open vSwitch instead uses the
OVSDB protocol for the same purposes.  We don't plan to support this older
protocol any longer, so this commit deletes support.

This commit also deletes the management_id column from the vswitch's
database schema.  The management_id was used by the older management
protocol to match up OpenFlow switch connections to management connections,
but the current implementation instead matches up connections based on
the datapath IDs exported by the configuration database.  In fact, the
OpenFlow connections had no way to actually export the management ID, so
this just deletes code that was essentially without function anyhow.
2010-02-01 10:05:44 -08:00
Jesse Gross
1a6f1e2a6d dpif: Update dpif interface to match netdev.
This brings over some features that were added to the netdev interface,
most notably the separation between the name and the type.  In addition
to being cleaner, this also avoids problems where it is expected that
the local port has the same name as the datapath.
2010-01-27 20:03:38 -05:00
Jesse Gross
cd746526ab bridge: Properly read NetFlow parameters.
When reading the NetFlow engine type and ID from the config database
we weren't dereferencing the variables.
2010-01-27 15:31:19 -05:00
Ben Pfaff
8f30d09ab0 mac-learning: Rename "non-learning VLANs" to "flood VLANs".
Usually positive names are better than negative ones.
2010-01-19 10:41:46 -08:00
Ben Pfaff
37e7f42772 Reimplement port mirroring configuration for database.
Tested only to the extent that it doesn't obviously break anything else.
2010-01-19 10:40:36 -08:00
Jesse Gross
149f577a25 netdev: Fully handle netdev lifecycle through refcounting.
This builds on earlier work that implemented netdev object refcounting.
However, rather than requiring explicit create and destroy calls,
these operations are now performed automatically based on the referenece
count.  This is important because in certain situations it is not
possible to know whether a netdev has already been created.  A
workaround existed (which looked fairly similar to this paradigm) but
introduced it's own issues.  This simplifies and unifies the API.
2010-01-15 11:34:34 -05:00
Ben Pfaff
2c30e5d117 vswitch: Fix null pointer dereference in iface_is_internal().
Reported by Henrik Amren.
2010-01-11 15:22:11 -08:00
Ben Pfaff
fe55ad159d vconn: Reimplement in terms of the "stream" abstraction.
This reduces the amount of redundancy in the source tree, by making all of
the current implementations of a vconn simply delegate to the "stream"
abstraction.
2010-01-06 14:35:20 -08:00
Ben Pfaff
72b0630028 Initial implementation of sFlow.
Tested very slightly with "ping" and "sflowtool -t | tcpdump -r -".
2010-01-04 13:08:37 -08:00
Ben Pfaff
2280e7223c ofproto: Drop remote command execution feature.
At one point Nicira had deployment plans for which adding a remote command
execution feature to the OpenFlow stack made a lot of sense.  We no longer
have those plans, as far as I know, and leaving the feature in seems like
a huge potential security hole.  So this commit blows away the entire
feature.
2010-01-04 10:09:27 -08:00
Ben Pfaff
b54e22e91e Make ovs-vswitchd report when it is done configuring; make ovs-vsctl wait.
Until now the ovsdb-based vswitch has provided no way to know when it has
finished applying the configuration from the database.  This commit
introduces a way:

  * The client who wants to wait increments the "next_cfg" column of the
    Open_vSwitch record.

  * When ovs-vswitchd finishes reconfiguring, it sets the value of the
    "cur_cfg" column to that of the "next_cfg" column.

  * The client waits until the "cur_cfg" column is at least as great as
    the value it set into "next_cfg".

This allows us to drop the 5-second sleep in interface-reconfigure.
2009-12-16 16:26:17 -08:00
Ben Pfaff
141f49423d vswitchd: Do not choose generated MAC address for local port.
ovs-vswitchd needs to choose a sensible MAC address for the local port of
a bridge.  Until now, the algorithm has ignored certain interfaces, in
particular internal interfaces and those with the MAC addresses that
indicate that they are probably Xen VIFs.  The goal is to choose a physical
interface's MAC address because this is more stable and more likely to
be meaningful to the outside world.  Stability, in turn, is important
because the MAC address of the local port is used as the default datapath
ID for OpenFlow connections.

This existing algorithm was too specialized to work well with the new
kinds of ports that we have been introducing in OVS.  In particular,
GRE ports could be chosen as the MAC address.  This commit changes the
algorithm for choosing the local port MAC address.  Now it ignores any
interface that has the "local" bit set in its MAC address, which
catches GRE ports.  The new rule also catches the VIF and internal
port cases, so this commit also deletes those special cases.

This commit deleted the only user of eth_addr_is_vif(), so it deletes
that function also.

Jesse Gross suggested this revised heuristic.

CC: Jeremy Stribling <strib@nicira.com>
2009-12-14 13:09:47 -08:00
Ben Pfaff
093e47f487 vswitch: Set datapath_id and ofport in ovsdb.
Now ovs-vswitchd fills in the Interface ofport and Bridge datapath_id
fields when it reconfigures.

The existing Bridge datapath_id and hwaddr columns, which had surprising
meanings, have been banished to a new other_config column.
2009-12-11 17:03:35 -08:00
Ben Pfaff
e073f944f5 vswitchd: Avoid segfault when local port is required but missing.
Connecting to a controller requires the vswitch to have a local port
(typically named the same as the bridge itself).  Before the introduction
of ovsdb ovs-vswitchd simply added the local port itself if it was missing.
This was not properly implemented with the ovsdb transition, and a segfault
resulted.  This commit avoids the segfault, although it should possibly
be improved to also add the local port, as before.

CC: Jeremy Stribling <strib@nicira.com>
2009-12-07 13:34:33 -08:00
Jesse Gross
a740f0de5b gre: Add userspace GRE support.
This implements the userspace portion of GRE on Linux. It communicates
with the kernel module to setup tunnels using either Netlink or ioctls
as appropriate based on the kernel version.

Significant portions of this commit were actually written by
Justin Pettit.
2009-12-07 12:48:08 -08:00
Jesse Gross
e9e2856e08 netflow: Correctly set active timeout value.
This fixes a bug originally introduced in commit 763435 "vswitchd:
Initial conversion to database-based configuration."  The bug
reversed a less than operator when setting the active timeout field.
Also add a warning if the timeout is set to an invalid value.

CC: Glen Gibb <grg@stanford.edu>
2009-12-07 11:10:06 -08:00
Ben Pfaff
fa33d64a57 vswitchd: Avoid segfault when creating a bridge fails.
bridge_create() can return a null pointer if creating the bridge fails, so
check for that and don't dereference it in that case.

Thank to Jeremy Stribling for reporting the problem.
2009-12-03 15:14:56 -08:00
Ben Pfaff
7634353824 vswitchd: Initial conversion to database-based configuration.
This has seen very little testing, so some features are almost certainly
busted.  Port mirroring is not yet converted, so it will definitely not
work.
2009-12-03 11:28:40 -08:00
Ben Pfaff
ba54bf4f65 vswitchd: Remove vestigial spanning tree protocol (STP) support.
ovs-vswitchd has never supported spanning tree protocol, but there was
nevertheless a considerable amount of code that provided a framework for
supporting it.

This commit deletes this code, since we have no plans to introduce STP
support soon.
2009-12-03 10:59:09 -08:00
Ben Pfaff
58fda1dab1 Merge "master" branch into "db". 2009-12-02 11:49:53 -08:00
Ben Pfaff
b36682d8dc vswitchd: Fix build when source and build directory differ. 2009-12-02 11:18:52 -08:00
Justin Pettit
6c88d577e8 netdev: Allow explicit creation of netdev objects
This change adds netdev_create() and netdev_destroy() functions to allow
the creation of network devices through the netdev library.  Previously,
network devices had to already exist or be created on demand through
netdev_open().  This caused problems such as not being able to specify
TAP devices as ports in ovs-vswitchd, which this patch fixes.

This also lays the groundwork for adding GRE and VDE support.
2009-12-01 19:01:01 -08:00
Ben Pfaff
d879a707a3 ovsdb: Add ovsdb IDL compiler to build system.
This first stab at any interface definition language and compiler for OVSDB
will give other developers a chance to look at it and try to integrate it.
The IDL is not actually implemented yet; I am working on that.
2009-11-23 16:07:36 -08:00
Ben Pfaff
efacbce62f dpif: New function dpif_create_and_open().
This function combines what dpif_create() and dpif_open() do.  It allows
us to factor a tiny amount of code out of the vswitch, but more importantly
this function is also useful in the following commit.
2009-11-23 15:58:48 -08:00
Ben Pfaff
d17ee8689b Merge citrix branch into master. 2009-11-18 14:14:29 -08:00
Jesse Gross
f1bd68ab58 bridge: Fix segfault when updating learning table for deleted port.
A function call using in_port was accidentally moved before the check
to see if it is null.  in_port can be null if a port was deleted but
an update is still pending.  This moves the call after the check.

Bug #2313
2009-11-11 17:15:10 -08:00
Jesse Gross
42061b2a5b mirroring: Preserve key for disabling learning.
Don't delete the key for disabling MAC learning on a given VLAN
after a reboot.  Also logs when learning is disabled.
2009-11-11 16:00:05 -08:00
Jesse Gross
e96a4d8035 bridge: Feed flow stats into learning table.
Update the learning table to keep it current with flows actually
going through the datapath.  This ensures that entries do not age
out when they are actively being used.

Feature #2209
2009-11-11 15:58:21 -08:00
Jesse Gross
d65349ea28 Merge citrix branch into master. 2009-11-10 15:12:01 -08:00
Jesse Gross
f2d7fd66cf mirroring: Allow learning to be disabled on a VLAN.
RSPAN does not work properly unless MAC learning for the VLAN is
disabled on all switches between the origin and monitoring point.
This allows learning to be disabled on a given VLAN so vSwitch can
acts as an intermediate switch.

Feature #2136
2009-11-10 13:37:08 -08:00
Jesse Gross
93dfc06772 bridge: Require learning table at all times.
The bridge nominally allowed the MAC learning module to not be enabled
though in reality it was always used.  Tracking active MAC addresses
in the bridge is useful for other reasons besides deciding the output
port - primarily for bonding.  In addition there were several bugs
that would have been triggered had learning actually been disabled since
that code path is never tested.  This makes it explicit that the learning
table should be maintained at all times.
2009-11-09 16:37:01 -08:00
Jesse Gross
8b2a2f4a79 bonding: Ignore updelay if there is no active slave.
If all slaves on a bond are down but some are waiting for an updelay,
enable the slave with the shortest amount of delay remaining.  This
would already occur if all other slaves were disabled at the time the
delay was to begin but not if a delay was already in progress.  This
also immediately sends learning packets out in both situations, which
prevents incoming packets to disabled slaves from being blackholed.

CC: Danny Wannagat <Danny.Wannagat@eu.citrix.com>
2009-11-09 14:32:29 -08:00
Ben Pfaff
2886875a38 Fix incorrect printf format specifiers.
GCC reported these during a 64-bit build.
2009-11-09 10:30:10 -08:00
Ben Pfaff
ec6fde61c8 Add new function xzalloc(n) as a shorthand for xcalloc(1, n). 2009-11-04 14:52:32 -08:00
Jesse Gross
0193b2afce netflow: Implement NetFlow active timeouts.
Provides a NetFlow expiration message at regular intervals if the
key netflow.<br>.active-timeout is set.

Feature #1317
2009-11-03 14:05:17 -08:00
Ben Pfaff
8ca79daaa0 unixctl: Allow passing auxiliary data to unixctl commands.
This will allow users of unixctl to avoid using global variables, leading
to cleaner code.
2009-10-29 15:20:56 -07:00
Jesse Gross
6a07af3678 netflow: Populate NetFlow output interface field.
Previously NetFlow expiration messages always contained 0 as the
output interface index.  This changes that to report the OpenFlow
interface instead.

Feature #1202
2009-10-27 13:19:15 -07:00
Jesse Gross
69d60f9f4e bridge: Allow flows based on ARP opcode to be installed.
Since we can now distinguish between flows with different ARP opcodes
in the kernel, allow these flows to be installed.
2009-10-26 11:32:35 -07:00
Ben Pfaff
3f355f47f8 Merge "citrix" into "master".
This merge took a little bit of care due to two issues:

    - Crossport of "interface-reconfigure" fixes from master back to
      citrix that had happened and needed to be canceled out of the merge.

    - New script "refresh-xs-network-uuids" added on citrix branch that
      needed to be moved from /root/vswitch/scripts to
      /usr/share/vswitch/scripts.
2009-10-22 17:43:28 -07:00
Jesse Gross
2416b8ecea bridge: Eject NORMAL flows without a learning entry from datapath.
When revalidating NORMAL flows we consult the learning table, which
could be empty if a packet hasn't come to userspace in a while or we
just did a bridge flush.  If there is no learning entry then existing
flows will begin flooding packets until a new flow is setup.  The
problem is worse with bonding because we can receive one of the flooded
packets back on a bond slave and learn that port, causing us to send
traffic to the wrong location.
2009-10-22 11:40:04 -07:00
Jesse Gross
5422a9e189 bonding: Balance bond slaves based on ratio.
Previously when deciding whether to migrate a hash between slaves
we would never move it if it would cause more load on the new slave
than the old.  This could lead to a situation where the slaves would
be imbalanced but no migration would occur since it would flip the
load.  This will do the migration if it will decrease the ratio.

Bug NIC-49
2009-10-20 19:26:55 -07:00
Jesse Gross
3a55ef1483 bonding: Drop unicast packets which have a different learned port.
Drop packets received on a bond port if we have learned a different
source port for that MAC.  We were already doing this for multicast
packets but extend the logic to unicast packets as well since the
same situation can occur if the connected switch has not learned the
MAC address and is flooding.  Otherwise vSwitch will learn the bond
port as the source of that MAC.

Bug #2167
2009-10-20 10:52:31 -07:00
Jesse Gross
43aa5f47f1 vlan: Compare vlan tags before implicit tagging when RSPANing.
We check that a packet is not sent out the on the in port on the
same VLAN when performing RSPAN.  However, we were comparing the
vlan tag from a packet after implicit tagging with a tag from
before implicit tagging.  This ensures that we always compare them
before such tagging.
2009-10-09 12:42:31 -07:00
Jesse Gross
97b7b2f410 bonding: Compare ports, not interfaces, for loop checks.
In order to avoid loops we check that the input and output ports
are not equal.  When selecting mirror outputs for RSPAN we were
checking interfaces instead of ports.  This lead to loops when
using RSPAN with bonded ports.

Bug #2118
2009-10-08 13:47:07 -07:00
Justin Pettit
e8b52a913a Merge commit 'origin/citrix' 2009-10-06 11:35:29 -07:00
Ben Pfaff
4d678233e9 Merge "citrix" branch into "master. 2009-10-05 10:29:07 -07:00
Jesse Gross
c6303ea11b bonding: Update the link status on the bond fake interface.
Brings the fake bond interface up and down to match our notion of
whether the bond is currently active.  This solves an issue where
XenCenter would always show the bond as disconnected.

Bug #1703
2009-10-05 10:27:29 -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