aboutsummaryrefslogtreecommitdiff
path: root/lib/meta-flow.h
AgeCommit message (Collapse)Author
2013-10-17ovs-dpctl: Add a 'filter' option to match wildcarded 'dump-flows'.Gurucharan Shetty
With mega-flows, many flows in the kernel datapath are wildcarded. For someone that is debugging a system and wants to find a particular flow and its actions, it is a little hard to zero-in on the flow because some fields are wildcarded. With the filter='$filter' option, we can now filter on the o/p of 'ovs-dpctl dump-flows'. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-10-15meta-flow: Add mf_mask_field_and_prereqs().Jarno Rajahalme
Sets mask bits for the given field and its prerequisite fields. Needed for unwildcarding the proper bits from datapath masks. Removed old prototype for mf_force_prereqs(). Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-08-27lib: Keep track of usable protocols while parsing.Jarno Rajahalme
Keep track of usable protocols while parsing actions and matches, rather than checking for them afterwards. This fixes silently discarded meter and goto table instructions when not explicitly specifying the protocol to use. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-08-22ofp-util: Add SCTP supportJoe Stringer
Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Joe Stringer <joe@wand.net.nz> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-08-13flow: Rename skb_mark to pkt_mark.Jesse Gross
The skb_mark field is currently only available with the Linux datapath and is only used internally. However, it is desirable to expose this through OpenFlow and when it is exposed ideally it would not be system- specific. In preparation for this, skb_mark is rename to pkt_mark in internal data structures for consistency. This does not rename the Linux interfaces because doing so would break the API. It would not necessarily be desirable to do anyways since in Linux-specific code it is clearer to use the actual name rather than a generic one. This can lead to confusion in some places, however, because we do not always strictly separate generic and platform dependent code (one example is actions). This seems inevitable though at this point if the lower and upper layers have different names (as they must given the above requirements). Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
2013-07-08ofp-parse: Do not exit() upon a parse error.Ben Pfaff
Until now, failure to parse a flow in the ofp-parse module has caused the program to abort immediately with a fatal error. This makes it hard to use these functions from any long-lived program. This commit fixes the problem. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-20meta-flow: Add MFF_IN_PORT_OXM, a 32-bit in_port.Jarno Rajahalme
This helps get rid of one special case in nx_pull_raw() and allows loading of 32-bit values from/to OXM_OF_IN_PORT in NXAST_LEARN actions. Previously the 16-bit limit acted the same on both NXM_OF_IN_PORT and OXM_OF_IN_PORT, even though OF1.1+ controllers would expect OXM_OF_IN_PORT to be 32 bits wide. Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-04-18Correctly implement the OpenFlow 1.2+ OXM_OF_IP_DSCP field.Ben Pfaff
NXM puts the DSCP value in bits 2-7 of NXM_OF_IP_TOS. OXM puts the DSCP value in bits 0-6 of OXM_OF_IP_DSCP. Before this commit, Open vSwitch incorrectly implemented OXM_OF_IP_DSCP with the same format as NXM_OF_IP_TOS. This commit fixes the problem and adds a test (previously missing but I don't know why). Reported-by: Hiroshi Miyata <miyahiro.dazu@gmail.com> Tested-by: Hiroshi Miyata <miyahiro.dazu@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-02-05User-Space MPLS actions and matchesSimon Horman
This patch implements use-space datapath and non-datapath code to match and use the datapath API set out in Leo Alterman's patch "user-space datapath: Add basic MPLS support to kernel". The resulting MPLS implementation supports: * Pushing a single MPLS label * Poping a single MPLS label * Modifying an MPLS lable using set-field or load actions that act on the label value, tc and bos bit. * There is no support for manipulating the TTL this is considered future work. The single-level push pop limitation is implemented by processing push, pop and set-field/load actions in order and discarding information that would require multiple levels of push/pop to be supported. e.g. push,push -> the first push is discarded pop,pop -> the first pop is discarded This patch is based heavily on work by Ravi K. Cc: Ravi K <rkerur@gmail.com> Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-12-18vswitchd: log skb_mark and skb_priorityAnsis Atteka
This patch adds logging support for skb_mark and skb_priority. Acked-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2012-11-21vswitchd: Log all tunnel parameters of given flow.Pravin B Shelar
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2012-09-12lib/ofp-actions: use mf_subvalue in struct ofpact_reg_load.Isaku Yamahata
Use a uninion mf_subvalue instead of a uint64_t for the value member of struct ofpact_reg_load. set_field action needs to hold values wider than 64 bits. This is preparation for set_field action. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-04classifier: Break cls_rule 'flow' and 'wc' members into new "struct match".Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-04flow: Use bit-mask for in_port match, instead of FWW_* flag.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-23OXM: Add VLAN VID as a prerequisite for VLAN PCPSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-23meta-flow: Add OF1.2-like MFF_VLAN_VID and MFF_VLAN_PCP.Ben Pfaff
OpenFlow 1.0 and 1.2 have notions of VLAN that are different enough to warrant separate "meta-flow" fields, which this commit adds. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Simon Horman <horms@verge.net.au>
2012-07-23meta-flow: Rename MFF_VLAN_VID->MFF_DL_VLAN, MFF_VLAN_PCP->MFF_DL_VLAN_PCP.Ben Pfaff
Giving these fields names that are the same as the OpenFlow 1.0 struct member names should help make it clear what they are for. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Simon Horman <horms@verge.net.au>
2012-07-12meta-flow: Remove mf_set_subfield and mf_set_subfieldSimon Horman
These functions do not appear to be used any more. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-27lib/meta-flow: introduce a macro, CASE_MFF_REGS, to catch "case MFF_REG<N>:"Isaku Yamahata
Introduce a macro instead for With this macro, the code is a bit reduced. test: compile-tested and unit tests passed. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> [blp@nicira.com moved the macro declaration, moved trailing colon from macro definition to invocation, adjusted style slightly] Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-26Add OXM_OF_METADATA field as a step toward OpenFlow 1.1 support.Joe Stringer
Signed-off-by: Joe Stringer <joe@wand.net.nz> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-26meta-flow: Accept NXM and OXM field names, support NXM and OXM for output.Ben Pfaff
This commit makes actions that accept NXM header values also accept OXM header values and accept OXM field names where previously only NXM field names were accepted. This makes it possible to add new OXM fields that don't have NXM header values, e.g. the OXM "metadata" field. Inspired by Joe Stringer's patch: http://openvswitch.org/pipermail/dev/2012-June/018344.html Reported-by: Joe Stringer <joe@wand.net.nz> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-12Allow general masking of IPv6 addresses rather than just CIDR masks.Ben Pfaff
OF1.2 and later make these fields fully maskable so we might as well also. Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-29flow: Adds support for arbitrary ethernet maskingJoe Stringer
Arbitrary ethernet mask support is one step on the way to support for OpenFlow 1.1+. This patch set seeks to add this capability without breaking current protocol support. Signed-off-by: Joe Stringer <joe@wand.net.nz> [blp@nicira.com made some updates, see http://openvswitch.org/pipermail/dev/2012-May/017585.html] Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-07ofp-parse: New function parse_ofp_exact_flow().Ben Pfaff
This function parses a flow rather than a cls_rule. It will be useful for "ofproto/trace", which currently requires an odp_flow and thus can't accept values for registers and other concepts that don't exist in the kernel. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02Global replace of Nicira Networks.Raju Subramanian
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-25Add OXM data to mf_fieldsSimon Horman
Add oxm_name and oxm_header elements to struct mf_field and populate those entries for fields that are present in both NXM and the OXM basic class. This implementation was suggested by Ben Pfaff. This does not address any possible differences in the NXM and OXM basic class fields, for instance different maskability. That may be addressed later as needed. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-13meta-flow: New functions for reading and writing generalized subfields.Ben Pfaff
The existing functions for reading and writing the values of subfields only handle subfields up to 64 bits wide. These new functions handle subfields of any width. Also update some existing comments. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-09nicira-ext: Increase the number of NXM registers to 8.Ethan Jackson
Requested-by: Amar Padmanabhan <amar@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-02-01meta-flow: New "subfield" data structure.Ben Pfaff
Until now, parts of a field have been dealt with in a fairly ad-hoc way. struct mf_subfield and the supporting functions added by this commit make their use more systematic. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-11-21nx-match: Fold all of its data structures into mf_field.Ben Pfaff
This is less redundant.
2011-11-21meta-flow: Split ICMP into ICMPv4 and ICMPv6.Ben Pfaff
NXM breaks ICMP into v4 and v6. An upcoming commit will drop all of the NXM specific data in favor of mf_field, and so at that point we need to have a separate mf_field for each NXM field. So, this commit splits ICMP into v4 and v6 for meta-flow also.
2011-11-09Support matching and modifying IP TTL.Justin Pettit
Add support matching the IPv4 TTL and IPv6 hop limit fields. This commit also adds support for modifying the IPv4 TTL. Modifying the IPv6 hop limit isn't currently supported, since we don't support modifying IPv6 headers. We will likely want to change the user-space interface, since basic matching and setting the TTL are not generally useful. We will probably want the ability to match on extraordinary events (such as TTL of 0 or 1) and a decrement action. Feature #8024 Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-09Support matching and modifying IP ECN bits.Justin Pettit
Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-09Support matching IPv6 flow label.Justin Pettit
Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-04meta-flow: Update mf_field description of size.Justin Pettit
Commit 7257b5 (Implement new fragment handling policy.) added a new "is_frag" meta-field that used fewer bits than the width of the field. A comment in mf_field lists these cases, but "is_frag" wasn't included. This commit updates that.
2011-11-01Fix build on FreeBSD.Edward Tomasz NapieraƂa
Patch below fixes build on FreeBSD; tested on 10.0-CURRENT. Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-10-21Implement new fragment handling policy.Ben Pfaff
Until now, OVS has handled IP fragments more awkwardly than necessary. It has not been possible to match on L4 headers, even in fragments with offset 0 where they are actually present. This means that there was no way to implement ACLs that treat, say, different TCP ports differently, on fragmented traffic; instead, all decisions for fragment forwarding had to be made on the basis of L2 and L3 headers alone. This commit improves the situation significantly. It is still not possible to match on L4 headers in fragments with nonzero offset, because that information is simply not present in such fragments, but this commit adds the ability to match on L4 headers for fragments with zero offset. This means that it becomes possible to implement ACLs that drop such "first fragments" on the basis of L4 headers. In practice, that effectively blocks even fragmented traffic on an L4 basis, because the receiving IP stack cannot reassemble a full packet when the first fragment is missing. This commit works by adding a new "fragment type" to the kernel flow match and making it available through OpenFlow as a new NXM field named NXM_NX_IP_FRAG. Because OpenFlow 1.0 explicitly says that the L4 fields are always 0 for IP fragments, it adds a new OpenFlow fragment handling mode that fills in the L4 fields for "first fragments". It also enhances ovs-ofctl to allow users to configure this new fragment handling mode and to parse the new field. Signed-off-by: Ben Pfaff <blp@nicira.com> Bug #7557.
2011-10-04nicira-ext: Bump number of registers to five from four.Justin Pettit
Feature #7527
2011-09-13meta-flow: New library for working with fields by id.Ben Pfaff
OVS already has a fairly good set of functions for working with fields that are known at compile time, but support for working with fields that are known only at runtime is fairly limited (and fairly unneeded). However, with NXM identifiers becoming more and more widely used throughout Nicira extensions, it's becoming corresponding more and more common to need to refer to fields at runtime. This new library represents a first attempt at a systematic approach for doing so.