summaryrefslogtreecommitdiff
path: root/lib/nx-match.h
diff options
context:
space:
mode:
authorJesse Gross <jesse@kernel.org>2016-04-19 18:36:04 -0700
committerJesse Gross <jesse@kernel.org>2016-09-19 09:52:22 -0700
commit8d8ab6c2d5743eb229a5e7c27ccd963a2c103adb (patch)
treed198a78ddf968ab119e029ca998eba2337812cd8 /lib/nx-match.h
parent56fb20c4a1622c0f19bd2865c6688bdc78d5b40f (diff)
downloadopenvswitch-8d8ab6c2d5743eb229a5e7c27ccd963a2c103adb.tar.gz
tun-metadata: Manage tunnel TLV mapping table on a per-bridge basis.
When using tunnel TLVs (at the moment, this means Geneve options), a controller must first map the class and type onto an appropriate OXM field so that it can be used in OVS flow operations. This table is managed using OpenFlow extensions. The original code that added support for TLVs made the mapping table global as a simplification. However, this is not really logically correct as the OpenFlow management commands are operating on a per-bridge basis. This removes the original limitation to make the table per-bridge. One nice result of this change is that it is generally clearer whether the tunnel metadata is in datapath or OpenFlow format. Rather than allowing ad-hoc format changes and trying to handle both formats in the tunnel metadata functions, the format is more clearly separated by function. Datapaths (both kernel and userspace) use datapath format and it is not changed during the upcall process. At the beginning of action translation, tunnel metadata is converted to OpenFlow format and flows and wildcards are translated back at the end of the process. As an additional benefit, this change improves performance in some flow setup situations by keeping the tunnel metadata in the original packet format in more cases. This helps when copies need to be made as the amount of data touched is only what is present in the packet rather than the maximum amount of metadata supported. Co-authored-by: Madhu Challa <challa@noironetworks.com> Signed-off-by: Madhu Challa <challa@noironetworks.com> Signed-off-by: Jesse Gross <jesse@kernel.org> Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/nx-match.h')
-rw-r--r--lib/nx-match.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/nx-match.h b/lib/nx-match.h
index c366a04cc..a86cceb38 100644
--- a/lib/nx-match.h
+++ b/lib/nx-match.h
@@ -50,13 +50,18 @@ char *mf_parse_subfield(struct mf_subfield *, const char *s)
/* Decoding matches. */
enum ofperr nx_pull_match(struct ofpbuf *, unsigned int match_len,
struct match *,
- ovs_be64 *cookie, ovs_be64 *cookie_mask);
+ ovs_be64 *cookie, ovs_be64 *cookie_mask,
+ const struct tun_table *);
enum ofperr nx_pull_match_loose(struct ofpbuf *, unsigned int match_len,
struct match *, ovs_be64 *cookie,
- ovs_be64 *cookie_mask);
-enum ofperr oxm_pull_match(struct ofpbuf *, struct match *);
-enum ofperr oxm_pull_match_loose(struct ofpbuf *, struct match *);
-enum ofperr oxm_decode_match(const void *, size_t, struct match *);
+ ovs_be64 *cookie_mask,
+ const struct tun_table *);
+enum ofperr oxm_pull_match(struct ofpbuf *, const struct tun_table *,
+ struct match *);
+enum ofperr oxm_pull_match_loose(struct ofpbuf *, const struct tun_table *,
+ struct match *);
+enum ofperr oxm_decode_match(const void *, size_t, const struct tun_table *,
+ struct match *);
enum ofperr oxm_pull_field_array(const void *, size_t fields_len,
struct field_array *);