diff options
author | Joe Stringer <joe@ovn.org> | 2017-09-06 15:12:52 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-11-02 15:01:26 -0700 |
commit | a1d6cce780d82fe7d2a1e394e127bd3335e247eb (patch) | |
tree | 2a75c673e40a89c763d6af78b8848748f2916a18 /ofproto | |
parent | c848e1cdb863599ca5bfda2fd46ddfdb89817c16 (diff) | |
download | openvswitch-a1d6cce780d82fe7d2a1e394e127bd3335e247eb.tar.gz |
ofproto-dpif-upcall: Transition ukey on dp_ops error.
In most situations, we don't expect that a flow we've successfully
dumped, which we intend to delete, cannot be deleted. However, to make
this code more resilient to ensure that ukeys *will* transition in all
cases (including an error at this stage), grab the lock and transition
this ukey forward to the evicted state, effectively treating a failure
to delete as "this flow is already gone".
If we subsequently find out that it wasn't deleted, then that's ok - we
will re-dump, and validate at that stage, which should lead to creating
a new ukey or deleting the datapath flow when that happens.
Signed-off-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Diffstat (limited to 'ofproto')
-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 e52871da2..2deecae4b 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -2227,6 +2227,11 @@ push_dp_ops(struct udpif *udpif, struct ukey_op *ops, size_t n_ops) if (op->dop.error) { /* flow_del error, 'stats' is unusable. */ + if (op->ukey) { + ovs_mutex_lock(&op->ukey->mutex); + transition_ukey(op->ukey, UKEY_EVICTED); + ovs_mutex_unlock(&op->ukey->mutex); + } continue; } |