datapath-windows/ovsext/BufferMgmt.c
/*
 * --------------------------------------------------------------------------
 * OvsPartialCopyToMultipleNBLs --
 *
 *     This is similar to OvsPartialCopyNBL() except that each NB will
 *     have its own NBL.
 * --------------------------------------------------------------------------
 */


This is similar to OvsPartialCopyNBL() except that each NB will
have its own NBL.
This is similar to OvsPartialCopyNBL () except that each NB will have its own NBL .
PNET_BUFFER_LIST
OvsPartialCopyToMultipleNBLs(PVOID ovsContext,
                             PNET_BUFFER_LIST nbl,
                             UINT32 copySize,
                             UINT32 headRoom,
                             BOOLEAN copyNblInfo)
{
    PNET_BUFFER nb, nextNb = NULL, firstNb, prevNb;
    POVS_SWITCH_CONTEXT context = (POVS_SWITCH_CONTEXT)ovsContext;
    PNET_BUFFER_LIST firstNbl = NULL, newNbl, prevNbl = NULL;
    nb = NET_BUFFER_LIST_FIRST_NB(nbl);
    if (NET_BUFFER_NEXT_NB(nb) == NULL) {
        return OvsPartialCopyNBL(context, nbl, copySize, headRoom, copyNblInfo);
    }
    firstNb = nb;
    prevNb = nb;
    while (nb) {
        nextNb = NET_BUFFER_NEXT_NB(nb);
        NET_BUFFER_NEXT_NB(nb) = NULL;
        NET_BUFFER_LIST_FIRST_NB(nbl) = nb;
        newNbl = OvsPartialCopyNBL(context, nbl, copySize, headRoom,
                                   copyNblInfo);
        if (newNbl == NULL) {
            goto cleanup;
        }
        if (prevNbl == NULL) {
            firstNbl = newNbl;
        } else {
            NET_BUFFER_LIST_NEXT_NBL(prevNbl) = newNbl;
            NET_BUFFER_NEXT_NB(prevNb) = nb;
        }
        prevNbl = newNbl;
        prevNb = nb;
        nb = nextNb;
    }
    NET_BUFFER_LIST_FIRST_NB(nbl) = firstNb;
    return firstNbl;
cleanup:
    NET_BUFFER_NEXT_NB(prevNb) = nb;
    NET_BUFFER_NEXT_NB(nb) = nextNb;
    NET_BUFFER_LIST_FIRST_NB(nbl) = firstNb;
    newNbl = firstNbl;
    while (newNbl) {
        firstNbl = NET_BUFFER_LIST_NEXT_NBL(newNbl);
        NET_BUFFER_LIST_NEXT_NBL(newNbl) = NULL;
        OvsCompleteNBL(context, newNbl, TRUE);
        newNbl = firstNbl;
    }
    return NULL;
}
PNET_BUFFER_LIST OvsPartialCopyToMultipleNBLs ( PVOID ovsContext , PNET_BUFFER_LIST nbl , UINT32 copySize , UINT32 headRoom , BOOLEAN copyNblInfo ) { PNET_BUFFER nb , nextNb = NULL , firstNb , prevNb ; POVS_SWITCH_CONTEXT context = ( POVS_SWITCH_CONTEXT ) ovsContext ; PNET_BUFFER_LIST firstNbl = NULL , newNbl , prevNbl = NULL ; nb = NET_BUFFER_LIST_FIRST_NB ( nbl ) ; if ( NET_BUFFER_NEXT_NB ( nb ) == NULL ) { return OvsPartialCopyNBL ( context , nbl , copySize , headRoom , copyNblInfo ) ; } firstNb = nb ; prevNb = nb ; while ( nb ) { nextNb = NET_BUFFER_NEXT_NB ( nb ) ; NET_BUFFER_NEXT_NB ( nb ) = NULL ; NET_BUFFER_LIST_FIRST_NB ( nbl ) = nb ; newNbl = OvsPartialCopyNBL ( context , nbl , copySize , headRoom , copyNblInfo ) ; if ( newNbl == NULL ) { goto cleanup ; } if ( prevNbl == NULL ) { firstNbl = newNbl ; } else { NET_BUFFER_LIST_NEXT_NBL ( prevNbl ) = newNbl ; NET_BUFFER_NEXT_NB ( prevNb ) = nb ; } prevNbl = newNbl ; prevNb = nb ; nb = nextNb ; } NET_BUFFER_LIST_FIRST_NB ( nbl ) = firstNb ; return firstNbl ; cleanup : NET_BUFFER_NEXT_NB ( prevNb ) = nb ; NET_BUFFER_NEXT_NB ( nb ) = nextNb ; NET_BUFFER_LIST_FIRST_NB ( nbl ) = firstNb ; newNbl = firstNbl ; while ( newNbl ) { firstNbl = NET_BUFFER_LIST_NEXT_NBL ( newNbl ) ; NET_BUFFER_LIST_NEXT_NBL ( newNbl ) = NULL ; OvsCompleteNBL ( context , newNbl , TRUE ) ; newNbl = firstNbl ; } return NULL ; }
OvsPartialCopyToMultipleNBLs
OvsPartialCopyToMultipleNBLs