Skip to content

Commit

Permalink
datapath-windows: Fix race condition during port creation
Browse files Browse the repository at this point in the history
Hold the dispatch lock until port-add operations are completed.

Found by inspection.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
  • Loading branch information
Sairam Venugopal authored and aserdean committed Mar 13, 2019
1 parent 132733d commit adffc2f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions datapath-windows/ovsext/Vport.c
Expand Up @@ -452,12 +452,11 @@ HvConnectNic(POVS_SWITCH_CONTEXT switchContext,
vport->ovsState = OVS_STATE_CONNECTED;
vport->nicState = NdisSwitchNicStateConnected;

NdisReleaseRWLock(switchContext->dispatchLock, &lockState);

if (nicParam->NicType == NdisSwitchNicTypeInternal) {
OvsInternalAdapterUp(vport->portNo, &vport->netCfgInstanceId);
}

NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
done:
VPORT_NIC_EXIT(nicParam);
}
Expand Down

0 comments on commit adffc2f

Please sign in to comment.