[ovs-dev] [PATCH 1/1] netflow: Modify netflow_flow_clear() to do netflow_expire__

Anoob Soman anoob.soman at citrix.com
Tue May 20 11:40:35 UTC 2014


This avoids causing failed assert(), when netflow_flow_clear() and
netflow_expire() are called together.

Signed-off-by: Anoob Soman <anoob.soman at citrix.com>
---
 AUTHORS                       | 2 +-
 ofproto/netflow.c             | 3 +--
 ofproto/ofproto-dpif-upcall.c | 2 --
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 9cf6fe7..dd1e22d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -13,7 +13,7 @@ Andrew Lambeth          wal at nicira.com
 Andy Hill               hillad at gmail.com
 Andy Southgate          andy.southgate at citrix.com
 Andy Zhou               azhou at nicira.com
-Anob Soman              anoob.soman at citrix.com
+Anoob Soman             anoob.soman at citrix.com
 Ansis Atteka            aatteka at nicira.com
 Anupam Chanda           achanda at nicira.com
 Arun Sharma             arun.sharma at calsoftinc.com
diff --git a/ofproto/netflow.c b/ofproto/netflow.c
index e9382af..d556d3e 100644
--- a/ofproto/netflow.c
+++ b/ofproto/netflow.c
@@ -296,8 +296,7 @@ netflow_flow_clear(struct netflow *nf, struct flow *flow) OVS_EXCLUDED(mutex)
     ovs_mutex_lock(&mutex);
     nf_flow = netflow_flow_lookup(nf, flow);
     if (nf_flow) {
-        ovs_assert(!nf_flow->packet_count);
-        ovs_assert(!nf_flow->byte_count);
+        netflow_expire__(nf, nf_flow);
         hmap_remove(&nf->flows, &nf_flow->hmap_node);
         free(nf_flow);
     }
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 522aa8c..63b8e6e 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1326,7 +1326,6 @@ exit:
     ovs_mutex_unlock(&ukey->mutex);
     if (netflow) {
         if (!ok) {
-            netflow_expire(netflow, &flow);
             netflow_flow_clear(netflow, &flow);
         }
         netflow_unref(netflow);
@@ -1411,7 +1410,6 @@ push_dump_ops__(struct udpif *udpif, struct dump_op *ops, size_t n_ops)
                 xlate_actions_for_side_effects(&xin);
 
                 if (netflow) {
-                    netflow_expire(netflow, &flow);
                     netflow_flow_clear(netflow, &flow);
                     netflow_unref(netflow);
                 }
-- 
1.9.1




More information about the dev mailing list