summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEelco Chaudron <echaudro@redhat.com>2018-06-25 12:58:05 +0200
committerBen Pfaff <blp@ovn.org>2018-07-06 14:26:20 -0700
commit95dcecc5b5df36011872dc108f5cc65fbcc7d0d0 (patch)
tree0c49da0eece3a2060294bcf745a4857dfa4bb53b /lib
parent4ef1edf085a2160a79ec043f885e62b25d2b92a7 (diff)
downloadopenvswitch-95dcecc5b5df36011872dc108f5cc65fbcc7d0d0.tar.gz
ofproto: Add CLI commands to show and clear mac_learning statistics
Add two new commands, fdb/stats-show and fdb/stats-clear, to ovs-appctl to show and clear the new mac_learning statistics. $ ovs-appctl fdb/stats-show ovs_pvp_br0 Statistics for bridge "ovs_pvp_br0": Current/maximum MAC entries in the table: 4/2048 Total number of learned MAC entries : 4 Total number of expired MAC entries : 1 Total number of evicted MAC entries : 0 Total number of port moved MAC entries : 32 $ ovs-appctl fdb/stats-clear ovs_pvp_br0 statistics successfully cleared Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/mac-learning.c2
-rw-r--r--lib/mac-learning.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/mac-learning.c b/lib/mac-learning.c
index c13a5fac8..f6183480d 100644
--- a/lib/mac-learning.c
+++ b/lib/mac-learning.c
@@ -182,7 +182,7 @@ normalize_idle_time(unsigned int idle_time)
}
/* Clear all the mac_learning statistics */
-static void
+void
mac_learning_clear_statistics(struct mac_learning *ml)
{
if (ml != NULL) {
diff --git a/lib/mac-learning.h b/lib/mac-learning.h
index fcb9fde9c..ad2f1fe4e 100644
--- a/lib/mac-learning.h
+++ b/lib/mac-learning.h
@@ -189,6 +189,7 @@ int mac_entry_age(const struct mac_learning *ml, const struct mac_entry *e)
struct mac_learning *mac_learning_create(unsigned int idle_time);
struct mac_learning *mac_learning_ref(const struct mac_learning *);
void mac_learning_unref(struct mac_learning *);
+void mac_learning_clear_statistics(struct mac_learning *ml);
bool mac_learning_run(struct mac_learning *ml) OVS_REQ_WRLOCK(ml->rwlock);
void mac_learning_wait(struct mac_learning *ml)