2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-24 10:58:04 +00:00

221 Commits

Author SHA1 Message Date
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
Ben Pfaff
c100e025e2 netdev-linux: Fix aliasing error.
The latest version of GCC flags a common socket convention as breaking
strict-aliasing rules.  This commit removes the aliasing and gets rid of
the scary warning.
2009-12-14 22:59:55 -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
Ben Pfaff
58fda1dab1 Merge "master" branch into "db". 2009-12-02 11:49:53 -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
Ben Pfaff
ec6fde61c8 Add new function xzalloc(n) as a shorthand for xcalloc(1, n). 2009-11-04 14:52:32 -08:00
Ben Pfaff
eb395f2ebf netdev-linux: Improve netdev_linux_set_etheraddr().
Fixes a bug whereby netdev_linux_set_etheraddr() would update the cached
Ethernet address but not mark it valid.  (This potentially wasted a system
call later but wasn't harmful.)

As an added optimization, don't set the Ethernet address at all if the
new address is the same as the current address.
2009-10-02 11:04:06 -07:00
Jesse Gross
c0e5f6cabe netdev-linux: Return correct error codes on receive.
netdev_linux_receive was returning positive error codes while the
interface specifies that it should be returning negative errors.
This difference causes a huge increase in (non-existant) packet
processing with the userspace datapath.
2009-10-02 10:36:41 -07:00
Jesse Gross
1a487cec00 netdev-linux: Fix tap device using wrong FD.
Tap devices were doing ioctls on the AF_INET socket, instead of the
FD opened on the tap device.
2009-09-30 12:43:05 -07:00
Ben Pfaff
576e26d7b4 Merge citrix branch into master. 2009-09-22 10:17:44 -07:00
Jesse Gross
edaa959f6b netdev-linux: Set missing cache validity bit.
Whether a port is internal is cached to avoid requerying the kernel
every time stats are requested.  However, the cache vality bit was
never being set so the cache wasn't used.  This corrects that
oversight.

Thanks to Ben Pfaff for noticing.
2009-09-16 11:03:42 -07:00
Jesse Gross
fe6b0e03f6 netdev: Swap transmit and receive stats on internal ports.
Internal ports appear to have their transmit and receive stats swapped
because from the kernel's point of view these ports are acting like
the machine connected to the switch, not the switch itself.  This swaps
the stats for consistency with other ports.
2009-09-14 14:12:23 -07:00
Ben Pfaff
f1acd62b54 Merge citrix branch into master. 2009-09-02 10:14:53 -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
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
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