Skip to content

Commit

Permalink
controller: properly remove qos policy meters
Browse files Browse the repository at this point in the history
Remove meters created through set_meter() action if the related entry in
the NB QoS table has been deleted.

Fixes: 885655e ("controller: reconfigure ovs meters for ovn meters")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
(cherry picked from commit 1e1d75c)
  • Loading branch information
LorenzoBianconi authored and numansiddique committed Apr 6, 2022
1 parent 93e2180 commit a814b86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controller/ofctrl.c
Expand Up @@ -2665,6 +2665,13 @@ ofctrl_put(struct ovn_desired_flow_table *lflow_table,
EXTEND_TABLE_FOR_EACH_INSTALLED (m_installed, next_meter, meters) {
/* Delete the meter. */
ofctrl_meter_bands_erase(m_installed, &msgs);
if (!strncmp(m_installed->name, "__string: ", 10)) {
struct ofputil_meter_mod mm = {
.command = OFPMC13_DELETE,
.meter = { .meter_id = m_installed->table_id },
};
add_meter_mod(&mm, &msgs);
}
ovn_extend_table_remove_existing(meters, m_installed);
}

Expand Down
4 changes: 4 additions & 0 deletions tests/ovn.at
Expand Up @@ -9403,6 +9403,10 @@ check ovn-nbctl --wait=hv qos-add lsw0 to-lport 1002 'inport=="lp2" && is_chassi
AT_CHECK([as hv ovs-ofctl dump-meters br-int -O OpenFlow13 | grep meter | wc -l], [0], [4
])

check ovn-nbctl qos-del lsw0
AT_CHECK([as hv ovs-ofctl dump-meters br-int -O OpenFlow13 | grep meter | wc -l], [0], [0
])

OVN_CLEANUP([hv])
AT_CLEANUP
])
Expand Down

0 comments on commit a814b86

Please sign in to comment.