datapath-windows/ovsext/Vport.c
/*
 * --------------------------------------------------------------------------
 * Deletes ports added from the Hyper-V switch as well as OVS usersapce. The
 * function deletes ports in 'portIdHashArray'. This will delete most of the
 * ports that are in the 'portNoHashArray' as well. Any remaining ports
 * are deleted by walking the 'portNoHashArray'.
 * --------------------------------------------------------------------------
 */
Deletes ports added from the Hyper-V switch as well as OVS usersapce. The
function deletes ports in 'portIdHashArray'. This will delete most of the
ports that are in the 'portNoHashArray' as well. Any remaining ports
are deleted by walking the 'portNoHashArray'.
Deletes ports added from the Hyper - V switch as well as OVS usersapce . The function deletes ports in ' portIdHashArray ' . This will delete most of the ports that are in the ' portNoHashArray ' as well . Any remaining ports are deleted by walking the ' portNoHashArray ' .
VOID
OvsClearAllSwitchVports(POVS_SWITCH_CONTEXT switchContext)
{
    for (UINT hash = 0; hash < OVS_MAX_VPORT_ARRAY_SIZE; hash++) {
        PLIST_ENTRY head, link, next;
        head = &(switchContext->portIdHashArray[hash & OVS_VPORT_MASK]);
        LIST_FORALL_SAFE(head, link, next) {
            POVS_VPORT_ENTRY vport;
            vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portIdLink);
            OvsRemoveAndDeleteVport(NULL, switchContext, vport, TRUE, TRUE);
        }
    }
    if (switchContext->virtualExternalVport) {
        OvsRemoveAndDeleteVport(NULL, switchContext,
            (POVS_VPORT_ENTRY)switchContext->virtualExternalVport, TRUE, TRUE);
    }
    for (UINT hash = 0; hash < OVS_MAX_VPORT_ARRAY_SIZE; hash++) {
        PLIST_ENTRY head, link, next;
        head = &(switchContext->portNoHashArray[hash & OVS_VPORT_MASK]);
        LIST_FORALL_SAFE(head, link, next) {
            POVS_VPORT_ENTRY vport;
            vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portNoLink);
            ASSERT(OvsIsTunnelVportType(vport->ovsType) ||
                   vport->isAbsentOnHv == TRUE);
            OvsRemoveAndDeleteVport(NULL, switchContext, vport, TRUE, TRUE);
        }
    }
    ASSERT(switchContext->virtualExternalVport == NULL);
    ASSERT(switchContext->countInternalVports == 0);
}
VOID OvsClearAllSwitchVports ( POVS_SWITCH_CONTEXT switchContext ) { for ( UINT hash = 0 ; hash < OVS_MAX_VPORT_ARRAY_SIZE ; hash ++ ) { PLIST_ENTRY head , link , next ; head = & ( switchContext -> portIdHashArray [ hash & OVS_VPORT_MASK ] ) ; LIST_FORALL_SAFE ( head , link , next ) { POVS_VPORT_ENTRY vport ; vport = CONTAINING_RECORD ( link , OVS_VPORT_ENTRY , portIdLink ) ; OvsRemoveAndDeleteVport ( NULL , switchContext , vport , TRUE , TRUE ) ; } } if ( switchContext -> virtualExternalVport ) { OvsRemoveAndDeleteVport ( NULL , switchContext , ( POVS_VPORT_ENTRY ) switchContext -> virtualExternalVport , TRUE , TRUE ) ; } for ( UINT hash = 0 ; hash < OVS_MAX_VPORT_ARRAY_SIZE ; hash ++ ) { PLIST_ENTRY head , link , next ; head = & ( switchContext -> portNoHashArray [ hash & OVS_VPORT_MASK ] ) ; LIST_FORALL_SAFE ( head , link , next ) { POVS_VPORT_ENTRY vport ; vport = CONTAINING_RECORD ( link , OVS_VPORT_ENTRY , portNoLink ) ; ASSERT ( OvsIsTunnelVportType ( vport -> ovsType ) || vport -> isAbsentOnHv == TRUE ) ; OvsRemoveAndDeleteVport ( NULL , switchContext , vport , TRUE , TRUE ) ; } } ASSERT ( switchContext -> virtualExternalVport == NULL ) ; ASSERT ( switchContext -> countInternalVports == 0 ) ; }
Deletes ports added from the Hyper-V switch as well as OVS usersapce.
Deletes ports added from the Hyper - V switch as well as OVS usersapce .
/*
     * Remove 'virtualExternalVport' as well. This port is not part of the
     * 'portIdHashArray'.
     */