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
559843ed53 rtnetlink: Move into separate source and header file.
Now that rtnetlink isn't named similarly to netdev_linux, it might as well
have its own source and header files to avoid confusing everyone.
2009-07-30 16:07:15 -07:00
Ben Pfaff
d81c0ac56d rtnetlink: Document. 2009-07-30 16:07:14 -07:00
Ben Pfaff
46097491e4 netdev-linux: Rename "linux_netdev_*" to "rtnetlink_*".
It was getting to be too confusing to have both netdev_linux_* functions
and linux_netdev_* functions.  Rename the latter to make the distinction
more obvious.  "rtnetlink" seems to be a fairly good name because that's
what the kernel calls it, so the name will be familiar at least to people
who know about rtnetlink.
2009-07-30 16:07:14 -07:00
Ben Pfaff
8b61709d5e netdev: Implement an abstract interface to network devices.
This new abstraction layer allows multiple implementations of network
devices in a single running process.  This will be useful, for example, to
support network devices that are simulated entirely in the running process
or that communicate with other processes over Unix domain sockets, etc.

The reimplemented tap device support in this commit has not been tested.
2009-07-30 16:07:14 -07:00
Ben Pfaff
b1bf7d43b3 netdev: Remove netdev_nodev_*() functions.
These functions are now unused, so they may be deleted.
2009-07-30 16:07:14 -07:00
Ben Pfaff
b2f17b151d netdev: Make netdev_get_vlan_vid() take a netdev instead of a name.
For consistency, it's best if every netdev function takes a netdev instead
of a device name.  The netdev_nodev_*() functions have always been a bit
ugly.
2009-07-30 16:07:14 -07:00
Ben Pfaff
07c318f404 vswitchd: Avoid netdev_nodev_*() functions.
The netdev_nodev_*() functions have always been a bit of a kluge.  It's
better to keep a network device open than to open it every time that it is
needed.  This commit converts all of the users of these functions to use
the corresponding functions that take a "struct netdev *" instead.
2009-07-30 16:07:14 -07:00
Ben Pfaff
795fe1fba0 vswitchd: Avoid netdev_nodev_set_policing().
The netdev_nodev_*() functions have always been a bit of a kluge.  It's
better to keep a network device open than to open it every time that it is
needed.
2009-07-30 16:07:14 -07:00
Ben Pfaff
c752217a1e netdev: Make netdev_find_dev_by_in4() use netdevs, not device names.
The netdev_nodev_*() functions have always been a bit of a kluge.  It's
better to keep a network device open than to open it every time that it is
needed.

Also updates the only user of netdev_find_dev_by_in4().
2009-07-30 16:07:14 -07:00
Ben Pfaff
96b9b7a9ef vswitchd: Don't keep track of mac in struct iface.
It's easy to get the Ethernet address of the interface from the netdev
code, and so we don't have to keep track of it in the bridge too.
2009-07-30 16:07:14 -07:00
Ben Pfaff
0c6aea3f9b vswitchd: Keep a netdev open for each interface.
This will allow the vswitch to use the netdev functions that take a
netdev parameter instead of the ones that take a device name.
2009-07-30 16:07:14 -07:00
Ben Pfaff
6ae39834ad vswitchd: Factor out iteration over interfaces with deletion.
Two different pieces of code in vswitchd were both iterating over all
the interfaces in a bridge and deleting some of them, then deleting any
ports that ended up with no interfaces because of this.  This commit
factors this operation out into a helper function.
2009-07-30 16:07:14 -07:00
Ben Pfaff
fa60c01995 ofproto: Don't use netdev_nodev_get_etheraddr() in pick_datapath_id().
The netdev_nodev_*() functions have always been a bit of a kluge.  It's
better to keep a network device open than to open it every time that it is
needed.

This commit gets rid of a usage of netdev_nodev_get_etheraddr() in
pick_datapath_id(), by using the netdev that the datapath already has open
for the local port.
2009-07-30 16:07:14 -07:00
Ben Pfaff
0efaf4b50c netdev: Add 'netdev' parameter to netdev_add_router().
When there is the possibility of multiple classes of netdevs,
netdev_add_router() needs to know which of these to use, so it needs a
"struct netdev *" parameter.
2009-07-30 16:07:14 -07:00
Ben Pfaff
5bfc0cd3c6 netdev: New function netdev_exists().
This new function allows cleanup of code that was using
netdev_nodev_get_flags() or ad-hoc methods to detect whether a network
device with the given name exists.
2009-07-30 16:07:13 -07:00
Ben Pfaff
e33e4d356d netdev: Get rid of netdev_open_tap().
netdev_open() can always be used in place of netdev_open_tap().  The
former is going to be generalized to support pluggable network device
types, so it makes sense to use it everywhere.
2009-07-30 16:07:13 -07:00
Ben Pfaff
6b9bd97900 netdev: Change netdev_get_in4() to return an error code.
Until now, netdev_get_in4() and netdev_nodev_get_in4() have returned a
bool that represents success or failure.  This commit changes the return
value to an int that can indicate what kind of error occurred, which is
both more consistent with the rest of the netdev interfaces and more
meaningful, and updates all callers to the new interface.

(Currently netdev_get_in4() won't ever return an error, but other future
implementations might.)
2009-07-30 16:07:13 -07:00
Ben Pfaff
3d222126b4 netdev: Change netdev_get_mtu() to return an error code.
To make the netdev code more portable, it needs to support returning error
codes from functions that don't have them.  This commit changes
netdev_get_mtu() to return an error code and updates its caller.

(Currently netdev_get_mtu() won't ever return an error, but other future
implementations might.)
2009-07-30 16:07:13 -07:00
Ben Pfaff
80992a3577 netdev: Change netdev_get_etheraddr() to return an error code.
To make the netdev code more portable, it needs to support returning error
codes from functions that don't have them.  This commit changes
netdev_get_etheraddr() to return an error code and updates all of its
callers.

(Currently netdev_get_etheraddr() won't ever return an error, but other
future implementations might.)
2009-07-30 16:07:13 -07:00
Ben Pfaff
fd30311c87 shash: Introduce new macros SHASH_FOR_EACH, SHASH_FOR_EACH_SAFE.
This is both more convenient and cleaner than using HMAP_FOR_EACH(_SAFE)
directly.
2009-07-30 16:07:13 -07:00
Ben Pfaff
78299b0a68 shash: Make shash_add() return the new node. 2009-07-30 16:07:13 -07:00
Ben Pfaff
85c74638ed vswitchd: Update /proc/net/bonding when bonded port properties change.
Until now ovs-vswitchd has created the files in /proc/net/bonding, but not
updated them, because there was little need.  But the Citrix QA tests check
that the list of bond hashes in that file is kept up-to-date, so we need
to update them whenever the bond hashes (or other data in the file) change.
This commit does that.

Bug NIC-16.
2009-07-30 09:31:01 -07:00
Ben Pfaff
2aebae8397 vswitchd: Add bond hashes to /proc/net/bonding compatibility layer.
The Citrix QA scripts require the bond hashes and their assigned devices
to be noted in /proc/net/bonding.  We weren't doing that, so this commit
adds them.

Bug NIC-16.
2009-07-30 09:31:01 -07:00
Justin Pettit
acf827ca41 XenServer: Correct license in spec file
The license file indicated that the software is licensed under the GPLv3
license.  This commit corrects that to state that it's licensed under
the Apache 2.0 license with the exception of the "datapath" directory,
which is GPLv2.  The style and abbreviations were from the following
page:

    http://fedoraproject.org/wiki/Packaging/LicensingGuidelines
2009-07-29 23:37:28 -07:00
Justin Pettit
4f2cad2c3b vswitchd: Add unixctl command to dump all flows, including hidden ones
Previously, the only way to query the flow table was to run "ovs-ofctl
dump-flows".  This returned most flows, but not those marked hidden by
secchan.  Hidden flows are setup by mechanisms such as in-band control,
since they must not be modified by users of the controller.  However,
when debugging problems on the switch, it is often useful to see what
the flow table is actually doing.  The new "bridge/dump-flows" command
added to ovs-appctl shows all flows being used by the OpenFlow stack.
2009-07-29 17:04:18 -07:00
Ben Pfaff
3b7c608d6a Always distribute extras/ezio/ezio3.ti.
I had thought that Automake was smart enough to ignore conditionals around
EXTRA_DIST, so that all files always got distributed regardless of whether
Automake conditionals were set.  I was wrong.

This pushes the conditionals for building the ezio binaries down into
extras/ezio/automake.mk and thereby makes adding ezio3.ti to EXTRA_DIST
unconditional, so that it always gets distributed.  Otherwise, this file
will not be distributed on systems that don't have curses or don't have
PCRE, which is very surprising.
2009-07-29 17:04:10 -07:00
Ben Pfaff
31a7c9e776 Remove --disable-userspace "configure" option, since it breaks "make dist".
I had thought that Automake was smart enough to ignore conditionals around
EXTRA_DIST, so that all files always got distributed regardless of whether
Automake conditionals were set.  I was wrong.

This commit removes the --disable-userspace option to "configure", which
put a conditional around most of Makefile.am and thus unintentionally
caused most of the distribution to be left out if --disable-userspace was
specified.  The alternative (fixing --disable-userspace) seems like too
much work--it would require pushing "if ENABLE_USERSPACE" down into lots
of subdirectory--and would be difficult to maintain.
2009-07-29 16:48:45 -07:00
Justin Pettit
c2fea58ce7 Fix DHCP request source port and add port #define's
DHCP requests were sent with a source port of 66, when it should be 68.
This code has been tested, so apparently many DHCP servers don't pay
attention to the source port.  This commit also adds #define's for the
DHCP ports, so that magic numbers don't need to be used.
2009-07-29 16:37:14 -07:00
Justin Pettit
06052e0c89 Fix tab/space issue in datapath-protocol.h 2009-07-29 16:37:14 -07:00
Justin Pettit
5a4baac6c2 vswitchd: Remove non-used function to prevent compiler warnings
The function send_ofmp_error_msg() is not currently used, so it was
producing compiler warnings that it was defined.  Remove the function
until it's needed.
2009-07-29 16:37:05 -07:00
Justin Pettit
ba8de5cbc7 Cleanup warnings about "save_ptr" in strtok_r argument
The compiler warns about the "save_ptr" argument to strtok_r being
unitialized.  This cleans that up.
2009-07-29 15:18:20 -07:00
Ben Pfaff
c2b0702140 Add support for code coverage analysis with gcov and lcov. 2009-07-29 12:33:32 -07:00
Ben Pfaff
1b233b95b5 Use Autotest for the Open vSwitch test suite.
Autotest doesn't provide a lot of benefit by itself but it does allow us
to easily put a wrapper around each test by using a macro to invoke it.
(To do that with the built-in Automake test framework you need to write
or generate a separate wrapper script for each test, which is a pain.)
The next commit will take advantage of this possibility by adding support
for code coverage analysis.
2009-07-29 12:33:32 -07:00
Ben Pfaff
f9fb1858ef Reduce default probe interval to 5 seconds (and fail-open timeout to 15).
Before now, the default probe interval (the idle time after which an echo
request is sent on an OpenFlow connection) was set to 15 seconds.  The
fail-open timeout is 3 times the probe interval, so this meant that it
took 45 seconds for a switch to fail open.

Users at Nicira have commented that this is too long.  They don't like the
idea that the network will be down for most of a minute before it begins to
recover.  So this commit changes the default probe interval to 5 seconds,
hence the fail-open timeout to 15 seconds.
2009-07-29 11:31:07 -07:00
Ben Pfaff
c9aaa87707 Reduce default maximum connection timeout from 15 seconds to 8 seconds.
Users at Nicira have commented that a maximum reconnection time of 15
seconds, which was the default, is too long.  This commit cuts it to 8
seconds, on the theory that an administrator is willing to wait that long
before deciding that a change that should restore connectivity did not
work.
2009-07-29 11:29:18 -07:00
Ben Pfaff
acd0a902c1 xenserver: Do not set or remove vSwitchVersion xapi parameter anymore.
The other-config:vSwitchVersion parameter was used to announce the Open
vSwitch version installed on a XenServer host, but this had the problem
that it could not be read or updated if the connection to the pool master
was down.  Because of this problem, the only user of this parameter in
Open vSwitch was removed (in commit 3cdc31a4c3a "xenserver: Retrieve
vSwitch version from binary in xsconsole").  So this commit finished the
process and removes the parameter entirely.

This should fix hangs on Open vSwitch installation and removal due to
waiting on the connection to the pool master.
2009-07-29 11:23:30 -07:00
Ben Pfaff
58b7527ecb xenserver: Honor the MAC address specified in xapi database for bonds.
The xapi database for PIFs specifies the MAC address that should be used
for bonds, but interface-reconfigure didn't honor it and ovs-vswitchd
didn't have a way to configure it anyhow.  This commit fixes both problems.

Bug #1645.
2009-07-29 11:20:43 -07:00
Justin Pettit
baa905d36b Merge commit 'origin/citrix' 2009-07-28 22:19:28 -07:00
Justin Pettit
a5e54d9b6f Merge commit 'origin/citrix'
Conflicts:

	configure.ac
2009-07-28 22:16:50 -07:00
Ben Pfaff
aa80fd55a1 xenserver: Enable ARP filtering to work around xhad bug.
This works around a bug in xhad, which binds to a particular Ethernet
device, which in turn causes ICMP port unreachable messages if packets are
received are on the wrong interface, which in turn can happen if we send
out ARP replies on every interface (as Linux does by default) instead of
just on the interface that has the IP address being ARPed for, which this
sysctl setting in turn works around.

Justin Pettit did most of the work tracking down the origin of this bug.

Bug #1378.
2009-07-28 15:44:58 -07:00
Justin Pettit
3cdc31a4c3 xenserver: Retrieve vSwitch version from binary in xsconsole
The xsconsole plugin shows status information about Open vSwitch.  The
version information was retrieved from XAPI, but this could cause
problems.  The most easily reproduced is to make a XenServer part of a
pool, then remove it.  The version string is no longer in the
XenServer's local XAPI view, so it reports "<unknown>".  A more direct
way to get the information is to directly query the binary, which is
what this commit does.

Bug #1626
2009-07-28 15:24:32 -07:00
Justin Pettit
42a9c78bac Label the current "citrix" release 0.90.4. v0.90.4 2009-07-28 11:05:28 -07:00
Ben Pfaff
2b35e1475e Do not try to resolve DNS for OpenFlow controllers or netflow collectors.
Until now, setting a netflow collector to a DNS name would cause
secchan to attempt to resolve that DNS name each time that the set of
netflow collectors is re-set.  For the vswitch, this is every time that
the vswitch reconfigures itself.

Unfortunately, DNS lookup within secchan cannot work as currently
implemented, because it needs both an asynchronous DNS resolver library
and in-band control updates.  Currently we have neither.  Attempting to
look up DNS anyway just hangs.

This commit disables DNS lookup entirely, and updates the documentation to
change user expectations.  DNS still won't work, but at least it won't
hang.

Bug #1609.
2009-07-21 09:49:57 -07:00
Ben Pfaff
7a3696adbf xenserver: Fix creating, destroying bonds with the management connection.
Creating a bond from the network device that holds the Xen management
connection automatically transfers the management connection to that bond.
However, we weren't properly removing the IP address from the network
devices that constituted the bond.  This commit fixes that problem.

Bug #1566.
2009-07-17 12:37:40 -07:00
Justin Pettit
4cff83cbad Various clean-ups to INSTALL.OpenFlow 2009-07-17 00:21:59 -07:00
Justin Pettit
c2d1694f41 Add INSTALL.bridge and INSTALL.OpenFlow to distribution 2009-07-16 20:50:58 -07:00
Justin Pettit
38b23f7656 Set version number to 0.90.3. v0.90.3 2009-07-16 20:47:00 -07:00
Justin Pettit
b81411b79d First cut of guide to using Open vSwitch as a simple OpenFlow switch. 2009-07-16 20:45:53 -07:00
Keith Amidon
e5660bae19 Minor documentation fixups. 2009-07-16 18:07:56 -07:00
Ben Pfaff
c735214e85 brcompat: Make "brctl showmacs" honor Linux notion of bridge composition.
The kernel only handles a single VLAN per bridge, but vswitchd can deal
with all the VLANs on a single bridge.  This commit makes "brctl showmacs"
pretend that the former is the case even though the latter is the
implementation.

Bug #1567.
2009-07-16 15:16:06 -07:00