summaryrefslogtreecommitdiff
path: root/ofproto/ofproto.c
diff options
context:
space:
mode:
authorVasu Dasari <vdasari@gmail.com>2021-12-08 18:05:22 -0500
committerIlya Maximets <i.maximets@ovn.org>2022-04-28 21:26:40 +0200
commitd8ab75cd69c6eee136636c75f5c8aa6bcd8d7a53 (patch)
tree06780420864f0f24031e3f82ed51d9d54f0f0c7d /ofproto/ofproto.c
parentd94cd0d3eec33e4290d7ca81918f5ac61444886e (diff)
downloadopenvswitch-d8ab75cd69c6eee136636c75f5c8aa6bcd8d7a53.tar.gz
ofp-monitor: Extend Flow Monitoring support for OF 1.0-1.2 with Nicira Extensions.
Currently OVS supports flow-monitoring for OpenFlow 1.0 and Nicira Extenstions. Any other OpenFlow versioned messages are not accepted. This change will allow OpenFlow1.0-1.2 Flow Monitoring with Nicira extensions be accepted. Also made sure that flow-monitoring updates, flow monitoring pause messages, resume messages are sent in the same OpenFlow version as that of flow-monitor request. Description of changes: 1. Generate ofp-msgs.inc to be able to support 1.0-1.2 Flow Monitoring messages. include/openvswitch/ofp-msgs.h 2. Support vconn to accept user specified version and use it for vconn flow-monitoring session ofproto/ofproto.c 3. Modify APIs to use protocol as an argument to encode and decode messages include/openvswitch/ofp-monitor.h lib/ofp-monitor.c ofproto/connmgr.c ofproto/connmgr.h ofproto/ofproto.c 4. Modified following testcases to be verified across supported OF Versions ofproto - flow monitoring ofproto - flow monitoring with !own ofproto - flow monitoring with out_port ofproto - flow monitoring pause and resume ofproto - flow monitoring usable protocols tests/ofproto.at 5. Updated NEWS with the support added with this commit Signed-off-by: Vasu Dasari <vdasari@gmail.com> Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2020-December/050820.html Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ofproto/ofproto.c')
-rw-r--r--ofproto/ofproto.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 2ed107800..f59413c73 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -6421,7 +6421,8 @@ static void
ofproto_compose_flow_refresh_update(const struct rule *rule,
enum nx_flow_monitor_flags flags,
struct ovs_list *msgs,
- const struct tun_table *tun_table)
+ const struct tun_table *tun_table,
+ enum ofputil_protocol protocol)
OVS_REQUIRES(ofproto_mutex)
{
const struct rule_actions *actions;
@@ -6444,14 +6445,15 @@ ofproto_compose_flow_refresh_update(const struct rule *rule,
fu.ofpacts_len = actions ? actions->ofpacts_len : 0;
if (ovs_list_is_empty(msgs)) {
- ofputil_start_flow_update(msgs);
+ ofputil_start_flow_update(msgs, protocol);
}
ofputil_append_flow_update(&fu, msgs, tun_table);
}
void
ofmonitor_compose_refresh_updates(struct rule_collection *rules,
- struct ovs_list *msgs)
+ struct ovs_list *msgs,
+ enum ofputil_protocol protocol)
OVS_REQUIRES(ofproto_mutex)
{
struct rule *rule;
@@ -6461,7 +6463,7 @@ ofmonitor_compose_refresh_updates(struct rule_collection *rules,
rule->monitor_flags = 0;
ofproto_compose_flow_refresh_update(rule, flags, msgs,
- ofproto_get_tun_tab(rule->ofproto));
+ ofproto_get_tun_tab(rule->ofproto), protocol);
}
}
@@ -6625,7 +6627,8 @@ handle_flow_monitor_request(struct ofconn *ofconn, const struct ovs_list *msgs)
struct ovs_list replies;
ofpmp_init(&replies, ofpbuf_from_list(ovs_list_back(msgs))->header);
- ofmonitor_compose_refresh_updates(&rules, &replies);
+ ofmonitor_compose_refresh_updates(&rules, &replies,
+ ofconn_get_protocol(ofconn));
ovs_mutex_unlock(&ofproto_mutex);
rule_collection_destroy(&rules);