Skip to content

Commit

Permalink
ofproto-dpif-upcall: Don't delete modified ukeys.
Browse files Browse the repository at this point in the history
If revalidation returns the result UKEY_DELETE, then both the ukey and
its corresponding flow should be deleted. However, if revalidation
returns UKEY_MODIFY, the ukey itself should be modified in-place and
should not be deleted.

Fix this by only applying the ukey deletion to ukeys whose datapath
operations delete a flow.

This may fix statistics accounting issues in rare cases involving
OpenFlow rule modification where actions are updated but flows remain
the same.

Found by inspection.

Signed-off-by: Joe Stringer <[email protected]>
Acked-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
joestringer committed Jan 7, 2016
1 parent ad99e2e commit c56eba3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ofproto/ofproto-dpif-upcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,9 @@ push_ukey_ops(struct udpif *udpif, struct umap *umap,
push_ukey_ops__(udpif, ops, n_ops);
ovs_mutex_lock(&umap->mutex);
for (i = 0; i < n_ops; i++) {
ukey_delete(umap, ops[i].ukey);
if (ops[i].dop.type == DPIF_OP_FLOW_DEL) {
ukey_delete(umap, ops[i].ukey);
}
}
ovs_mutex_unlock(&umap->mutex);
}
Expand Down

0 comments on commit c56eba3

Please sign in to comment.