aboutsummaryrefslogtreecommitdiff
path: root/vswitchd/ovs-brcompatd.c
AgeCommit message (Collapse)Author
2010-02-08ovsdb: Add simple constraints.Ben Pfaff
2010-01-26daemon: Make --monitor process change its process title.Ben Pfaff
When --monitor is used, administrators sometimes become confused about the presence of two copies of each process. This commit attempts to clarify the situation by making the monitoring process change its process name, as seen in /proc/$pid/cmdline and in "ps", to clearly indicate what is going on. CC: Dan Wendlandt <dan@nicira.com>
2010-01-15unixctl: Avoid double error reporting.Ben Pfaff
All of these programs were re-reporting an error that unixctl_server_create() had already reported. There's no need for that.
2010-01-15netdev: Fully handle netdev lifecycle through refcounting.Jesse Gross
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-14ovsdb: Provide helper function to determine if IDL has ever connectedJustin Pettit
2010-01-14ovs-brcompatd: Don't consume CPU if can't connect to config dbJustin Pettit
When ovs-brcompatd can't connect to the database, the "ovs" variable is never set. The function "brc_recv_update" takes care of draining brcompat kernel module's netlink messages. When the netlink message comes in to modify the bridge, that function never gets called, so a netlink message always appears to be ready and we consume 100% CPU looping. With this commit, we log a warning and drop the request on the floor. Bug #2373
2010-01-12vswitchd: Fix issue of networking not working when Tools not installedJustin Pettit
During the transition to the configuration database, not all code from the bridge compatibility layer was updated. In particular, the code which removes port configuration based on RTNL notifications of port removal was not updated. This commit brings that code back. Note that the code that removes ports based on actively checking whether ports exist is still commented out pending a review of its impact on GRE support. Bug #2370
2010-01-06Remove "fault" module.Ben Pfaff
This module, which catches segmentation faults and prints a backtrace before exiting, was useful for a while, but I believe that it has now outlived its purpose. It is altogether better to have a core dump from which one can extract much more information than a usually-poor backtrace, and core dumps are much better integrated into a typical Unix system. In addition, the "fault" module was of course not all that portable.
2009-12-18daemon: Allow daemon child process to report success or failure to parent.Ben Pfaff
There are conflicting pressures in startup of a daemon process: * The parent process should exit with an error code if the daemon cannot start up successfully. * Some startup actions must be performed in the child process, not in the parent. The most obvious of these are file locking, since child processes do not inherit locks, and anything that requires knowing the child process's PID (e.g. unixctl sockets). Until now, this conflict has usually been handled by giving up part of the first property, i.e. in some cases the parent process would exit successfully and the child immediately afterward exit with a failure code. This commit introduces a better approach, by allowing daemons to perform startup work in the child and only then signal the parent that they have successfully started. If the child instead exits without signaling success, the parent passes this exit code along to its own parent. This commit also modifies the daemons that can usefully take advantage of this new feature to do so.
2009-12-18ovs-brcompatd: Simplify logic and make more robust.Ben Pfaff
The ovs-brcompatd code was trying hard to make sure that an Open_vSwitch record would exist in the database before it would look for one. It is easier to just check for a record and use it if it is there, and it is also more robust against databases that have not been initialized.
2009-12-18ovs-brcompatd: Handle TXN_UNCHANGED status.Ben Pfaff
This status was introduced several commits ago but not added to the switch statement here. Also, change the "status" variable to type enum ovsdb_idl_txn_status so that GCC will warn about future additions.
2009-12-10ovs-brcompatd: Remove references to locking config fileJustin Pettit
With the config DB, it is no longer necessary to lock the config file. This removes references to the need for that.
2009-12-10ovs-brcompatd: First cut at integration with new config dbJustin Pettit
This is an extremely lightly tested attempt at switching ovs-brcompatd from using the config file to the new config db. There are a lot of shortcomings in this cut, but we need to make progress on the XenServer integration, so it's going in now. Expect changes in the near future.
2009-12-07gre: Temporary workarounds for GRE on Xen.Jesse Gross
Two issues exist that prevent GRE tunnels from working properly on Xen: iptables rules and brcompatd. The first issue is that GRE traffic is not permitted by the default iptables rules. The second is that brcompatd removes ports from the configuration that it believes do not exist, which causes GRE ports to be deleted before they are created. This commit avoids these issues though not in the most optimal way. Better fixes will be forthcoming in the near future.
2009-11-09Make ovs-appctl easier to use and synchronize its interface with ovs-vsctl.Ben Pfaff
It is inconvenient to type the whole path to the Unix daemon socket when using ovs-appctl. Allow the name of the daemon to be used instead when a pidfile exists in the default location, and contact ovs-vswitchd by default. Also, the various options for manipulating vlog were invented before the general-purpose command mechanism existed. Get rid of all of the action options in favor of just specifying the command to be executed as non-option arguments. Finally, there simply wasn't much value in allowing multiple targets or options to be specified; these variations were never used in practice. So simplify the interface by making it one target, one action per invocation. Also, make ovs-vsctl use the same syntax for its --target option. Based on work by Justin Pettit.
2009-09-22Merge citrix branch into master.Ben Pfaff
2009-09-22brcompatd: Delete VLAN tags only for the correct port in del_port().Ben Pfaff
vlan.%s.* will match e.g. eth0.123 if the %s expands to eth0. We only want it to match eth0 in that case. This is based on code inspection. It may or may not fix a real problem.
2009-08-19Merge citrix into master.Ben Pfaff
2009-08-19Merge citrix into master.Ben Pfaff
This was a somewhat difficult merge since there was a fair amount of superficially divergent development on the two branches, especially in the datapath. This has been build-tested against XenServer 5.5.0 and XenServer 5.7.0 build 15122. It has been booted and connected to XenCenter on 5.5.0. The merge revealed a couple of outstanding bugs, which will be fixed on citrix and then merged back into master.
2009-08-18ovs-brcompatd: Don't include the local port in BRCTL_GET_PORT_LIST output.Ben Pfaff
The BRCTL_GET_PORT_LIST ioctl is not supposed to include the bridge port itself in the list of ports, but ovs-brcompatd was doing that.
2009-08-18ovs-brcompatd: Fix memory leak.Ben Pfaff
2009-08-18ovs-brcompatd: Fix use of uninitialized svec.Ben Pfaff
2009-08-07brcompat: Move BRCTL_GET_BRIDGES, BRCTL_GET_PORT_LIST into userspace.Ben Pfaff
The Citrix QA scripts assume that "brctl show" will show a topology as if the Linux bridge were still in use; that is, as if there were one bridge per VLAN and as if bonds were network devices of their own instead of separate devices. However, we were showing the datapath topology, i.e. all VLANs and bond devices lumped together into a single datapath. This commit fixes the VLAN end of the problem, by moving the implementation of the ioctls that brctl uses into userspace in ovs-brcompatd and putting the necessary translation logic into ovs-brcompatd. By itself, this commit does not fix the problem for bonds: the port name for a bond does not (normally) under Open vSwitch exist as an actual Linux network device, and thus it has no ifindex, and so ovs-brcompatd can't pass it back to the kernel to report to brctl. This fix will have to wait for another commit. Bug NIC-19.
2009-08-07brcompatd: Factor code out of handle_fdb_query_cmd().Ben Pfaff
An upcoming commit wants to do the same thing in another place, so break the logic into a function.
2009-08-07brcompatd: Fix handle_fdb_query_cmd() return value on error.Ben Pfaff
handle_fdb_query_cmd() should return an error when an error occurs, but in this case it was always returning 0, because error is known to have value 0 at this point. Nothing really uses the return value here, and so eventually it would make sense to just change the return type here and in the rest of the handle_*() functions to void.
2009-08-07brcompatd: Break send_reply() up into more functions for flexibility.Ben Pfaff
Upcoming commits will require sending Netlink messages to the kernel that have additional attributes. Instead of adding more arguments to send_reply() to handle these, it's cleaner to break up send_reply() into two functions and let the caller add those attributes itself.
2009-08-07brcompatd: Make parse_command() parse commands without dp arguments.Ben Pfaff
The BRCTL_GET_BRIDGES ioctl is going to move to userspace, but that ioctl doesn't provide a bridge name as argument, so we need to support that.
2009-08-03vswitchd: Initialize cfg properly and check return valuesJustin Pettit
A previous checkin added the cfg_init() function, so we now call it. We also check the return value of the initial call to cfg_read(), since if it fails, there's not much point in continuing.
2009-07-30netdev: Implement an abstract interface to network devices.Ben Pfaff
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-30vswitchd: Avoid netdev_nodev_*() functions.Ben Pfaff
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-30netdev: New function netdev_exists().Ben Pfaff
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-16brcompat: Make "brctl showmacs" honor Linux notion of bridge composition.Ben Pfaff
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-16Implement "brctl showmacs" support in brcompat and ovs-brcompatd.Ben Pfaff
This is needed by the Citrix test infrastructure.
2009-07-16brcompatd: Factor code out of prune_ports().Ben Pfaff
An upcoming commit will also need to gather all of the interfaces on a specified bridge, so break this code into a helper function.
2009-06-23ovs-brcompatd: Turn up log level of port removal messages.Ben Pfaff
These messages proved useful during debugging, and they should not be too common, so log them at a higher level.
2009-06-23ovs-brcompatd: Handle XS Tools 5.0.0 destroying and recreating devicesBen Pfaff
XenServer Tools version 5.0.0 destroys and recreates network devices with the same name on boot of (at least) Windows VMs. We had a race such that ovs-brcompatd would delete the new device from the vswitchd configuration file (not the old one). This commit fixes that problem. Bug #1429.
2009-06-15Update primary code license to Apache 2.0.Ben Pfaff
2009-07-08Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.v0.90.0Ben Pfaff