[ovs-dev] [PATCH V2 1/2] ofproto-dpif-upcall: Do not attribute stats when flow_del returns error.

Alex Wang ee07b291 at gmail.com
Fri Aug 28 05:25:11 UTC 2015

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 at gmail.com>

- new patch.
 ofproto/ofproto-dpif-upcall.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index a0994a2..419fd1a 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1906,6 +1906,11 @@ push_ukey_ops__(struct udpif *udpif, struct ukey_op *ops, size_t n_ops)
+        if (op->dop.error) {
+            /* flow_del error, 'stats' is unusable. */
+            continue;
+        }
         if (op->ukey) {
             push->used = MAX(stats->used, op->ukey->stats.used);

More information about the dev mailing list