datapath-windows/ovsext/BufferMgmt.c
/*
 * --------------------------------------------------------------------------
 * OvsCreateNewNBLsFromMultipleNBs --
 *      Creates an NBL chain where each NBL has a single NB,
 *      from an NBL which has multiple NBs.
 *      Sets 'curNbl' and 'lastNbl' to the first and last NBL in the
 *      newly created NBL chain respectively, and completes the original NBL.
 * --------------------------------------------------------------------------
 */
OvsCreateNewNBLsFromMultipleNBs
Creates an NBL chain where each NBL has a single NB,
from an NBL which has multiple NBs.
Sets 'curNbl' and 'lastNbl' to the first and last NBL in the
newly created NBL chain respectively, and completes the original NBL.
OvsCreateNewNBLsFromMultipleNBs Creates an NBL chain where each NBL has a single NB from an NBL which has multiple NBs . Sets ' curNbl ' and ' lastNbl ' to the first and last NBL in the newly created NBL chain respectively and completes the original NBL .
NTSTATUS
OvsCreateNewNBLsFromMultipleNBs(POVS_SWITCH_CONTEXT switchContext,
                                PNET_BUFFER_LIST *curNbl,
                                PNET_BUFFER_LIST *lastNbl)
{
    NTSTATUS status = STATUS_SUCCESS;
    PNET_BUFFER_LIST newNbls = NULL;
    PNET_BUFFER_LIST nbl = NULL;
    BOOLEAN error = TRUE;
    do {
        newNbls = OvsPartialCopyToMultipleNBLs(switchContext,
                                               *curNbl, 0, 0, TRUE);
        if (NULL == newNbls) {
            OVS_LOG_ERROR("Failed to allocate NBLs with single NB.");
            status = NDIS_STATUS_RESOURCES;
            break;
        }
        nbl = newNbls;
        while (nbl) {
            *lastNbl = nbl;
            nbl = NET_BUFFER_LIST_NEXT_NBL(nbl);
        }
        (*curNbl)->Next = NULL;
        OvsCompleteNBL(switchContext, *curNbl, TRUE);
        *curNbl = newNbls;
        error = FALSE;
    } while (error);
    return status;
}
NTSTATUS OvsCreateNewNBLsFromMultipleNBs ( POVS_SWITCH_CONTEXT switchContext , PNET_BUFFER_LIST * curNbl , PNET_BUFFER_LIST * lastNbl ) { NTSTATUS status = STATUS_SUCCESS ; PNET_BUFFER_LIST newNbls = NULL ; PNET_BUFFER_LIST nbl = NULL ; BOOLEAN error = TRUE ; do { newNbls = OvsPartialCopyToMultipleNBLs ( switchContext , * curNbl , 0 , 0 , TRUE ) ; if ( NULL == newNbls ) { OVS_LOG_ERROR ( " " ) ; status = NDIS_STATUS_RESOURCES ; break ; } nbl = newNbls ; while ( nbl ) { * lastNbl = nbl ; nbl = NET_BUFFER_LIST_NEXT_NBL ( nbl ) ; } ( * curNbl ) -> Next = NULL ; OvsCompleteNBL ( switchContext , * curNbl , TRUE ) ; * curNbl = newNbls ; error = FALSE ; } while ( error ) ; return status ; }
OvsCreateNewNBLsFromMultipleNBs
      Creates an NBL chain where each NBL has a single NB,
      from an NBL which has multiple NBs.
OvsCreateNewNBLsFromMultipleNBs Creates an NBL chain where each NBL has a single NB from an NBL which has multiple NBs .
/* Create new NBLs from curNbl with multiple net buffers. */