summaryrefslogtreecommitdiff
path: root/include/openvswitch
diff options
context:
space:
mode:
authorVasu Dasari <vdasari@gmail.com>2021-12-08 18:05:23 -0500
committerIlya Maximets <i.maximets@ovn.org>2022-04-28 21:27:11 +0200
commitc3e64047d1ccfd8beaedf6e2fe997afa529d293a (patch)
tree2b7fcd11199ee43dfd94594bbabab234dcceca39 /include/openvswitch
parentd8ab75cd69c6eee136636c75f5c8aa6bcd8d7a53 (diff)
downloadopenvswitch-c3e64047d1ccfd8beaedf6e2fe997afa529d293a.tar.gz
ofp-monitor: Support flow monitoring for OpenFlow 1.3, 1.4+.
Extended OpenFlow monitoring support * OpenFlow 1.3 with ONF extensions * OpenFlow 1.4+ as defined in OpenFlow specification 1.4+. ONF extensions are similar to Nicira extensions except for onf_flow_monitor_request{} where out_port is defined as 32-bit number OF(1.1) number, oxm match formats are used in update and request messages. Flow monitoring support in 1.4+ is slightly different from Nicira and ONF extensions. * More flow monitoring flags are defined. * Monitor add/modify/delete command is introduced in flow_monitor request message. * Addition of out_group as part of flow_monitor request message Description of changes: 1. Generate ofp-msgs.inc to be able to support 1.3, 1.4+ flow Monitoring messages. include/openvswitch/ofp-msgs.h 2. Modify openflow header files with protocol specific headers. include/openflow/openflow-1.3.h include/openflow/openflow-1.4.h 3. Modify OvS abstraction of openflow headers. ofp-monitor.h leverages enums from on nicira extensions for creating protocol abstraction headers. OF(1.4+) enums are superset of nicira extensions. include/openvswitch/ofp-monitor.h 4. Changes to these files reflect encoding and decoding of new protocol messages. lib/ofp-monitor.c 5. Changes to modules using ofp-monitor APIs. Most of the changes here are to migrate enums from nicira to OF 1.4+ versions. ofproto/connmgr.c ofproto/connmgr.h ofproto/ofproto-provider.h ofproto/ofproto.c 6. Extended protocol decoding tests to verify all protocol versions FLOW_MONITOR_CANCEL FLOW_MONITOR_PAUSED FLOW_MONITOR_RESUMED FLOW_MONITOR request FLOW_MONITOR reply tests/ofp-print.at 7. Modify flow monitoring tests to be able executed by all protocol versions. tests/ofproto.at 7. Modified documentation highlighting the change utilities/ovs-ofctl.8.in NEWS Signed-off-by: Vasu Dasari <vdasari@gmail.com> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2021-June/383915.html Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'include/openvswitch')
-rw-r--r--include/openvswitch/ofp-monitor.h9
-rw-r--r--include/openvswitch/ofp-msgs.h39
2 files changed, 34 insertions, 14 deletions
diff --git a/include/openvswitch/ofp-monitor.h b/include/openvswitch/ofp-monitor.h
index 835efd0f3..7c7cfcff4 100644
--- a/include/openvswitch/ofp-monitor.h
+++ b/include/openvswitch/ofp-monitor.h
@@ -61,8 +61,10 @@ void ofputil_flow_removed_format(struct ds *,
/* Abstract nx_flow_monitor_request. */
struct ofputil_flow_monitor_request {
uint32_t id;
- enum nx_flow_monitor_flags flags;
+ enum ofp14_flow_monitor_command command;
+ enum ofp14_flow_monitor_flags flags;
ofp_port_t out_port;
+ uint32_t out_group;
uint8_t table_id;
struct match match;
};
@@ -85,7 +87,7 @@ char *parse_flow_monitor_request(struct ofputil_flow_monitor_request *,
/* Abstract nx_flow_update. */
struct ofputil_flow_update {
- enum nx_flow_update_event event;
+ enum ofp_flow_update_event event;
/* Used only for NXFME_ADDED, NXFME_DELETED, NXFME_MODIFIED. */
enum ofp_flow_removed_reason reason;
@@ -119,6 +121,9 @@ uint32_t ofputil_decode_flow_monitor_cancel(const struct ofp_header *);
struct ofpbuf *ofputil_encode_flow_monitor_cancel(
uint32_t id, enum ofputil_protocol protocol);
+struct ofpbuf * ofputil_encode_flow_monitor_pause(
+ enum ofp_flow_update_event command, enum ofputil_protocol protocol);
+
struct ofputil_requestforward {
ovs_be32 xid;
/* Also used for OF 1.0-1.3 when using Nicira Extension: */
diff --git a/include/openvswitch/ofp-msgs.h b/include/openvswitch/ofp-msgs.h
index c5fde0270..921a937e5 100644
--- a/include/openvswitch/ofp-msgs.h
+++ b/include/openvswitch/ofp-msgs.h
@@ -453,14 +453,33 @@ enum ofpraw {
/* OFPST 1.4+ (16): uint8_t[8][]. */
OFPRAW_OFPST14_FLOW_MONITOR_REQUEST,
+ /* ONFST 1.3 (1870): uint8_t[8][]. */
+ OFPRAW_ONFST13_FLOW_MONITOR_REQUEST,
/* NXST 1.0-1.2 (2): uint8_t[8][]. */
OFPRAW_NXST_FLOW_MONITOR_REQUEST,
/* OFPST 1.4+ (16): uint8_t[8][]. */
OFPRAW_OFPST14_FLOW_MONITOR_REPLY,
+ /* ONFST 1.3 (1870): uint8_t[8][]. */
+ OFPRAW_ONFST13_FLOW_MONITOR_REPLY,
/* NXST 1.0-1.2 (2): uint8_t[8][]. */
OFPRAW_NXST_FLOW_MONITOR_REPLY,
+ /* ONFT 1.3 (1870): struct nx_flow_monitor_cancel. */
+ OFPRAW_ONFT13_FLOW_MONITOR_CANCEL,
+ /* NXT 1.0-1.2 (21): struct nx_flow_monitor_cancel. */
+ OFPRAW_NXT_FLOW_MONITOR_CANCEL,
+
+ /* ONFT 1.3 (1871): void. */
+ OFPRAW_ONFT13_FLOW_MONITOR_PAUSED,
+ /* NXT 1.0-1.2 (22): void. */
+ OFPRAW_NXT_FLOW_MONITOR_PAUSED,
+
+ /* ONFT 1.3 (1872): void. */
+ OFPRAW_ONFT13_FLOW_MONITOR_RESUMED,
+ /* NXT 1.0-1.2 (23): void. */
+ OFPRAW_NXT_FLOW_MONITOR_RESUMED,
+
/* Nicira extension messages.
*
* Nicira extensions that correspond to standard OpenFlow messages are listed
@@ -481,15 +500,6 @@ enum ofpraw {
/* NXT 1.0+ (20): struct nx_controller_id. */
OFPRAW_NXT_SET_CONTROLLER_ID,
- /* NXT 1.0+ (21): struct nx_flow_monitor_cancel. */
- OFPRAW_NXT_FLOW_MONITOR_CANCEL,
-
- /* NXT 1.0+ (22): void. */
- OFPRAW_NXT_FLOW_MONITOR_PAUSED,
-
- /* NXT 1.0+ (23): void. */
- OFPRAW_NXT_FLOW_MONITOR_RESUMED,
-
/* NXT 1.0+ (24): struct nx_tlv_table_mod, struct nx_tlv_map[]. */
OFPRAW_NXT_TLV_TABLE_MOD,
@@ -741,8 +751,10 @@ enum ofptype {
* OFPRAW_OFPST14_PORT_DESC_REPLY. */
OFPTYPE_FLOW_MONITOR_STATS_REQUEST, /* OFPRAW_OFPST14_FLOW_MONITOR_REQUEST.
+ * OFPRAW_ONFST13_FLOW_MONITOR_REQUEST.
* OFPRAW_NXST_FLOW_MONITOR_REQUEST. */
OFPTYPE_FLOW_MONITOR_STATS_REPLY, /* OFPRAW_OFPST14_FLOW_MONITOR_REPLY.
+ * OFPRAW_ONFST13_FLOW_MONITOR_REPLY.
* OFPRAW_NXST_FLOW_MONITOR_REPLY. */
/* Nicira extensions. */
@@ -762,9 +774,12 @@ enum ofptype {
OFPTYPE_CT_FLUSH_ZONE, /* OFPRAW_NXT_CT_FLUSH_ZONE. */
/* Flow monitor extension. */
- OFPTYPE_FLOW_MONITOR_CANCEL, /* OFPRAW_NXT_FLOW_MONITOR_CANCEL. */
- OFPTYPE_FLOW_MONITOR_PAUSED, /* OFPRAW_NXT_FLOW_MONITOR_PAUSED. */
- OFPTYPE_FLOW_MONITOR_RESUMED, /* OFPRAW_NXT_FLOW_MONITOR_RESUMED. */
+ OFPTYPE_FLOW_MONITOR_CANCEL, /* OFPRAW_NXT_FLOW_MONITOR_CANCEL.
+ * OFPRAW_ONFT13_FLOW_MONITOR_CANCEL. */
+ OFPTYPE_FLOW_MONITOR_PAUSED, /* OFPRAW_NXT_FLOW_MONITOR_PAUSED.
+ * OFPRAW_ONFT13_FLOW_MONITOR_PAUSED. */
+ OFPTYPE_FLOW_MONITOR_RESUMED, /* OFPRAW_NXT_FLOW_MONITOR_RESUMED.
+ * OFPRAW_ONFT13_FLOW_MONITOR_RESUMED */
};
/* Decoding messages into OFPTYPE_* values. */