2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-28 12:58:00 +00:00

83 Commits

Author SHA1 Message Date
Ben Pfaff
2b9d658984 netdev-vport: Merge in netdev-patch and netdev-tunnel.
The only real difference between netdev-patch and netdev-tunnel is in their
parse_config() implementation.  That's a lot of extra code to maintain, for
questionable benefit.  This commit merges them into the netdev-vport code,
which was heretofore merely a collection of helper functions.
2010-10-11 12:40:11 -07:00
Ben Pfaff
c1c9c9c4b6 Implement QoS framework.
ovs-vswitchd doesn't declare its QoS capabilities in the database yet,
so the controller has to know what they are.  We can add that later.

The linux-htb QoS class has been tested to the extent that I can see that
it sets up the queues I expect when I run "tc qdisc show" and "tc class
show".  I haven't tested that the effects on flows are what we expect them
to be.  I am sure that there will be problems in that area that we will
have to fix.
2010-06-17 15:04:12 -07:00
Jesse Gross
1e82e503c5 netdev: Remove may_create/may_open flags.
The most recent revision of the netdev library added may_create
and may_open flags to explicitly state the intent of the caller as
to whether the device should already be in use.  This was simply
a sanity check for users of the netdev library and the configuration.
At this point the netdev library and its users are well behaved and
should no longer need to be checked.  Additional checks have also
been added for incorrect configuration that mean the netdev library
is no longer the primary line of defense.

These flags themselves create problems because it is not always
easy for a library to know what the state of devices should be.
This is particularly a problem for ovs-openflowd, which expects
ports to be added by ovs-dpctl.  Fixing this either requires that
the checks are so permissive to be useless or ugly hacks to get
around them.  Since they are no longer needed, just remove the
checks.

This commit restores the previous behavior of ovs-openflowd to
not require that ports be specified on the command line or
cleaned up after use.

Bug #2652

CC: Natasha Gude <natasha@nicira.com>
CC: Jean Tourrilhes <jt@hpl.hp.com>
CC: 蒲彦 <yan.p.bjtu@gmail.com>
2010-06-01 17:27:45 -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
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
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
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
fbfffdbbf9 Add extern "C" { ... } to some header files to support usage from C++.
From partner.
2010-02-04 09:38:31 -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
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
622ee2cf64 netdev: New functions for interpreting "enum ofp_port_features" bitmaps. 2009-12-21 16:28:01 -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
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
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
72865317a4 New implementation of userspace datapath, based on the netdev library. 2009-07-06 09:55:06 -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
Ben Pfaff
a14bc59fb8 Update primary code license to Apache 2.0. 2009-06-15 15:11:30 -07:00
Ben Pfaff
460923cf8b netdev: New function netdev_nodev_get_carrier(). 2009-06-05 14:26:42 -07:00
Ben Pfaff
064af42167 Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. 2009-07-08 13:19:16 -07:00