[ovs-dev] [PATCH branch-2.3 v2 5/5] ofproto-dpif-upcall: Do not attribute stats when flow_del returns error.

Jarno Rajahalme jarno at ovn.org
Fri Feb 5 00:10:11 UTC 2016


From: Alex Wang <ee07b291 at gmail.com>

In the push_dump_ops__(), when flow_del operation returns error, the 'struct
stats' passed to the operation function will be set to all zero.  And we
should not use it to calculate the delta (i.e. minus the zero stats by the
cached stats causes overflow).

Even though this should rarely happen, it is still good to make
push_ukey_ops__() just ignore the operation when it fails.

This is a backport of commit e83c935 to branch-2.3.

Signed-off-by: Alex Wang <ee07b291 at gmail.com>
Acked-by: Daniele Di Proietto <diproiettod at vmware.com>
Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
---
 ofproto/ofproto-dpif-upcall.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 0e72a3a..16dd655 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1417,6 +1417,10 @@ push_dump_ops__(struct udpif *udpif, struct dump_op *ops, size_t n_ops)
             goto next;
         }
 
+        if (op->op.error) {
+            /* flow_del error, no flow stats. */
+            goto next;
+        }
         stats = op->op.u.flow_del.stats;
 
         if (op->ukey) {
-- 
2.1.4




More information about the dev mailing list