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

ALeX Wang ee07b291 at gmail.com
Sat Aug 29 00:38:55 UTC 2015


Thx, applied to master~

On 28 August 2015 at 09:12, Daniele Di Proietto <diproiettod at vmware.com>
wrote:

> With the older version of this series I was able to reproduce the problem
> and this patch appears to fix it.
>
> Acked-by: Daniele Di Proietto <diproiettod at vmware.com>
>
> Thanks!
>
> On 28/08/2015 06:25, "Alex Wang" <ee07b291 at gmail.com> wrote:
>
> >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>
> >
> >---
> >V2:
> >- 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)
> >             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);
> >--
> >1.9.1
> >
>
>


-- 
Alex Wang,
Open vSwitch developer



More information about the dev mailing list