Skip to content

Commit

Permalink
ofproto-dpif-xlate: Allow direct destroy of previous config.
Browse files Browse the repository at this point in the history
Before this commit, the ofproto-dpif-xlate module uses ovs-rcu to
postpone the destroy of previous configuration.  However, the delayed
close of object like 'struct netdev' could cause failure in immediate
re-add or reconfigure of the same device.

To fix the above issue, this commit makes the ofproto-dpif-xlate
module call ovsrcu_synchronize(), which waits for all threads
to finish the use of reference to previous config.  Then, the
module can just directly destroy the previous config.

Reported-by: Cian Ferriter <[email protected]>
Signed-off-by: Alex Wang <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
yew011 committed Nov 12, 2014
1 parent f7d6365 commit 40a9c4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ofproto/ofproto-dpif-xlate.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,8 @@ xlate_txn_commit(void)
struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp);

ovsrcu_set(&xcfgp, new_xcfg);
ovsrcu_postpone(xlate_xcfg_free, xcfg);

ovsrcu_synchronize();
xlate_xcfg_free(xcfg);
new_xcfg = NULL;
}

Expand Down

0 comments on commit 40a9c4c

Please sign in to comment.