datapath-windows/ovsext/Vport.c
/*
 * --------------------------------------------------------------------------
 * Function to process updates to a port on the Hyper-Vs witch.
 * --------------------------------------------------------------------------
 */
Function to process updates to a port on the Hyper-Vs witch.
Function to process updates to a port on the Hyper - Vs witch .
NDIS_STATUS
HvUpdatePort(POVS_SWITCH_CONTEXT switchContext,
             PNDIS_SWITCH_PORT_PARAMETERS portParam)
{
    POVS_VPORT_ENTRY vport;
    LOCK_STATE_EX lockState;
    OVS_VPORT_STATE ovsState;
    NDIS_SWITCH_NIC_STATE nicState;
    VPORT_PORT_ENTER(portParam);
    NdisAcquireRWLockWrite(switchContext->dispatchLock, &lockState, 0);
    vport = OvsFindVportByPortIdAndNicIndex(switchContext,
                                            portParam->PortId, 0);
    if (vport == NULL) {
        goto update_port_done;
    }
    ovsState = vport->ovsState;
    nicState = vport->nicState;
    ASSERT(portParam->PortId == vport->portId);
    ASSERT(portParam->PortState == vport->portState);
    ASSERT(portParam->PortType == vport->portType);
    OvsInitVportWithPortParam(vport, portParam);
    vport->nicState = nicState;
    vport->ovsState = ovsState;
update_port_done:
    NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
    VPORT_PORT_EXIT(portParam);
    return NDIS_STATUS_SUCCESS;
}
NDIS_STATUS HvUpdatePort ( POVS_SWITCH_CONTEXT switchContext , PNDIS_SWITCH_PORT_PARAMETERS portParam ) { POVS_VPORT_ENTRY vport ; LOCK_STATE_EX lockState ; OVS_VPORT_STATE ovsState ; NDIS_SWITCH_NIC_STATE nicState ; VPORT_PORT_ENTER ( portParam ) ; NdisAcquireRWLockWrite ( switchContext -> dispatchLock , & lockState , 0 ) ; vport = OvsFindVportByPortIdAndNicIndex ( switchContext , portParam -> PortId , 0 ) ; if ( vport == NULL ) { goto update_port_done ; } ovsState = vport -> ovsState ; nicState = vport -> nicState ; ASSERT ( portParam -> PortId == vport -> portId ) ; ASSERT ( portParam -> PortState == vport -> portState ) ; ASSERT ( portParam -> PortType == vport -> portType ) ; OvsInitVportWithPortParam ( vport , portParam ) ; vport -> nicState = nicState ; vport -> ovsState = ovsState ; update_port_done : NdisReleaseRWLock ( switchContext -> dispatchLock , & lockState ) ; VPORT_PORT_EXIT ( portParam ) ; return NDIS_STATUS_SUCCESS ; }
Function to process updates to a port on the Hyper-Vs witch.
Function to process updates to a port on the Hyper - Vs witch .
/*
     * Update properties only for NETDEV ports for supprting PS script
     */ /* Store the nic and the OVS states as Nic Create won't be called */ /*
     * Currently only the port friendly name is being updated
     * Make sure that no other properties are changed
     */ /*
     * Call the set parameters function the handle all properties
     * change in a single place in case future version supports change of
     * other properties
     */ /* Retore the nic and OVS states */ /* Must always return success */