summaryrefslogtreecommitdiff
path: root/utilities
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 /utilities
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 'utilities')
-rw-r--r--utilities/ovs-ofctl.8.in3
-rw-r--r--utilities/ovs-ofctl.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in
index e903ca12b..3fe6a0cc5 100644
--- a/utilities/ovs-ofctl.8.in
+++ b/utilities/ovs-ofctl.8.in
@@ -626,6 +626,9 @@ monitored.
If set, only flows that output to \fIport\fR are monitored. The
\fIport\fR may be an OpenFlow port number or keyword
(e.g. \fBLOCAL\fR).
+.IP "\fBout_group=\fIgroup\fR"
+If set, only flows that output to \fIgroup\fR number are monitored.
+This field requires OpenFlow 1.4 (-OOpenFlow14) or later.
.IP "\fIfield\fB=\fIvalue\fR"
Monitors only flows that have \fIfield\fR specified as the given
\fIvalue\fR. Any syntax valid for matching on \fBdump\-flows\fR may
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index b6d103ffd..fe9114580 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -2313,6 +2313,12 @@ ofctl_monitor(struct ovs_cmdl_context *ctx)
msg = ofpbuf_new(0);
ofputil_append_flow_monitor_request(&fmr, msg, protocol);
+
+ if (verbosity) {
+ ofpmsg_update_length(msg);
+ ofp_print(stdout, msg->data, msg->size, NULL,
+ NULL, verbosity + 2);
+ }
dump_transaction(vconn, msg);
fflush(stdout);
} else if (!strcmp(arg, "resume")) {