summaryrefslogtreecommitdiff
path: root/lib/ofp-util.c
Commit message (Collapse)AuthorAgeFilesLines
* Add support for connection tracking.Joe Stringer2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new action and fields to OVS that allow connection tracking to be performed. This support works in conjunction with the Linux kernel support merged into the Linux-4.3 development cycle. Packets have two possible states with respect to connection tracking: Untracked packets have not previously passed through the connection tracker, while tracked packets have previously been through the connection tracker. For OpenFlow pipeline processing, untracked packets can become tracked, and they will remain tracked until the end of the pipeline. Tracked packets cannot become untracked. Connections can be unknown, uncommitted, or committed. Packets which are untracked have unknown connection state. To know the connection state, the packet must become tracked. Uncommitted connections have no connection state stored about them, so it is only possible for the connection tracker to identify whether they are a new connection or whether they are invalid. Committed connections have connection state stored beyond the lifetime of the packet, which allows later packets in the same connection to be identified as part of the same established connection, or related to an existing connection - for instance ICMP error responses. The new 'ct' action transitions the packet from "untracked" to "tracked" by sending this flow through the connection tracker. The following parameters are supported initally: - "commit": When commit is executed, the connection moves from uncommitted state to committed state. This signals that information about the connection should be stored beyond the lifetime of the packet within the pipeline. This allows future packets in the same connection to be recognized as part of the same "established" (est) connection, as well as identifying packets in the reply (rpl) direction, or packets related to an existing connection (rel). - "zone=[u16|NXM]": Perform connection tracking in the zone specified. Each zone is an independent connection tracking context. When the "commit" parameter is used, the connection will only be committed in the specified zone, and not in other zones. This is 0 by default. - "table=NUMBER": Fork pipeline processing in two. The original instance of the packet will continue processing the current actions list as an untracked packet. An additional instance of the packet will be sent to the connection tracker, which will be re-injected into the OpenFlow pipeline to resume processing in the specified table, with the ct_state and other ct match fields set. If the table is not specified, then the packet is submitted to the connection tracker, but the pipeline does not fork and the ct match fields are not populated. It is strongly recommended to specify a table later than the current table to prevent loops. When the "table" option is used, the packet that continues processing in the specified table will have the ct_state populated. The ct_state may have any of the following flags set: - Tracked (trk): Connection tracking has occurred. - Reply (rpl): The flow is in the reply direction. - Invalid (inv): The connection tracker couldn't identify the connection. - New (new): This is the beginning of a new connection. - Established (est): This is part of an already existing connection. - Related (rel): This connection is related to an existing connection. For more information, consult the ovs-ofctl(8) man pages. Below is a simple example flow table to allow outbound TCP traffic from port 1 and drop traffic from port 2 that was not initiated by port 1: table=0,priority=1,action=drop table=0,arp,action=normal table=0,in_port=1,tcp,ct_state=-trk,action=ct(commit,zone=9),2 table=0,in_port=2,tcp,ct_state=-trk,action=ct(zone=9,table=1) table=1,in_port=2,ct_state=+trk+est,tcp,action=1 table=1,in_port=2,ct_state=+trk+new,tcp,action=drop Based on original design by Justin Pettit, contributions from Thomas Graf and Daniele Di Proietto. Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* openflow-common: Correct Netronome vendor ID.Simon Horman2015-09-301-0/+1
| | | | | | | | | 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/+120
| | | | | | | | | | | | | 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>
* tunnel: Support matching on the presence of Geneve options.Jesse Gross2015-08-281-2/+1
| | | | | | | | | | | | | | | | | | | | | Sometimes it is useful to match only on whether a Geneve option is present even if the specific value is unimportant. A special case of this is zero length options where there is no value at all and the only information conveyed is whether the option was included in the packet. This operation was partially supported before but it was not consistent - in particular, options were never serialized through NXM/OXM unless they had a non-zero mask. Furthermore, zero length options were rejected altogether when they were installed through the Geneve map OpenFlow command. This adds support for these types of matches by making any NXM/OXM for tunnel metadata force a match on that field. In the case of a zero length option, both the value and mask of the NXM are ignored. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* userspace: Define and use struct eth_addr.Jarno Rajahalme2015-08-281-42/+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>
* ofp-util: For OF1.0, don't wildcard PCP field when 802.1Q header absent.Ben Pfaff2015-08-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | OpenFlow 1.0.1 says: The dl_vlan_pcp field must be ignored when the OFPFW_DL_VLAN wildcard bit is set or when the dl_vlan value is set to OFP_VLAN_NONE. Fields that are ignored don’t need to be wildcarded and should be set to 0. Previously, OVS wildcarded the PCP field when dl_vlan was OFP_VLAN_NONE, but this commit changes the behavior to that suggested above: the PCP field should not be wildcarded (and should be set to 0, but the code already did that). This commit only changes the translation from OVS's internal flow format to the OpenFlow 1.0 wire format. Translation in the other direction and to other formats is unaffected. Found by OFTest. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* ofp-util: Use correct error for indirect group with more than one bucket.Ben Pfaff2015-08-191-1/+1
| | | | | | | | | | | | | | | | | OpenFlow 1.5 says: If the group-mod request specifies more than one bucket for a group of type Indirect, the switch must refuse to add the group entry and must send an ofp_error_msg with OFPET_GROUP_MOD_FAILED type and OFPGMFC_INVALID_GROUP code. Older versions don't specify a particular error for this case, so we might as well use it for older OpenFlow also. Found by OFTest. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* ofp-util: Fix group desc request encoding.Minoru TAKAHASHI2015-07-311-4/+5
| | | | | Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-util: Fix port desc request encoding.Minoru TAKAHASHI2015-07-311-6/+5
| | | | | Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Fix treatment of OpenFlow 1.1+ bucket weights.Ben Pfaff2015-07-291-4/+9
| | | | | | | | | | | | | | | | | | | | | | | Until now, OVS has parsed all OF1.1+ group buckets that lack a weight as having weight 1. Unfortunately, OpenFlow says that only "select" groups may have a nonzero weight, and requires reporting an error for other kinds of groups that have a nonzero weight. This commit fixes the problem by parsing only select groups with a default weight of 1 and other groups with a default weight of 0. It also adds the OpenFlow-required check for nonzero weights for other kinds of groups. This complies with OpenFlow 1.1 and later. OF1.1 says in section 5.8: If a specified group type is invalid (ie: includes fields such as weight that are undefined for the specified group type) then the switch must refuse to add the group entry and must send an ofp_error_msg with OFPET_GROUP_MOD_FAILED type and OFPGMFC_INVALID_GROUP code. Found by OFTest. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Flavio Leitner <fbl@sysclose.org>
* ofproto: Implement OF1.4 Set/Get asynchronous configuration messages.Niti Rohilla2015-07-271-0/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ofp-util: Allow out-of-range indexes in ofputil_decode_geneve_table_reply().Ben Pfaff2015-07-191-5/+13
| | | | | | | | | | | | Otherwise, if some future version of OVS supports more Geneve options than the current version, and any of these extras are in use, then one would be unable to dump them with "ovs-ofctl dump-geneve-map", and any other OVS-based software that wants to dump the Geneve map to work with the existing options (i.e. ovn-controller) would fail entirely, instead of being able to work with at least a subset. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* tunneling: Allow matching and setting tunnel 'OAM' flag.Jesse Gross2015-07-151-1/+1
| | | | | | | | | | | | | | | | | 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>
* ofp-util: Log the type of an invalid message being added to a bundle.Ben Pfaff2015-07-061-0/+2
| | | | | | | This makes troubleshooting easier. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* ofp-util: Require inner and outer message in bundle add to be same version.Ben Pfaff2015-07-061-0/+3
| | | | | | | | It doesn't make sense for the messages added to a bundle to have a different OpenFlow version from the outer OpenFlow version. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* Implement OpenFlow 1.4+ OFPMP_TABLE_DESC message.Ben Pfaff2015-07-031-0/+135
| | | | | | | 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>
* Implement OpenFlow 1.4+ OFPTC_EVICTION.Ben Pfaff2015-07-031-56/+164
| | | | | | | | | | | | | | | | | | 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>
* ofp-util: Fix typo in comment.Ben Pfaff2015-07-021-1/+1
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* tunnel: Geneve TLV handling support for OpenFlow.Jesse Gross2015-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current support for Geneve in OVS is exactly equivalent to VXLAN: it is possible to set and match on the VNI but not on any options contained in the header. This patch enables the use of options. The goal for Geneve support is not to add support for any particular option but to allow end users or controllers to specify what they would like to match. That is, the full range of Geneve's capabilities should be exposed without modifying the code (the one exception being options that require per-packet computation in the fast path). The main issue with supporting Geneve options is how to integrate the fields into the existing OpenFlow pipeline. All existing operations are referred to by their NXM/OXM field name - matches, action generation, arithmetic operations (i.e. tranfer to a register). However, the Geneve option space is exactly the same as the OXM space, so a direct mapping is not feasible. Instead, we create a pool of 64 NXMs that are then dynamically mapped on Geneve option TLVs using OpenFlow. Once mapped, these fields become first-class citizens in the OpenFlow pipeline. An example of how to use Geneve options: ovs-ofctl add-geneve-map br0 {class=0xffff,type=0,len=4}->tun_metadata0 ovs-ofctl add-flow br0 in_port=LOCAL,actions=set_field:0xffffffff->tun_metadata0,1 This will add a 4 bytes option (filled will all 1's) to all packets coming from the LOCAL port and then send then out to port 1. A limitation of this patch is that although the option table is specified for a particular switch over OpenFlow, it is currently global to all switches. This will be addressed in a future patch. Based on work originally done by Madhu Challa. Ben Pfaff also significantly improved the comments. Signed-off-by: Madhu Challa <challa@noironetworks.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* openflow: Table maintenance commands for Geneve options.Jesse Gross2015-06-251-0/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to work with Geneve options, we need to maintain a mapping table between an option (defined by <class, type, length>) and an NXM field that can be operated on for the purposes of matches, actions, etc. This mapping must be explicitly specified by the user. Conceptually, this table could be communicated using either OpenFlow or OVSDB. Using OVSDB requires less code and definition of extensions than OpenFlow but introduces the possibility that mapping table updates and flow modifications are desynchronized from each other. This is dangerous because the mapping table signifcantly impacts the way that flows using Geneve options are installed and processed by OVS. Therefore, the mapping table is maintained using OpenFlow commands instead, which opens the possibility of using synchronization between table changes and flow modifications through barriers, bundles, etc. There are two primary groups of OpenFlow messages that are introduced as Nicira extensions: modification commands (add, delete, clear mappings) and table status request/reply to dump the current table along with switch information. Note that mappings should not be changed while they are in active use by a flow. The result of doing so is undefined. This only adds the OpenFlow infrastructure but doesn't actually do anything with the information yet after the messages have been decoded. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-ofctl: Add bundle support and unit testing.Jarno Rajahalme2015-06-101-0/+30
| | | | | | | | | | | | | | | | | | | | | | | All existing ovs-ofctl flow mod commands now take an optional '--bundle' argument, which executes the flow mods as a single transaction. OpenFlow 1.4+ is implicitly assumed when '--bundle' is specified. ovs-ofctl 'add-flow' and 'add-flows' commands now accept flow specifications that start with an optional 'add', 'modify', 'delete', 'modify_strict', or 'delete_strict' keyword, so that arbitrary flow table modifications may be specified. For backwards compatibility, a missing keyword is treated as an 'add'. With the new '--bundle' option all the modifications are executed as a single transaction using an OpenFlow 1.4 bundle. OpenFlow 1.4 requires bundles to support at least flow and port mods. This implementation does not yet support port mods in bundles. Another restriction is that the atomic transactions are not yet supported. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofp-util: Convert flow_metadata to match structure.Jesse Gross2015-06-081-80/+20
| | | | | | | | | | | | | | | | | | | | | | | | We have a special flow_metadata structure to represent the parts of a packet that aren't carried in the payload itself. This is used in the case where we need to send the packet as a Packet In to an OpenFlow controller. This is a subset of the more general struct flow. In practice, almost all operations we do on this structure involve converting it to or from a match or have code that is the same as a match. Serialization to NXM and back is done as a match. There is special flow_metadata formatting code that is almost identical to match formatting. The uses for struct flow_metadata aren't performance critical when it comes to memory, so we can save quite a bit of code by just using a match structure directly instead. In addition, as metadata increases and becomes more complex (Geneve options require some special handling beyond just additional fields), using the match structure means we only have to do this work in one place. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofproto: Add support for reverting flow mods and bundle commit.Jarno Rajahalme2015-06-011-0/+8
| | | | Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* bundles: Validate bundled messages.Jarno Rajahalme2015-06-011-3/+7
| | | | | | | | OpenFlow bundle messages should be decoded and validated at the time they are added to the bundle. This commit does this for flow mod and port mod messages. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofp-util: Fix xid in ofputil_encode_bundle_add().Jarno Rajahalme2015-06-011-1/+3
| | | | | | Bundle add must use the same xid as the embedded message. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofp-util: Use OFPGMFC_OUT_OF_BUCKETS for indirect groups with !=1 buckets.Ben Pfaff2015-05-081-1/+1
| | | | | | | | | | | | | | | | | | OpenFlow 1.3 says: If a switch cannot add the incoming group entry due to restrictions (hardware or otherwise) limiting the number of group buckets, it must refuse to add the group entry and must send an ofp_error_msg with OFPET_GROUP_MOD_FAILED type and OFPGMFC_OUT_OF_BUCKETS code. This indicates that OFPGMFC_OUT_OF_BUCKETS is appropriate for an indirect group with the wrong number of buckets, but OVS was using a different error. This fixes the problem. ONF-JIRA: EXT-546 Reported-by: Mrinmoy Das <mrdas@ixiacom.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* ofp-util: Add missing 'break;' in bad_group_cmd().Ben Pfaff2015-04-211-2/+4
| | | | | | | | | | | | | | | | Otherwise you get an assertion failure in place of a helpful error message. Also fix typo where the "remove-bucket" command was output as "insert-bucket". Also fix a nearby style violation and add a pair of tests to prevent regression. Found by LLVM scan-build. Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* lib/list: Add LIST_FOR_EACH_POP.Jarno Rajahalme2015-04-061-3/+2
| | | | | | | | Makes popping each member of the list a bit easier. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Implement hash fields select groupSimon Horman2015-03-241-8/+5
| | | | | | | | | | This is intended as a usable demonstration of how the NTR selection method extension might may be used. NTR selection method Signed-off-by: Simon Horman <simon.horman@netronome.com> [blp@nicira.com added a NEWS entry] Signed-off-by: Ben Pfaff <blp@nicira.com>
* Support encoding of NTR selection methodSimon Horman2015-03-241-0/+31
| | | | | | | | | Include NTR selection method experimenter group property in in group mod request and group desc reply. NTR selection method Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Support decoding of NTR selection methodSimon Horman2015-03-241-8/+241
| | | | | | | | | | | | | This is in preparation for supporting group mod and desc reply messages with an NTR selection method group experimenter property. Currently decoding always fails as it only allows properties for known selection methods and no selection methods are known yet. A subsequent patch will propose a hash selection method. NTR selection method Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofpbuf: Simplify ofpbuf API.Pravin B Shelar2015-03-031-189/+185
| | | | | | | | | | | | ofpbuf was complicated due to its wide usage across all layers of OVS, Now we have introduced independent dp_packet which can be used for datapath packet, we can simplify ofpbuf. Following patch removes DPDK mbuf and access API of ofpbuf members. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ofproto: Add NXM_NX_TUN_GBP_ID and NXM_NX_TUN_GBP_FLAGSMadhu Challa2015-02-141-1/+9
| | | | | | | | | | | | | | | | | | | Introduces two new NXMs to represent VXLAN-GBP [0] fields. actions=load:0x10->NXM_NX_TUN_GBP_ID[],NORMAL tun_gbp_id=0x10,actions=drop This enables existing VXLAN tunnels to carry security label information such as a SELinux context to other network peers. The values are carried to/from the datapath using the attribute OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS. [0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy-00 Signed-off-by: Madhu Challa <challa@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
* ofp-util: Issue error when OFPGC_DELETE command includes buckets.Ben Pfaff2015-02-031-2/+13
| | | | | | | | | An OFPGC_DELETE command deletes a whole group, including all of its buckets, and so it doesn't make sense for the command itself to include any specification of buckets. ONF-JIRA: EXT-510 Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-util: constify buckets parameter of ofputil_append*_group_desc_reply()Simon Horman2015-01-271-3/+3
| | | | | | | This parameter is not modified so it may be marked as const. Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
* classifier: Add support for conjunctive matches.Ben Pfaff2015-01-111-2/+2
| | | | | | | | | | A "conjunctive match" allows higher-level matches in the flow table, such as set membership matches, without causing a cross-product explosion for multidimensional matches. Please refer to the documentation that this commit adds to ovs-ofctl(8) for a better explanation, including an example. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* miniflow: Use 64-bit data.Jarno Rajahalme2015-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far the compressed flow data in struct miniflow has been in 32-bit words with a 63-bit map, allowing for a maximum size of struct flow of 252 bytes. With the forthcoming Geneve options this is not sufficient any more. This patch solves the problem by changing the miniflow data to 64-bit words, doubling the flow max size to 504 bytes. Since the word size is doubled, there is some loss in compression efficiency. To counter this some of the flow fields have been reordered to keep related fields together (e.g., the source and destination IP addresses share the same 64-bit word). This change should speed up flow data processing on 64-bit CPUs, which may help counterbalance the impact of making the struct flow bigger in the future. Classifier lookup stage boundaries are also changed to 64-bit alignment, as the current algorithm depends on each miniflow word to not be split between ranges. This has resulted in new padding (part of the 'mpls_lse' field). The 'dp_hash' field is also moved to packet metadata to eliminate otherwise needed padding there. This allows the L4 to fit into one 64-bit word, and also makes matches on 'dp_hash' more efficient as misses can be found already on stage 1. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* bundles: Reject unbundlable messages.Jarno Rajahalme2014-12-221-0/+100
| | | | | | | Reject bundle add messages containing messages that should not be bundled. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* OF1.4 bundles: Verify xids.Jarno Rajahalme2014-12-221-0/+3
| | | | | | | A switch may optionally verify that the 'xid' of an added message is the same as the 'xid' of the bundle add message itself. Do it. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lib: Move vlog.h to <openvswitch/vlog.h>Thomas Graf2014-12-151-1/+1
| | | | | | | | A new function vlog_insert_module() is introduced to avoid using list_insert() from the vlog.h header. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* list: Rename struct list to struct ovs_listThomas Graf2014-12-151-25/+25
| | | | | | | struct list is a common name and can't be used in public headers. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lib: Move compiler.h to <openvswitch/compiler.h>Thomas Graf2014-12-151-1/+1
| | | | | | | | | | The following macros are renamed to avoid conflicts with other headers: * WARN_UNUSED_RESULT to OVS_WARN_UNUSED_RESULT * PRINTF_FORMAT to OVS_PRINTF_FORMAT * NO_RETURN to OVS_NO_RETURN Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* openflow: Use *_array_len names in struct ofp15_bucket and ofp15_group_modSimon Horman2014-11-251-4/+4
| | | | | | | | | | | | The spec has been clarified to use _list_len in palce of _list_len terminology to make it clearer that the data is not an ordered list (it is a set). The code present in Open vSwitch already avoided the _list_len terminology. This change brings the code into line with the updated spec. ONF-JIRA: EXT-350 Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-util.c: Enable packet-in messages for OpenFlow 1.4 and 1.5.Jean Tourrilhes2014-11-211-2/+2
| | | | | | Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com> [blp@nicira.com added simple test] Signed-off-by: Ben Pfaff <blp@nicira.com>
* openflow: Add OpenFlow 1.4 packet-in reasons.Shu Shen2014-11-131-0/+6
| | | | | Signed-off-by: Shu Shen <shu.shen@radisys.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Fix misspellings of "OpenFlow".Ben Pfaff2014-11-121-5/+5
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Flavio Leitner <fbl@redhat.com>
* ofp-util: Provide bucket list helper functionsSimon Horman2014-11-121-0/+82
| | | | | | | | | | | This is in preparation for supporting the bucket commands of (draft) Open Flow 1.5 group mod messages. Also document ofputil_bucket_check_duplicate_id() for good measure. ONF-JIRA: EXT-350 Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-util: Enhance error logging during encoding group mod messages.Simon Horman2014-11-121-12/+59
| | | | | | | | | In preparation for supporting (draft) OpenFlow 1.5 group mod commands enhance the error logging of them. ONF-JIRA: EXT-350 Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-util: Do not allow buckets for OFPGC15_REMOVE_BUCKET.Simon Horman2014-11-121-0/+15
| | | | | | ONF-JIRA: EXT-350 Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-util: Encoding and decoding of (draft) OpenFlow 1.5 group messages.Simon Horman2014-11-111-4/+452
| | | | | | | | | | | | | | | | This provides the bulk of the ofproto side of support for OpenFlow 1.5 group messages. It provides for encoding and decoding of updated group mod and group desc reply messages. This includes a new bucket format and their properties. Open Flow 1.5 Groups also have properties but as no non-experimenter properties are defined this patch does not provide parsing or encoding of group properties. ONF-JIRA: EXT-350 Signed-off-by: Simon Horman <simon.horman@netronome.com> [blp@nicira.com fixed minor bugs and style issues] Signed-off-by: Ben Pfaff <blp@nicira.com>