aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
AgeCommit message (Collapse)Author
2013-10-17vswitchd: Use vswitch-specific variable name in automake.mk.Justin Pettit
The variable OVSDB_DOT_DIAGRAM_ARG is describing the vswitch dot file, so use the name VSWITCH_DOT_DIAGRAM_ARG to prevent confusion in the generated makefile. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-10-17ovsdb-dot: Include arrows by default.Ben Pfaff
When ovsdb-dot generates diagrams for use in the manpages, the dot2pic postprocessor makes nicer output if the arrowheads are omitted (dot2pic adds the arrowheads itself). But for other uses that don't go through the postprocessor, we generally want the arrowheads. So this commit adds an option. On the principle that the default should be the least surprising to a naive user, arrowheads are included by default. Signed-off-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
2013-10-17ovsdb-doc: generate vswitch.[pic|gv] files only if dot tool is availableAnsis Atteka
These are auto-generated files, so it would be better not to keep them inside Open vSwitch repository. Behaviour before this patch was that if dot tool was not present on the system, then ovs-vswitchd.conf.db.5 would have used pre-generated vswitch.pic file that was already checked in the git repository. After this patch ovs-vswitchd.conf.db.5 will simply not have a dot diagram, if dot was not present at the time when Open vSwitch was built. Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2013-10-08vswitchd: Improve the readability of the E-R diagram.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
2013-10-01ofproto: Define official OpenFlow port number.Justin Pettit
Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-10-01ovsdb: Define official port number.Justin Pettit
Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-10-01Don't differentiate between TCP and SSL ports for OpenFlow and OVSDB.Justin Pettit
The OVS code has always made a distinction between the unencrypted (TCP) and SSL port numbers for the OpenFlow and OVSDB protocols. The default port numbers for both protocols has changed, and there continues to be no distinction between the unencrypted and SSL versions. This commit removes the distinction in port numbers. A future patch will recognize the change in default port number. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-09-19cfm: Prevent interval fault when demand mode is enabled on one end.alex wang
This commit prevents cfm from raising 'interval' fault when demand mode is only enabled on one end of link. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-09-12vswitchd: Clear bfd_status column when bfd is disabled or not supportedAlex Wang
This commit makes vswitchd clear the 'bfd_status' column in ovsdb when bfd is disabled or not supported. Reported-by: Ansis Atteka <aatteka@nicira.com> Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-09-12bridge: Always call smap_destroy() after smap_init()Alex Wang
This commit fixes a place in bridge.c where smap_destroy() is not always called after smap_init(). Though there is no memory leak now, it is necessary to fix it and prevent memory leak in the future when smap_init() may be modified to allocate dynamic memory. Reported-by: Ansis Atteka <aatteka@nicira.com> Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-09-10ofproto: Reduce default number of miss handlers.Ethan Jackson
The default number of miss handlers should be the number of processors minus two to account for the dispatcher and main threads. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-09-06datapath: vport: Remove compat supportPravin B Shelar
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2013-09-04timeval: Remove CACHE_TIME scheme.Alex Wang
This commit removes the CACHE_TIME scheme from timeval module. This is for eliminating the lock contention over the read/write lock of the cached time. To get the time, the thread now will directly do the system call 'clock_gettime()'. As a side effect, timer can only be warpped after timer is stopped by 'appctl time/stop' command. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-08-27netdev: Fix deadlock when netdev_dump_queues() callback calls into netdev.Ben Pfaff
We have a call chain like this: iface_configure_qos() calls netdev_dump_queues(), which calls netdev_linux_dump_queues(), which calls back through 'cb' to qos_unixctl_show_cb(), which calls netdev_delete_queue(), which calls netdev_linux_delete_queue(). Both netdev_dump_queues() and netdev_linux_delete_queue() take the same mutex in the same netdev, which deadlocks. This commit fixes the problem by getting rid of the callback. netdev_linux_dump_queue_stats() would benefit from the same treatment but it's less urgent because I don't see any callbacks from that function that call back into a netdev function. Bug #19319. Reported-by: Scott Hendricks <shendricks@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-08-22bfd: Implement forwarding_if_rx.Alex Wang
This commit adds a new boolean option "forwarding_if_rx" to bfd. When forwarding_if_rx is true the interface will be considered capable of packet I/O as long as there is packet received at interface. This is important in that when link becomes temporarily conjested, consecutive BFD control packets can be lost. And the forwarding_if_rx can prevent link failover by detecting non-control packets received at interface. Signed-off-by: Alex Wang <alexw@nicira.com>
2013-08-22ipfix: implement flow caching and aggregation in exporterRomain Lenglet
Implement a per-exporter flow cache with active timeout expiration. Add columns "cache_active_timeout" and "cache_max_flows" into table "IPFIX" to configure each cache. Add per-flow elements "octetDeltaSumOfSquares", "minimumIpTotalLength", and "maximumIpTotalLength" to replace "ethernetTotalLength". Add per-flow element "flowEndReason" to indicate whether a flow has expired because of an active timeout, the cache size limit being reached, or the exporter being stopped. Signed-off-by: Romain Lenglet <rlenglet@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-08-20bfd: Implement BFD decay.Alex Wang
When there is no incoming data traffic at the interface for a period, BFD decay allows the bfd session to increase the min_rx. This is helpful in that some interfaces may usually be idle for a long time. And cpu consumption can be reduced by processing fewer bfd control packets. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-08-20Use "error-checking" mutexes in place of other kinds wherever possible.Ben Pfaff
We've seen a number of deadlocks in the tree since thread safety was introduced. So far, all of these are self-deadlocks, that is, a single thread acquiring a lock and then attempting to re-acquire the same lock recursively. When this has happened, the process simply hung, and it was somewhat difficult to find the cause. POSIX "error-checking" mutexes check for this specific problem (and others). This commit switches from other types of mutexes to error-checking mutexes everywhere that we can, that is, everywhere that we're not using recursive mutexes. This ought to help find problems more quickly in the future. There might be performance advantages to other kinds of mutexes in some cases. However, the existing mutex type choices were just guesses, so I'd rather go for easy detection of errors until we know that other mutex types actually perform better in specific cases. Also, I did a quick microbenchmark of glibc mutex types on my host and found that the error checking mutexes weren't any slower than the other types, at least when the mutex is uncontended. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-08-15ofproto: Make number of packet handler threads runtime configurable.Alex Wang
This commit adds a new column "n-handler-threads" to the Open_vSwitch table. This is used to set the number of upcall handler threads created by the ofproto-dpif-upcall module. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-08-09clang: Pass objects, not their addresses, to thread-safety macros.Alex Wang
This commit changes the code such that arguments to thread-safety macros are not ampersanded. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-08-05bfd: Optimize BFD for Megaflows.Gurucharan Shetty
The current situation is that whenever any packet enters the userspace, bfd_should_process_flow() looks at the UDP destination port to figure out whether that is a BFD packet. This means that UDP destination port cannot be wildcarded for all the other flows too. To optimize BFD for megaflows, we introduce a new 'bfd:bfd_dst_mac' field in the database. Whenever this field is set by a controller, it is assumed that all the BFD packets to/from this interface will have the destination mac address set as the one specified in the bfd:bfd_dst_mac field. If this field is set, we first look at the destination mac address of a packet and if it does not match the mac address set in bfd:bfd_dst_mac, we do not process that packet as bfd. If the field does match, we go ahead and look at the UDP destination port too. Also, change the default BFD destination mac address to "00:23:20:00:00:01". Feature #18850. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-08-02async-append: Refactor to avoid requiring enabling while single threaded.Ben Pfaff
Until now, the async append interface has required async_append_enable() to be called while the process was still single-threaded, with the rationale being that async_append_enable() could race with async_append_write() on some existing async_append object. This was a difficult problem when the async append interface was introduced, because at the time Open vSwitch did not have any infrastructure for inter-thread synchronization. Now it is easy to solve, by introducing synchronization into the async append module. However, that's more or less wasted, because the client is already required to serialize access to async append objects. Moreover, vlog, the only existing client, needs to serialize access for other reasons, so it wouldn't even be possible to just drop the client's synchronization. This commit therefore takes another approach. It drops the async_append_enable() interface entirely. Now any existing async_append object is always enabled. The responsibility for "enabling", then, now rests in whether the client creates and uses an async_append object, and so vlog now takes care of that by itself. Also, since vlog now has to deal with sometimes having an async_append and sometimes not having one, we might as well allow creating an async_append to fail, thereby slightly simplifying the "no async I/O" implementation from "write synchronously" to "always fail creating an async_append". Reported-by: Shih-Hao Li <shihli@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-08-01cfm: Make the CFM module thread safe.Ethan Jackson
Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-07-31ovsdb-doc: Add ovsdb-doc to distribution tar ball.Gurucharan Shetty
Certain platforms like xenserver do not have the latest python libraries that are needed by ovsdb-doc (which in-turn creates ovs-vswitchd.conf.db.5). When we run 'make dist' and copy over the tar ball to xenserver ddk environemt, we already include ovs-vswitchd.conf.db.5. But the absence of ovsdb-doc results in an attempt to regenerate ovs-vswitchd.conf.db.5 and that fails because of the missing python libraries. Instead of producing ovsdb-doc from ovsdb-doc.in dynamically, we statically provide ovsdb-doc and pass on the version information to it through the command line option --version. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-07-30clang: Add annotations for thread safety check.Ethan Jackson
This commit adds annotations for thread safety check. And the check can be conducted by using -Wthread-safety flag in clang. Co-authored-by: Alex Wang <alexw@nicira.com> Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-07-30ovs-vswitchd.conf.db: Correct the header and footer lines.Gurucharan Shetty
Right now, the following 2 lines are how the header and footer looks like for ovs-vswitchd.conf.db @VERSION@(5) Open vSwitch Manual @VERSION@(5) Open vSwitch Open_vSwitch @VERSION@(5) After this commit, they look like this: ovs-vswitchd.conf.db(5) Open vSwitch Manual ovs-vswitchd.conf.db(5) Open vSwitch 1.12.90 ovs-vswitchd.conf.db(5) Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-07-23vlan-splinter: Fix inverted logic bug.Alex Wang
When "other-config:enable-vlan-splinters=true" is set, the existing vlans with ip address must be retained. The bug actually does the opposite and retains the vlans without ip address. This commit fixes it. Reported-by: Roman Sokolkov <rsokolkov@gmail.com> Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-07-22xenserver: Make thread-safe.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-07-19ovs-vswitchd: Document the ovs-appctl bfd/* commands.Pavithra Ramesh
Added man-page entries for bfd/show and bfd/set-forwarding commands. Signed-off-by: Pavithra Ramesh <paramesh@vmware.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-07-18system-stats: Move into separate thread.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-07-18vlog: Use async I/O.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-07-15BFD: Add check_tnl_key feature to BFD code.Pavithra Ramesh
This change adds the check_tnl_key functionality for BFD. When the feature is enabled, BFD will only accept control packets with a tunnel key of 0. Signed-off-by: Pavithra Ramesh <paramesh@vmware.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-07-15stress: Remove essentially unused library.Ben Pfaff
The "stress" library was introduced years ago. We intended at the time to start using it to provoke errors in testing, to make sure that Open vSwitch was resilient against those errors. The intention was good, but there were few actual implementations of stress options, and the testing never materialized. Rather than adapt the stress library for thread safety, this seems like a good opportunity to remove it, so this commit does so. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-07-12worker: Delete library.Ben Pfaff
It had no remaining users. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-07-12system-stats: Remove worker process support.Ben Pfaff
The worker process implementation isn't thread-safe and, once OVS itself is threaded, it doesn't make much sense to have a worker process anyway. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-07-11ovs-ctl.in: Increase the limit on file descriptors.Gurucharan Shetty
Testing shows that creation of 5000 internal ports and using it to do some meaningful tasks works fine on a 12 cpu hardware. Since a single port needs one file descriptor and a bridge needs 3 file descriptors, we will have to increase the file descriptor limit to a higher number from the current limit of 5000. 7500 feels like a decent increase with enough room for further scale testing. Bug #18383. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-07-11ovs-vswitchd: Correct the documentation on the limits for bridges and ports.Gurucharan Shetty
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-07-10vswitchd: Fix typo in the BFD section of vswitch.xmlMin Chen
Signed-off-by: Min Chen <minchnew@gmail.com> Signed-off-by: Justin Pettit <jpettit@nicira.com>
2013-07-08Add basic OpenFlow 1.1 protocol support.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-07-08bridge: Add ifindex column to Interface table.Neil McKee
This commit adds an "ifindex" column to the "Interface" table in the db. Signed-off-by: Neil McKee <neil.mckee@inmon.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-28Replace all uses of strerror() by ovs_strerror(), for thread safety.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-28bridge: Don't log flow miss model on every reconfiguration.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-26ofproto-dpif: Add 'force-miss-model' configurationJoe Stringer
This adds support for specifying flow miss handling behaviour at runtime, through a new "other-config" option in the Open_vSwitch table. This takes precedence over flow-eviction-threshold. By default, the behaviour is the same as before. If force-miss-model is set to 'with-facets', then flow miss handling will always result in the creation of new facets and flow-eviction-threshold will be ignored. If force-miss-model is set to 'without-facets', then flow miss handling will never result in the creation of new facets (effectively the same as setting the flow-eviction-threshold to 0, which is not currently configurable). We intend to use this configuration option in the testsuite to force particular code paths to be used, allowing us to improve test coverage. Signed-off-by: Joe Stringer <joe@wand.net.nz> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-24flow: New function hash_ofp_port() and hash_ofp_port().Ethan Jackson
These functions are used so often, that having an easy to read helper is worth it. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-06-20Create specific types for ofp and odp portAlex Wang
Until now, datapath ports and openflow ports were both represented by unsigned integers of various sizes. With implicit conversions, etc., it is easy to mix them up and use one where the other is expected. This commit creates two typedefs, ofp_port_t and odp_port_t. Both of these two types are marked by "__attribute__((bitwise))" so that sparse can be used to detect any misuse. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-20vswitchd: Update flow-eviction-threshold documentationJoe Stringer
Patch 27a88d1373cbfcceac6d901bbf1c17051aa7845f caused the vswitchd documentation and the code to digress. This brings them back in line. Signed-off-by: Joe Stringer <joe@wand.net.nz> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-17leak-checker: Remove because it cannot be made thread-safe.Ben Pfaff
The underlying glibc interface is deprecated because the interface itself is not thread-safe. That means that there's no way for a layer on top of it to be thread-safe. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-06-07ofproto-dpif: Set flow-eviction-threshold globally.Ethan Jackson
With the single datapath, it no longer makes sense to have a per ofproto flow eviction threshold. This patch moves the flow eviction threshold to the Open_vSwitch table making the setting global, though still treated separately for each ofproto. A future patch will unify flow eviction on a per datapath basis. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-06-05signals: Make thread-safe.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-06-04bridge.c: Change variable "ofport" type in "struct if_cfg" and "struct iface"Alex Wang
This patch changes the variable type of "ofport" in "struct if_cfg" and "struct iface" from int64_t to uint16_t. This is more consistent with the OpenFlow-1.0 port definition. Also, before this patch, -1 is used to indicate an unknown port. This patch uses OFPP_NONE, since "ofport" becomes uint16_t. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>