summaryrefslogtreecommitdiff
path: root/include/openflow
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2015-06-02 15:11:00 -0700
committerJesse Gross <jesse@nicira.com>2015-06-25 11:08:58 -0700
commit6159c531d09a19f5eb6865fc5221c04156aa0bf4 (patch)
tree406926cec3ff3b727a4924e768053047607692fa /include/openflow
parent00fe22f85baf76f5a4dca0312d4a7d7c920065af (diff)
downloadopenvswitch-6159c531d09a19f5eb6865fc5221c04156aa0bf4.tar.gz
openflow: Table maintenance commands for Geneve options.
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>
Diffstat (limited to 'include/openflow')
-rw-r--r--include/openflow/nicira-ext.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h
index e74945090..22325aa40 100644
--- a/include/openflow/nicira-ext.h
+++ b/include/openflow/nicira-ext.h
@@ -900,4 +900,74 @@ struct nx_flow_monitor_cancel {
};
OFP_ASSERT(sizeof(struct nx_flow_monitor_cancel) == 4);
+/* Geneve option table maintainance commands.
+ *
+ * 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.
+ *
+ * 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. */
+
+/* Geneve table commands */
+enum nx_geneve_table_mod_command {
+ NXGTMC_ADD, /* New mappings (fails if an option is already
+ mapped). */
+ NXGTMC_DELETE, /* Delete mappings, identified by index
+ * (unmapped options are ignored). */
+ NXGTMC_CLEAR, /* Clear all mappings. Additional information
+ in this command is ignored. */
+};
+
+/* Map between a Geneve option and an NXM field. */
+struct nx_geneve_map {
+ ovs_be16 option_class; /* Geneve option class. */
+ uint8_t option_type; /* Geneve option type. */
+ uint8_t option_len; /* Geneve option length (multiple of 4). */
+ ovs_be16 index; /* NXM_NX_TUN_METADATA<n> index */
+ uint8_t pad[2];
+};
+OFP_ASSERT(sizeof(struct nx_geneve_map) == 8);
+
+/* NXT_GENEVE_TABLE_MOD.
+ *
+ * Use to configure a mapping between Geneve options (class, type, length)
+ * and NXM fields (NXM_NX_TUN_METADATA<n> where 'index' is <n>).
+ *
+ * This command is atomic: all operations on different options will
+ * either succeed or fail. */
+struct nx_geneve_table_mod {
+ ovs_be16 command; /* One of NTGTMC_* */
+ uint8_t pad[6];
+ /* struct nx_geneve_map[0]; Array of maps between indicies and Geneve
+ options. The number of elements is
+ inferred from the length field in the
+ header. */
+};
+OFP_ASSERT(sizeof(struct nx_geneve_table_mod) == 8);
+
+/* NXT_GENEVE_TABLE_REPLY.
+ *
+ * Issued in reponse to an NXT_GENEVE_TABLE_REQUEST to give information
+ * about the current status of the Geneve table in the switch. Provides
+ * both static information about the switch's capabilities as well as
+ * the configured Geneve option table. */
+struct nx_geneve_table_reply {
+ ovs_be32 max_option_space; /* Maximum total of option sizes supported. */
+ ovs_be16 max_fields; /* Maximum number of match fields supported. */
+ uint8_t pad[2];
+ /* struct nx_geneve_map[0]; Array of maps between indicies and Geneve
+ options. The number of elements is
+ inferred from the length field in the
+ header. */
+};
+OFP_ASSERT(sizeof(struct nx_geneve_table_reply) == 8);
+
#endif /* openflow/nicira-ext.h */