datapath-windows/ovsext/Vport.c
/*
 * --------------------------------------------------------------------------
 * Enumerates the NICs on the Hyper-V switch.
 * --------------------------------------------------------------------------
 */
Enumerates the NICs on the Hyper-V switch.
Enumerates the NICs on the Hyper - V switch .
NDIS_STATUS
OvsInitConfiguredSwitchNics(POVS_SWITCH_CONTEXT switchContext)
{
    NDIS_STATUS status = NDIS_STATUS_SUCCESS;
    PNDIS_SWITCH_NIC_ARRAY nicArray = NULL;
    ULONG arrIndex;
    PNDIS_SWITCH_NIC_PARAMETERS nicParam;
    OVS_LOG_TRACE("Enter: switchContext: %p", switchContext);
    status = OvsGetNicsOnSwitch(switchContext, &nicArray);
    if (status != NDIS_STATUS_SUCCESS) {
        goto cleanup;
    }
    for (arrIndex = 0; arrIndex < nicArray->NumElements; ++arrIndex) {
        nicParam = NDIS_SWITCH_NIC_AT_ARRAY_INDEX(nicArray, arrIndex);
        status = HvCreateNic(switchContext, nicParam);
        if (status == NDIS_STATUS_SUCCESS) {
            HvConnectNic(switchContext, nicParam);
        }
    }
cleanup:
    OvsFreeSwitchNicsArray(nicArray);
    OVS_LOG_TRACE("Exit: status: %x", status);
    return status;
}
NDIS_STATUS OvsInitConfiguredSwitchNics ( POVS_SWITCH_CONTEXT switchContext ) { NDIS_STATUS status = NDIS_STATUS_SUCCESS ; PNDIS_SWITCH_NIC_ARRAY nicArray = NULL ; ULONG arrIndex ; PNDIS_SWITCH_NIC_PARAMETERS nicParam ; OVS_LOG_TRACE ( " " , switchContext ) ; status = OvsGetNicsOnSwitch ( switchContext , & nicArray ) ; if ( status != NDIS_STATUS_SUCCESS ) { goto cleanup ; } for ( arrIndex = 0 ; arrIndex < nicArray -> NumElements ; ++ arrIndex ) { nicParam = NDIS_SWITCH_NIC_AT_ARRAY_INDEX ( nicArray , arrIndex ) ; status = HvCreateNic ( switchContext , nicParam ) ; if ( status == NDIS_STATUS_SUCCESS ) { HvConnectNic ( switchContext , nicParam ) ; } } cleanup : OvsFreeSwitchNicsArray ( nicArray ) ; OVS_LOG_TRACE ( " " , status ) ; return status ; }
Enumerates the NICs on the Hyper-V switch.
Enumerates the NICs on the Hyper - V switch .
/*
     * Now, get NIC list.
     */ /*
         * XXX: Check if the port is configured with a VLAN. Disallow such a
         * configuration, since we don't support tag-in-tag.
         * XXX: Check if the port is connected to a VF. Disconnect the VF in
         * such a case.
         */