Skip to content

Commit

Permalink
ofproto-dpif-upcall: Transition ukey on dp_ops error.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Reviewed-by: Greg Rose <[email protected]>
  • Loading branch information
joestringer authored and blp committed Nov 2, 2017
1 parent c848e1c commit a1d6cce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ofproto/ofproto-dpif-upcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a1d6cce

Please sign in to comment.