]> git.proxmox.com Git - ovs.git/commitdiff
ofproto-dpif-upcall: Do not attribute stats when flow_del returns error.
authorAlex Wang <ee07b291@gmail.com>
Fri, 28 Aug 2015 05:05:07 +0000 (05:05 +0000)
committerAlex Wang <ee07b291@gmail.com>
Sat, 29 Aug 2015 00:38:00 +0000 (00:38 +0000)
In the push_ukey_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.

Signed-off-by: Alex Wang <ee07b291@gmail.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
ofproto/ofproto-dpif-upcall.c

index a0994a20e35a5b52a21650ecdaad3781d493f4fc..419fd1a2581a9ead27f637f7f82b74e92c5a3976 100644 (file)
@@ -1906,6 +1906,11 @@ push_ukey_ops__(struct udpif *udpif, struct ukey_op *ops, size_t n_ops)
             continue;
         }
 
+        if (op->dop.error) {
+            /* flow_del error, 'stats' is unusable. */
+            continue;
+        }
+
         if (op->ukey) {
             ovs_mutex_lock(&op->ukey->mutex);
             push->used = MAX(stats->used, op->ukey->stats.used);