summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Move lib/dynamic-string.h to include/openvswitch directoryBen Warren2016-03-192-0/+93
| | | | | Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Move lib/ofp-errors.h to include/openvswitch directoryBen Warren2016-03-192-0/+808
| | | | | Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Move lib/geneve.h to include/openvswitch directoryBen Warren2016-03-192-0/+64
| | | | | Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* thread: Keep openvswitch/thread.h #includes more contained within include/.Ben Pfaff2016-02-261-1/+1
| | | | | | | | It's better if the "include" directory is self-contained to the extent possible. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* Implement OFPT_TABLE_STATUS Message.Saloni Jain2016-02-241-0/+8
| | | | | | | | | | | | | | On change in a table state, the controller needs to be informed with the OFPT_TABLE_STATUS message. The message is sent with reason OFPTR_VACANCY_DOWN or OFPTR_VACANCY_UP in case of change in remaining space eventually crossing any one of the threshold. Signed-off-by: Saloni Jain <saloni.jain@tcs.com> Co-authored-by: Rishi Bamba <rishi.bamba@tcs.com> Signed-off-by: Rishi Bamba <rishi.bamba@tcs.com> [blp@ovn.org added vacancy event initialization and tests and updated NEWS] Signed-off-by: Ben Pfaff <blp@ovn.org>
* Implement serializing the state of packet traversal in "continuations".Ben Pfaff2016-02-191-2/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One purpose of OpenFlow packet-in messages is to allow a controller to interpose on the path of a packet through the flow tables. If, for example, the controller needs to modify a packet in some way that the switch doesn't directly support, the controller should be able to program the switch to send it the packet, then modify the packet and send it back to the switch to continue through the flow table. That's the theory. In practice, this doesn't work with any but the simplest flow tables. Packet-in messages simply don't include enough context to allow the flow table traversal to continue. For example: * Via "resubmit" actions, an Open vSwitch packet can have an effective "call stack", but a packet-in can't describe it, and so it would be lost. * A packet-in can't preserve the stack used by NXAST_PUSH and NXAST_POP actions. * A packet-in can't preserve the OpenFlow 1.1+ action set. * A packet-in can't preserve the state of Open vSwitch mirroring or connection tracking. This commit introduces a solution called "continuations". A continuation is the state of a packet's traversal through OpenFlow flow tables. A "controller" action with the "pause" flag, which is newly implemented in this commit, generates a continuation and sends it to the OpenFlow controller in a packet-in asynchronous message (only NXT_PACKET_IN2 supports continuations, so the controller must configure them with NXT_SET_PACKET_IN_FORMAT). The controller processes the packet-in, possibly modifying some of its data, and sends it back to the switch with an NXT_RESUME request, which causes flow table traversal to continue. In principle, a single packet can be paused and resumed multiple times. Another way to look at it is: - "pause" is an extension of the existing OFPAT_CONTROLLER action. It sends the packet to the controller, with full pipeline context (some of which is switch implementation dependent, and may thus vary from switch to switch). - A continuation is an extension of OFPT_PACKET_IN, allowing for implementation dependent metadata. - NXT_RESUME is an extension of OFPT_PACKET_OUT, with the semantics that the pipeline processing is continued with the original translation context from where it was left at the time it was paused. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* Support userdata in NXT_PACKET_IN2.Ben Pfaff2016-02-191-0/+1
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* Implement new packet-in format NXT_PACKET_IN2.Ben Pfaff2016-02-191-4/+39
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* types: Fix defined but not used warning.William Tu2016-02-191-1/+2
| | | | | | | | warning: ‘OVS_BE128_MAX’ defined but not used [-Wunused-const-variable] Found using CentOS 6.6 with gcc 6.0.0. Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofp-msgs: Move most OpenFlow header definitions here.Ben Pfaff2016-02-193-39/+1
| | | | | | | | This code was the only user for OpenFlow header definitions other than struct ofp_header itself. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* ofp-msgs: Add support for ONF extension messages.Ben Pfaff2016-02-193-38/+0
| | | | | | | | | | | | | | | ONF introduced a number of "standard extensions" that use its own vendor (experimenter) ID. This commit adds support for such extensions to ofp-msgs. These extensions were already half-supported, so there's barely any change to build-aux/extract-ofp-msgs. This isn't fully tested, since nothing adds support for such a message yet. Requested-by: Jarno Rajahalme <jarno@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* openflow-common: Describe length and padding rules for OpenFlow properties.Ben Pfaff2016-02-161-0/+6
| | | | | | | I keep having to rediscover these from the code. This is easier. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* compiler: Don't require constructor names to be globally unique in MSVC.Ben Pfaff2016-02-101-1/+1
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* compiler: Document OVS_CONSTRUCTOR.Ben Pfaff2016-02-101-1/+8
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* vlog: Fix windows build.Russell Bryant2016-02-101-1/+1
| | | | | | | | | | A recent change changed this constructor to "init_this_module". This breaks the build on windows according to AppVeyor. Include the module name in the constructor name to work around the issue. Fixes: 922fed065e65 ("vlog: Make the most common module reference more direct.") Signed-off-by: Russell Bryant <russell@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* vlog: Make the most common module reference more direct.Ben Pfaff2016-02-101-37/+36
| | | | | | | | | | | | | Most vlog calls are for the log module owned by the translation unit being compiled, but this module was referenced indirectly through a pointer variable. That seems silly, so this commit changes the code so that the local vlog module is referred to directly, as &this_module. We could get rid of the global variables for vlog modules entirely, but I like getting linker errors when there's a duplicate module name. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* vlog: Simplify module definition.Ben Pfaff2016-02-031-20/+14
| | | | | | | | | | Until now, vlog had a macro VLOG_DEFINE_THIS_MODULE, which expanded using VLOG_DEFINE_MODULE, which expanded using VLOG_DEFINE_MODULE__, and the latter macros didn't have any other users. This commit combines them for clarity. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* vlog: Make 'vlog_modules' private to vlog.c.Ben Pfaff2016-02-031-4/+1
| | | | | | | | | I think we once used this variable from an inline function in vlog.h, so that we had to make it "extern", but these days it's only used from vlog.c, so it can be static now. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* openflow: Better abstract handling of packet-in messages.Ben Pfaff2016-01-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Packet-in messages have been a bit of a mess. First, their abstraction in the form of struct ofputil_packet_in has some fields that are used in a clear way for incoming and outgoing packet-ins, and others (packet_len, total_len, buffer_id) have have confusing meanings or usage pattern depending on their direction. Second, it's very confusing how a packet-in has both a reason (OFPR_*) and a miss type (OFPROTO_PACKET_IN_*) and how those add up to the actual reason that is used "on the wire" for each OpenFlow version (and even whether the packet-in is sent at all!). Finally, there's all kind of low-level detail randomly scattered between connmgr, ofproto-dpif-xlate, and ofp-util. This commit attempts to clear up some of the confusion. It simplifies the struct ofputil_packet_in abstraction by removing the members that didn't have a clear and consistent meaning between incoming and outgoing packet-ins. It gets rid of OFPROTO_PACKET_IN_*, instead adding a couple of nonstandard OFPR_* reasons that add up to what OFPROTO_PACKET_IN_* was meant to say (in what I hope is a clearer way). And it consolidates the tricky parts into ofp-util, where I hope it will be easier to understand all in one place. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* openflow: Get rid of struct ofp13_packet_in.Ben Pfaff2016-01-201-20/+1
| | | | | | | | | It's actually harder to parse OF1.2/OF1.3 "packet-in" messages when ofp13_packet_in is involved than when the code just realizes that ofp13_packet_in = ofp12_packet_in + cookie. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* ofp-util: Rewrite async config encoding and decoding to be table-driven.Ben Pfaff2016-01-201-22/+1
| | | | | | | | | | | | | | | | | | | | | | | | The encoding and decoding of the OpenFlow and Open vSwitch async config messages was, until now, a collection of disjoint code that had a lot of redundancy. This commit changes it all to be driven using a single central table. This rewrite fixes a bug in the OF1.4+ version of the code, which until now assumed that every TLV in an OF1.4+ asynchronous configuration message was exactly 8 bytes long, and reported an error if any was a different length. This invariant is true of all the standard TLVs already defined, but it won't be true of any experimenter TLVs (and won't necessarily be true of any new standard TLVs), so this commit changes it to be more tolerant. The OFPACPT_* constants are no longer useful (they are encoded directly in the table and do not need to be anywhere else), so this removes them. This commit also adds support for experimenter async config messages. We don't have any yet but an upcoming commit will add one. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* ofp-util: Define struct ofputil_async_cfg to hold async message config.Ben Pfaff2016-01-201-1/+23
| | | | | | | This seems a little better than a pair of bare arrays. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* openflow: Implement OF1.4+ OFPMP_QUEUE_DESC multipart message.Ben Pfaff2016-01-201-0/+25
| | | | | | | | | | | | | | | | | | OpenFlow 1.0 through 1.3 have a message OFPT_QUEUE_GET_CONFIG_REQUEST and its corresponding reply, for fetching a description of the queues configured on a given port. OpenFlow 1.4 changes this message to a multipart message OFPMP_QUEUE_DESC, which Open vSwitch has not until now implemented. This commit adds an implemntation of that message. Because the message is a replacement for the former one, this commit implements it using the same ofp-util functions as the former message, so that the client code doesn't have to distinguish a difference between versions. The ovs-ofctl command queue-get-config was previously undocumented (due only to an oversight). This commit corrects that and documents the new feature available with OpenFlow 1.4. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* openflow: Remove unused (and not useful) property headers.Ben Pfaff2016-01-202-127/+0
| | | | | | | | These are all just copies of the otherwise generic ofp_prop_header or ofp_prop_experimenter. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* ofp-prop: Add generic functions for working with 16- and 32-bit properties.Ben Pfaff2016-01-202-45/+0
| | | | | | | These will see increasing use in upcoming commits. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* ofp-prop: New module for working with OpenFlow 1.3+ properties.Ben Pfaff2016-01-201-0/+28
| | | | | | | | | | | | | Several OpenFlow 1.3+ messages use TLV-based properties that take a common form. Until now, ofp-util has had some static functions for dealing with properties. Because properties will start to be needed outside of ofp-util, this commit breaks them out into a new library, renaming them to begin with ofpprop_. The following commit will add a few new interfaces that add new functionality. Signed-off-by: Ben Pfaff <blp@ovn.org>
* openflow: Rename OF0.1-1.3 queue property constants.Ben Pfaff2016-01-202-24/+36
| | | | | | | | | | | | | | | At first glance, OF1.4 queue properties look a lot like those for OF1.0 to OF1.3, but in fact their different padding makes them incompatible. In addition, OF1.4 switches from using regular OpenFlow messages to request queue properties, to using multipart messages. Thus, we really need to use separate code to deal with OF1.4 queues. OF1.0, OF1.1, and OF1.2 all have slightly different queue config reply messages, but only OF1.0 and OF1.2 had tests, so this adds tests. (There is no test for OF1.3 because it's the same as OF1.2.) Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* openflow-1.2: Remove unused struct definition.Ben Pfaff2016-01-191-9/+0
| | | | | | | | Experimenter stats are handled by code in ofp-msgs, and this struct isn't good for anything. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* ofp-msgs: Fix definitions of OF1.4 OFPT_GET_ASYNC_REPLY and OFPT_SET_ASYNC.Ben Pfaff2016-01-191-11/+0
| | | | | | | | | | | | | | The structures declared in ofp-msgs.h for messages definitions should not include an OpenFlow header (its presence is implied), but the definition of these messages did. This commit fixes the definitions. The visible bug was really minor here: messages of these kinds without any TLVs would be rejected by the OpenFlow parser. But OVS never sends these messages without TLVs, so probably no one ever noticed this. (Also, the OVS support for OF1.4 is still incomplete and experimental.) Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
* types: Define OVS_*128_MAX statically.Joe Stringer2015-12-221-2/+7
| | | | | | | | | | | | | The previous definitions of these variables using designated initializers caused a variety of issues when attempting to compile with MSVC, particularly if including these headers from C++ code. By defining them like this, we can appease MSVC and keep the definitions the same on all platforms. VMware-BZ: #1517163 Suggested-by: Yin Lin <linyi@vmware.com> Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* sparse: Define INET_ADDRSTRLEN.Ben Pfaff2015-12-151-0/+1
| | | | | | | | POSIX defines this but it was missing from the OVS header file definitions for "sparse". Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* geneve-map-rename: rename geneve-map to tlv-map.Mengke Liu2015-12-151-37/+49
| | | | | | | | | | | | | | | | | | This patch renames the command name related with geneve-map to a more generic name as following: add-geneve-map -> add-tlv-map del-geneve-map -> del-tlv-map dump-geneve-map -> dump-tlv-map It also renames the Geneve_table to tlv_table. By doing this renaming, the NSH variable context header (the same TLV format as Geneve) or other protocol can reuse the field tun_metadata<N> in the future. Signed-off-by: Mengke Liu <mengke.liu@intel.com> Signed-off-by: Ricky Li <ricky.li@intel.com> Signed-off-by: Jesse Gross <jesse@kernel.org>
* types: Correct typo in comment above eth_addr.Simon Horman2015-12-011-1/+1
| | | | | | | Correct spelling of struct in comment above eth_addr. Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofproto: Implement OF1.4 error code for set-async-configAmbika Arora2015-11-302-1/+5
| | | | | | | | | | This patch adds support for Openflow1.4 error codes for set-async-config. In this patch, a new error type, OFPET_ASYNC_CONFIG_FAILED is introduced that enables the switch to properly inform the controller when controller tries to set invalid mask or unsupported configuration. Signed-off-by: Ambika Arora <ambika.arora@tcs.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* openflow: Remove OFPG11_*Jarno Rajahalme2015-11-241-16/+2
| | | | | | | | | Protocol-independent symbols OFPG_* were already defined in openflow-common.h, so remove the protocol version dependent symbols. Found by inspection. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* vlog: Only compile vlog_change_owner on Unix platformAndy Zhou2015-11-111-1/+3
| | | | | | uid_t and gid_t are not defined for Windows platform. Signed-off-by: Andy Zhou <azhou@nicira.com>
* vlog: change log file owner when switching userAndy Zhou2015-11-111-0/+1
| | | | | | | | | | | vlog log file can be created when parsing --log-file option, before switching user, in case the --user option is also specified. While this does not directly cause errors for the running daemons, it can leave the log files on the disk as created under the "root" user. This patch fix the log file ownership to the user specified with --user. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ansis Atteka <aatteka@nicira.com>
* windefs: Redefine INET6_ADDRSTRLEN for Windows.Gurucharan Shetty2015-10-161-0/+3
| | | | | | | | | | Windows has INET6_ADDRSTRLEN defined as 65 whereas POSIX has it as 46. This difference causes a unit test failure as the test 'tunnel_push_pop' was looking at o/p format based on the length of INET6_ADDRSTRLEN. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
* Add support for connection tracking helper/ALGs.Joe Stringer2015-10-132-0/+3
| | | | | | | | | | | | | | | | | | | | This patch adds support for specifying a "helper" or ALG to assist connection tracking for protocols that consist of multiple streams. Initially, only support for FTP is included. Below is an example set of flows to allow FTP control connections from port 1->2 to establish active data connections in the reverse direction: table=0,priority=1,action=drop table=0,arp,action=normal table=0,in_port=1,tcp,action=ct(alg=ftp,commit),2 table=0,in_port=2,tcp,ct_state=-trk,action=ct(table=1) table=1,in_port=2,tcp,ct_state=+trk+est,action=1 table=1,in_port=2,tcp,ct_state=+trk+rel,action=ct(commit),1 Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* types: Add big-endian 128-bit types and helpers.Joe Stringer2015-10-131-0/+14
| | | | | | | | | These types will be used by the following patches to ensure a consistent wire format for 128-bit connection tracking labels. Common functions for comparison, endian translation, etc. are provided. Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* openflow-common: Correct Netronome vendor ID.Simon Horman2015-09-301-1/+2
| | | | | | | | | Due to an error on my part the Netronome vendor Id is incorrect: the last digit should be 'd' rather than '0' as per the Netronome IEEE OUI. Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofproto: Implement OF1.4 Group & Meter change notification messagesNiti Rohilla2015-09-091-0/+6
| | | | | | | | | | | | | This patch adds support for Openflow1.4 Group & meter change notification messages. In a multi controller environment, when a controller modifies the state of group and meter table, the request that successfully modifies this state is forwarded to other controllers. Other controllers are informed with the OFPT_REQUESTFORWARD message. Request forwarding is enabled on a per controller channel basis using the Set Asynchronous Configuration Message. Signed-off-by: Niti Rohilla <niti.rohilla@tcs.com> Co-authored-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* userspace: Define and use struct eth_addr.Jarno Rajahalme2015-08-285-22/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Define struct eth_addr and use it instead of a uint8_t array for all ethernet addresses in OVS userspace. The struct is always the right size, and it can be assigned without an explicit memcpy, which makes code more readable. "struct eth_addr" is a good type name for this as many utility functions are already named accordingly. struct eth_addr can be accessed as bytes as well as ovs_be16's, which makes the struct 16-bit aligned. All use seems to be 16-bit aligned, so some algorithms on the ethernet addresses can be made a bit more efficient making use of this fact. As the struct fits into a register (in 64-bit systems) we pass it by value when possible. This patch also changes the few uses of Linux specific ETH_ALEN to OVS's own ETH_ADDR_LEN, and removes the OFP_ETH_ALEN, as it is no longer needed. This work stemmed from a desire to make all struct flow members assignable for unrelated exploration purposes. However, I think this might be a nice code readability improvement by itself. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
* openflow: Add OpenFlow1.5 group desc request.Minoru TAKAHASHI2015-07-311-0/+7
| | | | | Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* openflow: Add OpenFlow1.5 port desc request.Minoru TAKAHASHI2015-07-311-0/+7
| | | | | Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* openflow: Add additional reserved space in struct nx_geneve_table_reply.Jesse Gross2015-07-281-2/+2
| | | | | | | | | | | | | | | It's possible to imagine that a switch might want to report additional capabilities related to Geneve beyond just the number of options and how much space they can consume. Some examples include additional restrictions on parsing (if this command is used for non-OVS implementations or OVS changes how it works) and per-packet actions that can't be done generically (such as checksums or encryption). It's not yet clear if these will be necessary or if OpenFlow is the right place to expose them. However, it's easy to do now and there is very little cost so it seems like a good idea to leave some additional reserved space. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofproto: Implement OF1.4 Set/Get asynchronous configuration messages.Niti Rohilla2015-07-271-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Openflow1.4 set/get asynchronous configuration messages. OpenVSwitch already supports set/get asynchronous configuration messages for Openflow1.3. In this patch OFPT_SET_ASYNC_CONFIG message allows the controllers to set the configuration for OFPT_ROLE_STATUS, OFPT_TABLE_STATUS and OFPT_REQUESTFORWARD in addition to the Openflow1.3 messages. In a OFPT_SET_ASYNC, only the properties that shall be changed need to be included, properties that are omitted from the message are unchanged. The OFPT_GET_ASYNC_CONFIG is used to query the asynchronous configuration of switch. In a OFPT_GET_ASYNC_REPLY message, all properties must be included. According to Openflow1.4 the initial configuration shall be: - In the “master” or “equal” role, enable all OFPT_PACKET_IN messages, except those with reason OFPR_INVALID_TTL, enable all OFPT_PORT_STATUS and OFPT_FLOW_REMOVED messages, and disable all OFPT_ROLE_STATUS, OFPT_TABLE_STATUS and OFPT_REQUESTFORWARD messages. - In the “slave” role, enable all OFPT_PORT_STATUS messages and disable all OFPT_PACKET_IN, OFPT_FLOW_REMOVED, OFPT_ROLE_STATUS, OFPT_TABLE_STATUS and OFPT_REQUESTFORWARD messages. Signed-off-by: Niti Rohilla <niti.rohilla@tcs.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Extend sFlow agent to report tunnel and MPLS structuresNeil McKee2015-07-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets are still sampled at ingress only, so the egress tunnel and/or MPLS structures are only included when there is just 1 output port. The actions are either provided by the datapath in the sample upcall or looked up in the userspace cache. The former is preferred because it is more reliable and does not present any new demands or constraints on the userspace cache, however the code falls back on the userspace lookup so that this solution can work with existing kernel datapath modules. If the lookup fails it is not critical: the compiled user-action-cookie is still available and provides the essential output port and output VLAN forwarding information just as before. The openvswitch actions can express almost any tunneling/mangling so the only totally faithful representation would be to somehow encode the whole list of flow actions in the sFlow output. However the standard sFlow tunnel structures can express most common real-world scenarios, so in parsing the actions we look for those and skip the encoding if we see anything unusual. For example, a single set(tunnel()) or tnl_push() is interpreted, but if a second such action is encountered then the egress tunnel reporting is suppressed. The sFlow standard allows "best effort" encoding so that if a field is not knowable or too onerous to look up then it can be left out. This is often the case for the layer-4 source port or even the src ip address of a tunnel. The assumption is that monitoring is enabled everywhere so a missing field can typically be seen at ingress to the next switch in the path. This patch also adds unit tests to check the sFlow encoding of set(tunnel()), tnl_push() and push_mpls() actions. The netlink attribute to request that actions be included in the upcall from the datapath is inserted for sFlow sampling only. To make that option be explicit would require further changes to the printing and parsing of actions in lib/odp-util.c, and to scripts in the test suite. Further enhancements to report on 802.1AD QinQ, 64-bit tunnel IDs, and NAT transformations can follow in future patches that make only incremental changes. Signed-off-by: Neil McKee <neil.mckee@inmon.com> [blp@nicira.com made stylistic and semantic changes] Signed-off-by: Ben Pfaff <blp@nicira.com>
* tunneling: Allow matching and setting tunnel 'OAM' flag.Jesse Gross2015-07-151-0/+3
| | | | | | | | | | | | | | | | | Several encapsulation formats have the concept of an 'OAM' bit which typically is used with networking tracing tools to distinguish test packets from real traffic. OVS already internally has support for this, however, it doesn't do anything with it and it also isn't exposed for controllers to use. This enables support through OpenFlow. There are several other tunnel flags which are consumed internally by OVS. It's not clear that it makes sense to use them externally so this does not expose those flags - although it should be easy to do so if necessary in the future. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* nicira-ext: Fix typo in comment.Ben Pfaff2015-07-121-2/+2
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>