datapath-windows/ovsext/Vport.c
/*
 * --------------------------------------------------------------------------
 * Function to process teardown of a port on the Hyper-V switch.
 * --------------------------------------------------------------------------
 */
Function to process teardown of a port on the Hyper-V switch.
Function to process teardown of a port on the Hyper - V switch .
VOID
HvTeardownPort(POVS_SWITCH_CONTEXT switchContext,
               PNDIS_SWITCH_PORT_PARAMETERS portParam)
{
    POVS_VPORT_ENTRY vport;
    LOCK_STATE_EX lockState;
    VPORT_PORT_ENTER(portParam);
    NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0);
    vport = OvsFindVportByPortIdAndNicIndex(switchContext,
                                            portParam->PortId, 0);
    if (vport) {
        vport->portState = NdisSwitchPortStateTeardown;
        vport->ovsState = OVS_STATE_PORT_TEAR_DOWN;
    } else {
        OVS_LOG_WARN("Vport not present.");
    }
    NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
    VPORT_PORT_EXIT(portParam);
}
VOID HvTeardownPort ( POVS_SWITCH_CONTEXT switchContext , PNDIS_SWITCH_PORT_PARAMETERS portParam ) { POVS_VPORT_ENTRY vport ; LOCK_STATE_EX lockState ; VPORT_PORT_ENTER ( portParam ) ; NdisAcquireRWLockWrite ( switchContext -> dispatchLock , & lockState , 0 ) ; vport = OvsFindVportByPortIdAndNicIndex ( switchContext , portParam -> PortId , 0 ) ; if ( vport ) { vport -> portState = NdisSwitchPortStateTeardown ; vport -> ovsState = OVS_STATE_PORT_TEAR_DOWN ; } else { OVS_LOG_WARN ( " " ) ; } NdisReleaseRWLock ( switchContext -> dispatchLock , & lockState ) ; VPORT_PORT_EXIT ( portParam ) ; }
Function to process teardown of a port on the Hyper-V switch.
Function to process teardown of a port on the Hyper - V switch .
/* add assertion here */