summaryrefslogtreecommitdiff
path: root/ofproto/ofproto.h
Commit message (Collapse)AuthorAgeFilesLines
* bridge: Pass interface's configuration to datapath.Ilya Maximets2016-07-271-0/+2
| | | | | | | | | | | | This commit adds functionality to pass value of 'other_config' column of 'Interface' table to datapath. This may be used to pass not directly connected with netdev options and configure behaviour of the datapath for different ports. For example: pinning of rx queues to polling threads in dpif-netdev. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* ofproto-dpif-mirror: Add mirror snaplen support.William Tu2016-07-031-0/+2
| | | | | | | | | | This patch adds a 'snaplen' config for mirroring table. A mirrored packet with size larger than snaplen bytes will be truncated in datapath before sending to the mirror output port. Tested-at: https://travis-ci.org/williamtu/ovs-travis/builds/141186839 Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ipfix: Export user specified virtual observation IDWenyu Zhang2016-06-241-0/+2
| | | | | | | | | | | | In virtual network, users want more info about the virtual point to observe the traffic. It should be a string to provide clear info, not a simple interger ID. Introduce "other-config: virtual_obs_id" in IPFIX, which is a string configured by user. Introduce an enterprise IPFIX entity "virtualObsID"(898) to export the value. The entity is a variable-length string. Signed-off-by: Wenyu Zhang <wenyuz@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Revert "ipfix: Export user specified virtual observation ID".Ben Pfaff2016-06-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 337bebe91c94d9d201e28811c469869d32e978ff, which caused a crash in test 1048 "ofproto-dpif - Flow IPFIX sanity check" (now test 1051) with the following backtrace: #0 hmap_first_with_hash (hmap=<optimized out>, hmap=<optimized out>, hash=<optimized out>) at ../lib/hmap.h:328 #1 smap_find__ (smap=0x94, key=key@entry=0x817f7ab "virtual_obs_id", key_len=14, hash=2537071222) at ../lib/smap.c:366 #2 0x0812b9d7 in smap_get_node (smap=0x9738a276, key=0x817f7ab "virtual_obs_id") at ../lib/smap.c:198 #3 0x0812ba30 in smap_get (smap=0x94, key=0x817f7ab "virtual_obs_id") at ../lib/smap.c:189 #4 0x08055a60 in bridge_configure_ipfix (br=<optimized out>) at ../vswitchd/bridge.c:1237 #5 bridge_reconfigure (ovs_cfg=0x94) at ../vswitchd/bridge.c:666 #6 0x080568d3 in bridge_run () at ../vswitchd/bridge.c:2972 #7 0x0804c9dd in main (argc=10, argv=0xffd8b934) at ../vswitchd/ovs-vswitchd.c:112 Signed-off-by: Ben Pfaff <blp@ovn.org>
* ipfix: Export user specified virtual observation IDWenyu Zhang2016-06-241-0/+2
| | | | | | | | | | | | | | In virtual network, users want more info about the virtual point to observe the traffic. It should be a string to provide clear info, not a simple interger ID. Introduce "other-config: virtual_obs_id" in IPFIX, which is a string configured by user. Introduce an enterprise IPFIX entity "virtualObsID"(898) to export the value. The entity is a variable-length string. Signed-off-by: Wenyu Zhang <wenyuz@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ipfix: Support tunnel information for Flow IPFIX.Benli Ye2016-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to export tunnel information for flow-based IPFIX. The original steps to configure flow level IPFIX: 1) Create a new record in Flow_Sample_Collector_Set table: 'ovs-vsctl -- create Flow_Sample_Collector_Set id=1 bridge="Bridge UUID"' 2) Add IPFIX configuration which is referred by corresponding row in Flow_Sample_Collector_Set table: 'ovs-vsctl -- set Flow_Sample_Collector_Set "Flow_Sample_Collector_Set UUID" ipfix=@i -- --id=@i create IPFIX targets=\"IP:4739\" obs_domain_id=123 obs_point_id=456 cache_active_timeout=60 cache_max_flows=13' 3) Add sample action to the flows: 'ovs-ofctl add-flow mybridge in_port=1, actions=sample'('probability=65535,collector_set_id=1, obs_domain_id=123,obs_point_id=456')',output:3' NXAST_SAMPLE action was used in step 3. In order to support exporting tunnel information, the NXAST_SAMPLE2 action was added and with NXAST_SAMPLE2 action in this patch, the step 3 should be configured like below: 'ovs-ofctl add-flow mybridge in_port=1, actions=sample'('probability=65535,collector_set_id=1,obs_domain_id=123, obs_point_id=456,sampling_port=3')',output:3' 'sampling_port' can be equal to ingress port or one of egress ports. If sampling port is equal to output port and the output port is a tunnel port, OVS_USERSPACE_ATTR_EGRESS_TUN_PORT will be set in the datapath flow sample action. When flow sample action upcall happens, tunnel information will be retrieved from the datapath and then IPFIX can export egress tunnel port information. If samping_port=65535 (OFPP_NONE), flow-based IPFIX will keep the same behavior as before. This patch mainly do three tasks: 1) Add a new flow sample action NXAST_SAMPLE2 to support exporting tunnel information. NXAST_SAMPLE2 action has a new added field 'sampling_port'. 2) Use 'other_configure: enable-tunnel-sampling' to enable or disable exporting tunnel information. 3) If 'sampling_port' is equal to output port and output port is a tunnel port, the translation of OpenFlow "sample" action should first emit set(tunnel(...)), then the sample action itself. It makes sure the egress tunnel information can be sampled. 4) Add a test of flow-based IPFIX for tunnel set. How to test flow-based IPFIX: 1) Setup a test environment with two Linux host with Docker supported 2) Create a Docker container and a GRE tunnel port on each host 3) Use ovs-docker to add the container on the bridge 4) Listen on port 4739 on the collector machine and use wireshark to filter 'cflow' packets. 5) Configure flow-based IPFIX: - 'ovs-vsctl -- create Flow_Sample_Collector_Set id=1 bridge="Bridge UUID"' - 'ovs-vsctl -- set Flow_Sample_Collector_Set "Flow_Sample_Collector_Set UUID" ipfix=@i -- --id=@i create IPFIX \ targets=\"IP:4739\" cache_active_timeout=60 cache_max_flows=13 \ other_config:enable-tunnel-sampling=true' - 'ovs-ofctl add-flow mybridge in_port=1, actions=sample'('probability=65535,collector_set_id=1,obs_domain_id=123, obs_point_id=456,sampling_port=3')',output:3' Note: The in-port is container port. The output port and sampling_port are both open flow port and the output port is a GRE tunnel port. 6) Ping from the container whose host enabled flow-based IPFIX. 7) Get the IPFIX template pakcets and IPFIX information packets. Signed-off-by: Benli Ye <daniely@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Remove "VLAN splinters" feature.Pravin B Shelar2016-04-271-20/+0
| | | | | | | | | | | The "VLAN splinters" feature works around buggy device drivers in old Linux versions. But support for the old kernel is dropped, So now all supported kernel vlan drivers should be working fine with OVS kernel datapath. Following patch removes this deprecated feature. Signed-off-by: Pravin B Shelar <pshelar@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* Move lib/meta-flow.h to include/openvswitch directoryBen Warren2016-04-141-1/+1
| | | | | | | | | This commit also moves some bitmap macros into public header files and adds some #include directives in soure files in order to make the 'meta-flow.h' move possible. Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-vswitchd: Preserve datapath ports across graceful shutdown.Ben Pfaff2016-02-051-2/+2
| | | | | | | | | | | | | | | | | | | Until now, asking ovs-vswitchd to shut down gracefully, e.g. with "ovs-appctl exit", would cause it to first remove all the ports from kernel-based datapaths. This has the unfortunate side effect that IP addresses on any removed "internal" ports are lost, even if the ports are added again when ovs-vswitchd is restarted. This is long-standing behavior, but it only became important when the OVS control scripts were changed to try to do graceful shutdown first instead of using a signal. This commit changes graceful shutdown so that it leaves ports in the datapath, fixing the problem. Fixes: 9b5422a98f8 (ovs-lib: Try to call exit before killing.) Reported-by: Edgar Cantu <eocantu@us.ibm.com> Reported-at: http://openvswitch.org/pipermail/discuss/2016-January/020024.html Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Gurucharan Shetty <guru@ovn.org>
* dpif-netdev: Allow different numbers of rx queues for different ports.Ilya Maximets2016-02-041-1/+0
| | | | | | | | | | | | | | | | | | | Currently, all of the PMD netdevs can only have the same number of rx queues, which is specified in other_config:n-dpdk-rxqs. Fix that by introducing of new option for PMD interfaces: 'n_rxq', which specifies the maximum number of rx queues to be created for this interface. Example: ovs-vsctl set Interface dpdk0 options:n_rxq=8 Old 'other_config:n-dpdk-rxqs' deleted. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* Implement OpenFlow 1.4+ OFPTC_EVICTION.Ben Pfaff2015-07-031-7/+11
| | | | | | | | | | | | | | | | | | OpenFlow 1.4 introduces the ability to turn on flow table eviction with an OFPT_TABLE_MOD message specifying OFPTC_EVICTION. It also adds related machinery to other messages that mention OFPTC_* fields. This commit adds support for the new feature, implementing it as a second, parallel way to enable flow table eviction. It takes more work than it seems like it should because there is so much weirdness with the treatment of OFPTC_* flags over the evolution of OpenFlow; please refer to the explanation in DESIGN.md for more information. This commit also adds related support to ovs-ofctl, plus tests. Signed-off-by: Ben Pfaff <blp@nicira.com> Co-authored-by: Saloni Jain <saloni.jain@tcs.com> Signed-off-by: Saloni Jain <saloni.jain@tcs.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* auto-attach: Add auto-attach support to ofproto layerDennis Flynn2015-03-031-0/+16
| | | | | | Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com> Signed-off-by: Dennis Flynn <drflynn@avaya.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* mcast-snoop: Add support to control Reports forwardingFlavio Leitner2015-02-041-1/+6
| | | | | | | | | The RFC4541 section 2.1.1 item 1 allows the snooping switch to provide an administrative control to allow Report messages to be flooded to ports not connected to multicast routers. Signed-off-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* rstp: Add 'rstp-admin-p2p-mac' and 'rstp-admin-port-state' setters.Jarno Rajahalme2014-11-141-0/+2
| | | | | | | | | | | | | | | | 'rstp-admin-port-state' is the Administrative Bridge Port state variable defined in the 802.1D-2004 standard. It can be set to include or exclude a port from the active topology by management (section 7.4). operPointToPointMAC and 'rstp-admin-p2p-mac' are a pair of parameters that permit inspection of, and control over, the administrative and operational state of the point-to-point status of the MAC entity by the MAC Relay Entity. adminPointToPointMAC can be set by management and its value is reflected on operPointToPointMAC. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp: Show some useful rstp port fields.Jarno Rajahalme2014-11-131-0/+3
| | | | | | | designated_bridge_id, designated_port_id and designated_path_cost are now displayed in rstp_status when using 'ovs-vsctl list port'. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* sflow: Export LAG, PORTNAME, and OPENFLOWPORT information also.Neil McKee2014-11-111-0/+2
| | | | | | | | | | | | | | | | | | | Export standard sFlow LAG, PORTNAME and OPENFLOWPORT structures with each counter-sample. Add unit-test for sFlow-LAG. Adjust other unit-tests to accommodate these new annotations. The sFlow-LAG structures are important for topology discovery, for troubleshooting LAG instability, and for correctly combining sFlow feeds from multiple sources. The OPENFLOWPORT and PORTNAME structures are important for systems that aim to combine sFlow monitoring with OpenFlow controls, as they provide straightforward mapping (1) between sFlow agent IP and OpenFlow datapath-id, and (2) between interface name,ifIndex and OpenFlow port number. Signed-off-by: Neil McKee <neil.mckee@inmon.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* dpif-netdev: Allow multi-rx-queue, multi-pmd-thread configuration.Alex Wang2014-09-191-0/+2
| | | | | | | | | | | | | | This commits adds the multithreading functionality to OVS dpdk module. Users are able to create multiple pmd threads and set their cpu affinity via specifying the cpu mask string similar to the EAL '-c COREMASK' option. Also, the number of rx queues for each dpdk interface is made configurable to help distribution of rx packets among multiple pmd threads. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* ofproto: Increase default datapath max_idle time.Joe Stringer2014-09-151-1/+1
| | | | | | | | | | | | The datapath max_idle value determines how long to wait before deleting an idle datapath flow when operating below the flow_limit. This patch increases the max_idle to 10 seconds, which allows datapath flows to be remain cached even if they are used less consistently, and provides a small improvement in the supported number of flows when operating around the flow_limit. Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* Rapid Spanning Tree Protocol (IEEE 802.1D).Daniele Venturino2014-09-091-0/+50
| | | | | | | | | This is the v5 from June 12th, 2014, rebased to OVS master, further changes in following patches. Signed-off by: Daniele Venturino <daniele.venturino@m3s.it> Signed-off by: Martino Fornasa <mf@fornasa.it> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Daniele Venturino <daniele.venturino@m3s.it>
* Extend OVS IPFIX exporter to export tunnel headersWenyu Zhang2014-08-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | Extend IPFIX exporter to export tunnel headers when both input and output of the port. Add three other_config options in IPFIX table: enable-input-sampling, enable-output-sampling and enable-tunnel-sampling, to control whether sampling tunnel info, on which direction (input or output). Insert sampling action before output action and the output tunnel port is sent to datapath in the sampling action. Make datapath collect output tunnel info and send it back to userpace in upcall message with a new additional optional attribute. Add a tunnel ports map to make the tunnel port lookup faster in sampling upcalls in IPFIX exporter. Make the IPFIX exporter generate IPFIX template sets with enterprise elements for the tunnel info, save the tunnel info in IPFIX cache entries, and send IPFIX DATA with tunnel info. Add flowDirection element in IPFIX templates. Signed-off-by: Wenyu Zhang <wenyuz@vmware.com> Acked-by: Romain Lenglet <rlenglet@vmware.com> Acked-by: Ben Pfaff <blp@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* ofp-util: Abstract table miss configuration and fix related bugs.Ben Pfaff2014-08-111-18/+2
| | | | | | | | | | | | | | | | | | | The ofproto implementation has had an abstraction layer on top of OFPTC11_TABLE_MISS for a while. This commit pushes that abstraction layer farther down, into ofp-util. This will be more useful in an upcoming commit. During the conversion I realized that the previous implementation was not entirely correct. In particular, the OpenFlow 1.3+ "table mod" was still being treated as if it had table miss configuration bits, even though it doesn't. This commit fixes that issue and updates the tests. OpenFlow 1.4 adds some more OFPTC_* flags that this new abstraction doesn't yet support, but OVS didn't support those flags any better before this commit, so abstracting those is left as future work. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* Simplify ofproto_controller_info by using a struct smap in place of array.Ben Pfaff2014-07-171-6/+2
| | | | | | | | | The only client for ofproto_controller_info was transforming the array of pairs into an smap anyway. It's easy for the code that fills in the array to generate it as an smap directly, and it's also easier to extend later. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Gurucharan Shetty <gshetty@nicira.com>
* lib/classifier: Lockless lookups.Jarno Rajahalme2014-07-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all the relevant classifier structures use RCU and internal mutual exclusion for modifications, we can remove the fat-rwlock and thus make the classifier lookups lockless. As the readers are operating concurrently with the writers, a concurrent reader may or may not see a new rule being added by a writer, depending on how the concurrent events overlap with each other. Overall, this is no different from the former locked behavior, but there the visibility of the new rule only depended on the timing of the locking functions. A new rule is first added to the segment indices, so the readers may find the rule in the indices before the rule is visible in the subtables 'rules' map. This may result in us losing the opportunity to quit lookups earlier, resulting in sub-optimal wildcarding. This will be fixed by forthcoming revalidation always scheduled after flow table changes. Similar behavior may happen due to us removing the overlapping rule (if any) from the indices only after the corresponding new rule has been added. The subtable's max priority is updated only after a rule is inserted to the maps, so the concurrent readers may not see the rule, as the updated priority ordered subtable list will only be visible after the subtable's max priority is updated. Similarly, the classifier's partitions are updated by the caller after the rule is inserted to the maps, so the readers may keep skipping the subtable until they see the updated partitions. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
* ofproto: Add functions to configure multicast snoopingFlavio Leitner2014-06-241-0/+13
| | | | | Signed-off-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofproto: Add separate functions for checking bfd/cfm status change.Alex Wang2014-06-131-0/+3
| | | | | | | | | | | | | | | Currently, ofproto_port_get_bfd/cfm_status() is used to check the bfd/cfm status change and query the status change. Users decide what to do with the filled status struct based on the return value of the funciton. Such design is confusing and makes the caller code hard to read. This commit breaks the function into a status change check function and a status query function, so that they become easier to read and use. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* cfm: Extracts the cfm status in one function.Alex Wang2014-06-131-24/+1
| | | | | | | | | This commit adds a new function, cfm_get_status(), for extracting all cfm status at once. This helps avoid the sequence of lock acquire/release in current implementation of status query. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Use prefix trie lookup for IPv4 by default.Jarno Rajahalme2014-05-161-0/+3
| | | | | | | | Unless otherwise configured, the prefix trie lookup is enabled for IPv4 destination and source address fields. A new keyword "none" is accepted as the value of "prefixes" in the OVSDB Flow_Table column. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* bfd/cfm: Check status change before update status to database.Alex Wang2014-04-241-3/+3
| | | | | | | | | | | | | This commit adds boolean flag in bfd/cfm module for checking status change. If there is no status change, the current update to OVS database will skip the bfd/cfm session. In the experiment with 5K bfd sessions, when one session is flapping at rate of every 0.3 second, this patch reduces the cpu utilization of the ovs-vswitchd thread from 13 to 6. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
* ofproto/bond: Implement bond megaflow using recirculationAndy Zhou2014-04-071-1/+2
| | | | | | | | | | | | | | | | Infrastructure to enable megaflow support for bond ports using recirculation. This patch adds the following features: * Generate RECIRC action when bond can benefit from recirculation. * Populate post recirculation rules in a hidden table. Currently table 254. * Uses post recirculation rules for bond rebalancing * A recirculation implementation in dpif-netdev. The goal of this patch is to be able to megaflow bond outputs and thus greatly improve performance. However, this patch does not actually improve the megaflow generation. It is left for a later commit. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofproto: Support OF version-specific table-miss behavioursSimon Horman2014-04-031-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenFlow 1.1 and 1.2 specify that if a table-miss occurs then the default behaviour is to forward the packet the controller using a packet-in message. And until this patch this is the default behaviour that Open vSwitch uses for all OpenFlow versions. OpenFlow1.3+ specifies that if a table-miss occurs then the default behaviour is simply to drop the packet. This patch implements this behaviour using the following logic: If a table-miss occurs and the table-miss behaviour for the table has not been set using a table_mod (in which case it is no longer the default setting) then: * Installing a facet in the datapath with a drop action in the if there are no pre-OF1.3 controllers connected which would receive an packet_in message. Note that this covers both the case where there are only OF1.3 controllers and the case where there are no controllers at all. * Otherwise sent a packet_in message to all pre-OF1.3 controllers. This covers both the case where there are only pre-OF1.3 controllers and there are both pre-OF1.3 and OF1.3+ controllers. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofproto: Honour Table Mod settings for table-miss handlingSimon Horman2014-03-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reworks lookup of rules for both table 0 and table action translation. The result is that Table Mod settings, which can alter the miss-behaviour of tables, including table 0, on a per-table basis may be honoured. Previous patches proposed by myself which build on earlier merged patches by Andy Zhou implement the ofproto side of Table Mod. So with this patch the feature should be complete. Neither this patch, nor any other patches it builds on, alter the default behaviour of Open vSwitch. And in particular the OpenFlow1.1 behaviour is the default regardless of which OpenFlow version is negotiated between the switch and the controller. An implementation detail, which lends itself to future work, is the handling of OFPTC_TABLE_MISS_CONTINUE. If a table has this behaviour set by Table Mod and a miss occurs then a loop is created, skipping to the next table. It is quite easy to create a situation where this loop covers ~255 tables which is very expensive as the lookup for each table involves taking locks, amongst other things. Cc: Andy Zhou <azhou@nicira.com> Signed-off-by: Simon Horman <horms@verge.net.au> [blp@nicira.com updated comments and refactored] Signed-off-by: Ben Pfaff <blp@nicira.com>
* upcall: Configure datapath max-idle through ovs-vsctl.Joe Stringer2014-03-071-0/+2
| | | | | | | | | This patch adds a new configuration option, "max-idle" to the Open_vSwitch "other-config" column. This sets how long datapath flows are cached in the datapath before revalidators expire them. Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Justin Pettit <jpettit@nicira.com>
* ofproto: Remove 'force-miss-model' configuration.Joe Stringer2014-02-191-8/+0
| | | | | | | | | This configuration item was introduced to assist testing of upcall handling behaviour with and without facets. Facets were removed in commit e79a6c833e0d7237, so this patch removes the configuration item. Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofproto: Handle negative number of threads.Gurucharan Shetty2014-01-241-1/+1
| | | | | | | | As of now, setting other_config:n-handler-threads to a negative value causes ovs-vswitchd to crash. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* ofproto: Handle flow installation and eviction in upcall.Ethan Jackson2013-12-191-4/+3
| | | | | | | | | | | | This patch moves flow installation and eviction from ofproto-dpif and the main thread, into ofproto-dpif-upcall. This performs significantly better (approximately 2x TCP_CRR improvement), and allows ovs-vswitchd to maintain significantly larger datapath flow tables. On top of that, it significantly simplifies the code, retiring "struct facet" and friends. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofproto: Simplify thread creation API.Ethan Jackson2013-12-131-1/+1
| | | | | | | | | | | | There's no particular reason for the function controlling the number of threads to be bound up with dpif_recv_set(). This patch breaks them up, but as a side effect means threads will run doing nothing when datapath upcall receiving is disabled. By doing this, the udpif thread creation API becomes a bit easier to reason about once there are multiple types of thread introduced in future patches. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofproto-dpif-upcall: Add memory usage stats.Ethan Jackson2013-12-121-0/+1
| | | | | Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofproto: Remove run_fast() functions.Ethan Jackson2013-12-121-2/+0
| | | | | | | | They don't really make sense in a multithreaded architecture. Once flow miss batches are dispatched with, they will be extra useless. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofproto: Modularize netflow.Ethan Jackson2013-12-121-8/+0
| | | | | | | | | | The netflow code has its tentacles all over the ofproto-dpif module. This is fine today, but in future facets, which correspond roughly to netflow_flows, will be retired. In preparation, this patch hides as much implementation detail as possible inside the netflow module. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofproto: Fix alphabetical order in list of structs.Ben Pfaff2013-12-111-2/+2
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* Classifier: Track address prefixes.Jarno Rajahalme2013-12-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a prefix tree (trie) structure for tracking the used address space, enabling skipping classifier tables containing longer masks than necessary for an address field value in a packet header being classified. This enables less unwildcarding for datapath flows in parts of the address space without host routes. Trie lookup is interwoven to the staged lookup, so that a trie is searched only when the configured trie field becomes relevant for the lookup. The trie lookup results are retained so that each trie is checked at most once for each classifier lookup. This implementation tracks the number of rules at each address prefix for the whole classifier. More aggressive table skipping would be possible by maintaining lists of tables that have prefixes at the lengths encountered on tree traversal, or by maintaining separate tries for subsets of rules separated by metadata fields. Prefix tracking is configured via OVSDB. A new column "prefixes" is added to the database table "Flow_Table". "prefixes" is a set of string values listing the field names for which prefix lookup should be used. As of now, the fields for which prefix lookup can be enabled are: - tun_id, tun_src, tun_dst - nw_src, nw_dst (or aliases ip_src and ip_dst) - ipv6_src, ipv6_dst There is a maximum number of fields that can be enabled for any one flow table. Currently this limit is 3. Examples: ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- \ --id=@N1 create Flow_Table name=table0 ovs-vsctl set Bridge br0 flow_tables:1=@N1 -- \ --id=@N1 create Flow_Table name=table1 ovs-vsctl set Flow_Table table0 prefixes=ip_dst,ip_src ovs-vsctl set Flow_Table table1 prefixes=[] Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* bridge: Refresh STP statistics separately from statusJoe Stringer2013-12-101-0/+6
| | | | | | | | | | | | Currently, we refresh STP status (id, state, role) alongside statistics (rx, tx, errors), all within instant_stats_run(). This patch splits statistics out, and refreshes them with the 5 second stats instead. This paves the way to reducing execution of instant_stats_run(). Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* cfm: Add ovsdb column "cfm_flap_count".alex wang2013-11-041-0/+2
| | | | | | | | | This commit adds a new ovsdb column "cfm_flap_count". It counts the number of cfm fault flaps since boot. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* rule_ofpacts: keep datapath meter_id.Jarno Rajahalme2013-09-161-3/+0
| | | | | | | | This allows datapaths to operate without referring to the ofproto-level meter configuration for mater ID mapping, which reduces needs for locking. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ipfix: implement flow caching and aggregation in exporterRomain Lenglet2013-08-221-0/+4
| | | | | | | | | | | | | | | 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>
* ofproto: Make number of packet handler threads runtime configurable.Alex Wang2013-08-151-0/+1
| | | | | | | | | 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>
* tag: Retire the venerable tag library.Ethan Jackson2013-08-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch retires a venerable library whose inception dates before the first patch of the current repository: tags. They have served us well, but their time has come for the reasons listed below. 1) They don't actually help much. In theory, tags had been used to reduce revalidation necessary when using bonds, mac-learning, and frequently changing flow tables. With bonds and mac-learning, things change happen so rarely that tagging isn't worth it. That leaves flow table changes. With the complex flow tables in my testing, the revalidate_set gets so overwhelmed with tags, that we end up revalidating every facet every time through the run loop. In other words, they tags are giving us no benefit. 2) They complicate the code. This patch simplifies the code and removes a couple of rather ugly kludges. 3) They complicated locking once threading hits. Because of the calculate_flow_tag() function, the table_dpif structure would require locking in a multi-threaded OVS. Though this problem isn't insurmountable, it's annoying and probably would cause lock contention. Of course, we could try to work around these problems with a more advanced tagging infrastructure, but this moves in the opposite of the direction we should be. Ideally we'll have a more-or-less stateless ofproto-dpif supporting a massive number of datapath flows. Tags (or facets for that matter) aren't going to work in this new world. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* cfm: Make the CFM module thread safe.Ethan Jackson2013-08-011-1/+1
| | | | | Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofproto: Implement OpenFlow 1.3 meter table.Jarno Rajahalme2013-06-281-0/+3
| | | | | | Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> Co-authored-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofproto-dpif: Add 'force-miss-model' configurationJoe Stringer2013-06-261-0/+8
| | | | | | | | | | | | | | | | | | | 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>