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

104 Commits

Author SHA1 Message Date
Ben Pfaff
c83cdd3072 lib: Disable Linux-specific libraries on non-Linux systems. 2010-05-26 15:36:58 -07:00
Jesse Gross
2158888d8d patch: Remove veth driver.
Now that we have a new patch implementation, remove the veth driver
and its userspace components.  Then rename 'patchnew' to 'patch'.
The new implementation is a drop-in replacement for the old one.
2010-05-18 12:57:25 -07:00
Jesse Gross
43694e2a8d netdev: Add 'patch' userspace implementation.
Add a netdev to talk to the 'patch' vport in the kenerl.  Since
there is currently a 'patch' implementation using the veth driver,
this one is temporarily called 'patchnew'.
2010-05-18 12:57:25 -07:00
Ben Pfaff
8722022c0c Update fake bond devices' statistics with the sum of bond slaves' stats.
Needed by XAPI to accurately report bond statistics.

Ugh.

Bug NIC-63.
2010-04-19 11:12:27 -07:00
Jesse Gross
6f643e4946 tunneling: Remove old GRE implementation.
The new GRE implementation provides a complete drop in replacement
for the old Linux based implementation.  Therefore, remove the
old implementation and rename "grenew" to "gre".
2010-04-19 09:11:58 -04:00
Jesse Gross
3fe8053b36 tunneling: Add userspace support for new GRE implementation.
Add a netdev that supports the new datapath GRE implementation.
It currently coexists with the old implementation so it is named
"grenew".
2010-04-19 09:11:58 -04:00
Jesse Gross
4c0f178060 netdev: Allow get_ifindex and get_features to be null.
Allow netdev providers to set get_ifindex and get_features it
null if they would always return EOPNOTSUPP.  This is particuarly
useful for virtual devices.
2010-04-19 09:11:57 -04:00
Jesse Gross
15b3596a41 netdev-linux: Check notifications are for netdev-linux device.
When receiving a change notification from rtnetlink we checked whether
a netdev of that name existed and if so tried to handle it.  This also
checks that the type of the device is one handled by netdev-linux.
2010-04-19 09:11:57 -04:00
Jesse Gross
fdd8224884 netdev: Add function netdev_is_open().
Add netdev_is_open(), which checks to see if a given netdev is
currently open.  It will be used to assist in cleaning up old ports
that are no longer in use.
2010-04-19 09:11:57 -04:00
Justin Pettit
8aed4223e0 netdev: Add support for "patch" type
This commit introduces a new netdev type called "patch".  A patch is a
pair of interfaces, in which frames sent through one of the devices
pop out of the other.  This is useful for linking together datapaths.

A patch's only argument on creation is "peer", which specifies the other
side of the patch.  A patch must be created in pairs, so a second netdev
must be created with the "name" and "peer" values reversed.

The current implementation is built using veth devices.  Further, it's
limited to the veth devices which support configuration through sysfs.
This limits the ability to use a "patch" on 2.6.18 kernels using the
veth device we include (read: flavors of XenServer 5.5).  In the not too
distant future, the implementation will be modified to use the new
kernel port abstraction introduced by Jesse Gross's forthcoming GRE
work.  At that point, patch devices will work on any Linux platform
supported by OVS.
2010-04-15 03:50:28 -07:00
Ben Pfaff
1ac981803f netdev: Allow recv, recv_wait, drain, send, send_wait to be null.
Suggested by partner.
2010-04-11 09:18:16 -04: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
67a4917b07 Rename UNUSED macro to OVS_UNUSED to avoid naming conflict.
Requested by Jean Tourrilhes <jt@hpl.hp.com>.
2010-02-11 10:59:47 -08:00
Jesse Gross
7dab847a19 Fix some regressions from the merge from master. 2010-02-08 13:31:33 -05: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
Jesse Gross
77909859b0 netdev: Allow providers to be managed at runtime.
The list of netdev providers was previously staticly defined at
compile time.  This allows new providers to be added and removed
at runtime.
2010-02-01 12:00:49 -05:00
Jesse Gross
0b3f40f371 netdev: Correctly maintain netdev refcounts even if errors occur.
If an error occured while opening a netdev it would decrement the
refcount, even though it was never incremented.  Depending on
the timing this could result in either an error message or an
assertion failure.  This workaround simply always increments
the refcount before openning a device.  A more complete fix
already exists in the netdev overhaul in the 'next' branch.

NIC-59
2010-01-28 20:00:04 -05:00
Ben Pfaff
49c36903d6 Merge "sflow" into "master".
No conflicts, but lib/dpif.c needed a few changes since struct dpif's
member "class" was renamed to "dpif_class" in master since sflow was
branched off.
2010-01-25 10:52:28 -08:00
Ben Pfaff
6dfd030442 netdev: Rename "class" members to "netdev_class" for C++ compatibility.
From partner.
2010-01-22 15:14:04 -08:00
Jesse Gross
0f4f4a610a netdev: Compare full arguments instead of hash for reconfigure.
We only reconfigure netdevs if the arguments have changed, which
was previously detected based on a hash.  This stores and compares
the full argument list to avoid any chance of missing changes due
to collisions.
2010-01-18 18:29:26 -05:00
Jesse Gross
46415c9085 netdev-linux: Use the netdev list of devices instead of cachemap.
We previously maintained a list of open devices inside of the
linux netdev.  Since the netdev library now maintains this list,
it is better to use that list instead of our own.
2010-01-18 18:26:44 -05:00
Ben Pfaff
e3830e909d fatal-signal: After fork, clear hooks instead of disabling them.
Until now, fatal_signal_fork() has simply disabled all the fatal signal
callback hooks.  This worked fine, because a daemon process forked only
once and the parent didn't do much before it exited.

But upcoming commits will introduce a --monitor option, which requires
processes to fork multiple times.  Sometimes the parent process will fork,
then run for a while, then fork again.  It's not good to disable the
hooks in the child process in such a case, because that prevents e.g.
pidfiles from being removed at the child's exit.

So this commit changes the semantics of fatal_signal_fork() to just
clearing out hooks.  After hooks are cleared, new hooks can be added and
will be executed on process termination in the usual way.

This commit also introduces a cancellation callback function so that a
canceled hook can free resources.
2010-01-15 15:28:14 -08:00
Jesse Gross
0b0544d706 gre: Add support for destroying GRE devices.
This allows GRE tunnel devices to be torn down on graceful exit
of vswitch and cleaned up on restart for non-graceful exits.
2010-01-15 11:34:34 -05: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
Jesse Gross
d8b3070205 fatal-signal: Run signal hooks outside of actual signal handlers.
Rather than running signal hooks directly from the actual signal
handler, simply record the fact that the signal occured and run
the hook next time around the poll loop.  This allows significantly
more freedom as to what can actually be done in the signal hooks.
2010-01-06 09:11:58 -05:00
Ben Pfaff
622ee2cf64 netdev: New functions for interpreting "enum ofp_port_features" bitmaps. 2009-12-21 16:28:01 -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
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
9ab3d9a3c2 netdev: New function netdev_get_ifindex().
sFlow needs the ifindex of an interface, so this commit adds a function
to retrieve it.
2009-11-23 12:25:08 -08:00
Ben Pfaff
7671589afb netdev: Really set output values to 0 on failure in netdev_get_features().
The comment on netdev_get_features() claimed that all of the passed-in
values were set to 0 on failure, but the implementation didn't live up
to the promise.

CC: Paul Ingram <paul@nicira.com>
2009-11-19 13:32:59 -08: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
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
Ben Pfaff
f1acd62b54 Merge citrix branch into master. 2009-09-02 10:14:53 -07:00
Justin Pettit
13063c3b38 netdev: Add netdev_get_next_hop call
Add ability to determine the next hop IP address and device used to
reach a given host.
2009-09-01 14:48:34 -07:00
Justin Pettit
f10725fea5 Return netmask along with IP address when querying through netdev
The call netdev_get_in4() now allows the caller to also retrieve the
associated netmask.
2009-09-01 14:48:34 -07:00
Justin Pettit
7f329488c5 netdev: Fix reversed arguments in netdev_recv warning. 2009-09-01 14:48:33 -07:00
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
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
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
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
3b01baa397 Merge citrix branch into master. 2009-07-16 11:54:37 -07:00
Justin Pettit
79c720a830 Provide method to locate device by IP and add more nodev functions to netdev
In some cases we need to be able to locate a device by its IPv4 address.
There doesn't seem to be an easy way to do this on Linux, so we iterate
through all devices until it's found.  The caller can provide a hint as
to the device, so subsequent checks can be quicker.

This checkin also adds nodev versions of functions to lookup ARP entries
and the IPv4 address of a device.
2009-07-08 11:19:52 -07:00
Ben Pfaff
e9e28be359 Introduce general-purpose ways to wait for dpif and netdev changes.
The dpif and netdev code has had various ways to check for changes to
dpifs and netdevs over the course of Open vSwitch development.  All of
these have been thus far fairly specific to the Linux implementation.  This
commit is the start of a more general API for watching for such changes.
The dpif-related parts seem fairly mature and so they are documented,
the netdev parts will probably need to change somewhat and so they are
not documented yet.
2009-07-06 09:07:24 -07:00