There is a check if idle_age and duration are aligned.
However, the idle age can be -1 if unknown which could break
this. Use packet_count instead to check if flow received any traffic.

Fixes: fbb501cc8b7d ("mac-cache: Handle never hit flows correctly.")
Signed-off-by: Ales Musil <[email protected]>
---
 controller/mac-cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/controller/mac-cache.c b/controller/mac-cache.c
index 814da223b..67a220aa3 100644
--- a/controller/mac-cache.c
+++ b/controller/mac-cache.c
@@ -347,7 +347,7 @@ void
 mac_binding_stats_process_flow_stats(struct vector *stats_vec,
                                      struct ofputil_flow_stats *ofp_stats)
 {
-    if (ofp_stats->idle_age == ofp_stats->duration_sec) {
+    if (!ofp_stats->packet_count) {
         return;
     }
 
@@ -452,7 +452,7 @@ void
 fdb_stats_process_flow_stats(struct vector *stats_vec,
                              struct ofputil_flow_stats *ofp_stats)
 {
-    if (ofp_stats->idle_age == ofp_stats->duration_sec) {
+    if (!ofp_stats->packet_count) {
         return;
     }
 
-- 
2.55.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to