datapath-windows/ovsext/Flow.c
/*
 * ----------------------------------------------------------------------------
 * AddFlow --
 *    Add a flow to flow table.
 *
 * Results:
 *   NDIS_STATUS_SUCCESS if no same flow in the flow table.
 * ----------------------------------------------------------------------------
 */
AddFlow
Add a flow to flow table.

NDIS_STATUS_SUCCESS if no same flow in the flow table.
AddFlow Add a flow to flow table . NDIS_STATUS_SUCCESS if no same flow in the flow table .
NTSTATUS
AddFlow(OVS_DATAPATH *datapath, OvsFlow *flow)
{
    PLIST_ENTRY head;
    if (OvsLookupFlow(datapath, &flow->key, &flow->hash, TRUE) != NULL) {
        return STATUS_INVALID_HANDLE;
    }
    head = &(datapath->flowTable[HASH_BUCKET(flow->hash)]);
    KeMemoryBarrier();
    InsertTailList(head, &flow->ListEntry);
    datapath->nFlows++;
    return STATUS_SUCCESS;
}
NTSTATUS AddFlow ( OVS_DATAPATH * datapath , OvsFlow * flow ) { PLIST_ENTRY head ; if ( OvsLookupFlow ( datapath , & flow -> key , & flow -> hash , TRUE ) != NULL ) { return STATUS_INVALID_HANDLE ; } head = & ( datapath -> flowTable [ HASH_BUCKET ( flow -> hash ) ] ) ; KeMemoryBarrier ( ) ; InsertTailList ( head , & flow -> ListEntry ) ; datapath -> nFlows ++ ; return STATUS_SUCCESS ; }
AddFlow
    Add a flow to flow table.
AddFlow Add a flow to flow table .
/*
     * We need fence here to make sure flow's nextPtr is updated before
     * head->nextPtr is updated.
     */ //KeAcquireSpinLock(&FilterDeviceExtension->NblQueueLock, &oldIrql); //KeReleaseSpinLock(&FilterDeviceExtension->NblQueueLock, oldIrql);