diff options
author | Alex Wang <ee07b291@gmail.com> | 2015-08-28 05:05:07 +0000 |
---|---|---|
committer | Alex Wang <ee07b291@gmail.com> | 2015-08-29 00:38:00 +0000 |
commit | e83c93573b10bdc0dbadda02ca1ae873757c8903 (patch) | |
tree | cf3fc6b726830585f60193421ab290c64dae1ae2 | |
parent | 926dc8cf5a862d965ce435a3684e6615ae8fb705 (diff) |
ofproto-dpif-upcall: Do not attribute stats when flow_del returns error.
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>
-rw-r--r-- | ofproto/ofproto-dpif-upcall.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index a0994a20e..419fd1a25 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); |