summaryrefslogtreecommitdiff
path: root/datapath-windows
diff options
context:
space:
mode:
Diffstat (limited to 'datapath-windows')
-rw-r--r--datapath-windows/ovsext/Datapath.h2
-rw-r--r--datapath-windows/ovsext/Switch.c15
-rw-r--r--datapath-windows/ovsext/Switch.h3
-rw-r--r--datapath-windows/ovsext/User.c1
4 files changed, 20 insertions, 1 deletions
diff --git a/datapath-windows/ovsext/Datapath.h b/datapath-windows/ovsext/Datapath.h
index abbcc1aa4..221515ddc 100644
--- a/datapath-windows/ovsext/Datapath.h
+++ b/datapath-windows/ovsext/Datapath.h
@@ -87,6 +87,8 @@ typedef struct _OVS_OPEN_INSTANCE {
* markers can store the row and the column
* indices. */
} dumpState; /* data to support dump commands. */
+ LIST_ENTRY pidLink; /* Links the instance to
+ * pidHashArray */
} OVS_OPEN_INSTANCE, *POVS_OPEN_INSTANCE;
NDIS_STATUS OvsCreateDeviceObject(NDIS_HANDLE ovsExtDriverHandle);
diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c
index ac4a847bf..5593d43c4 100644
--- a/datapath-windows/ovsext/Switch.c
+++ b/datapath-windows/ovsext/Switch.c
@@ -360,6 +360,8 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
OvsAllocateMemory(sizeof (LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE);
switchContext->portIdHashArray= (PLIST_ENTRY)
OvsAllocateMemory(sizeof (LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE);
+ switchContext->pidHashArray = (PLIST_ENTRY)
+ OvsAllocateMemory(sizeof(LIST_ENTRY) * OVS_MAX_PID_ARRAY_SIZE);
status = OvsAllocateFlowTable(&switchContext->datapath, switchContext);
if (status == NDIS_STATUS_SUCCESS) {
@@ -369,7 +371,8 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
switchContext->dispatchLock == NULL ||
switchContext->portNoHashArray == NULL ||
switchContext->ovsPortNameHashArray == NULL ||
- switchContext->portIdHashArray== NULL) {
+ switchContext->portIdHashArray== NULL ||
+ switchContext->pidHashArray == NULL) {
if (switchContext->dispatchLock) {
NdisFreeRWLock(switchContext->dispatchLock);
}
@@ -382,6 +385,11 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
if (switchContext->portIdHashArray) {
OvsFreeMemory(switchContext->portIdHashArray);
}
+
+ if (switchContext->pidHashArray) {
+ OvsFreeMemory(switchContext->pidHashArray);
+ }
+
OvsDeleteFlowTable(&switchContext->datapath);
OvsCleanupBufferPool(switchContext);
@@ -399,6 +407,10 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
InitializeListHead(&switchContext->portNoHashArray[i]);
}
+ for (i = 0; i < OVS_MAX_PID_ARRAY_SIZE; i++) {
+ InitializeListHead(&switchContext->pidHashArray[i]);
+ }
+
switchContext->isActivated = FALSE;
switchContext->isActivateFailed = FALSE;
switchContext->dpNo = OVS_DP_NUMBER;
@@ -420,6 +432,7 @@ OvsCleanupSwitchContext(POVS_SWITCH_CONTEXT switchContext)
OvsFreeMemory(switchContext->ovsPortNameHashArray);
OvsFreeMemory(switchContext->portIdHashArray);
OvsFreeMemory(switchContext->portNoHashArray);
+ OvsFreeMemory(switchContext->pidHashArray);
OvsDeleteFlowTable(&switchContext->datapath);
OvsCleanupBufferPool(switchContext);
OVS_LOG_TRACE("Exit: Delete switchContext: %p", switchContext);
diff --git a/datapath-windows/ovsext/Switch.h b/datapath-windows/ovsext/Switch.h
index ac708b7ff..7fdca5f3a 100644
--- a/datapath-windows/ovsext/Switch.h
+++ b/datapath-windows/ovsext/Switch.h
@@ -24,8 +24,10 @@
#include "NetProto.h"
#include "BufferMgmt.h"
#define OVS_MAX_VPORT_ARRAY_SIZE 1024
+#define OVS_MAX_PID_ARRAY_SIZE 1024
#define OVS_VPORT_MASK (OVS_MAX_VPORT_ARRAY_SIZE - 1)
+#define OVS_PID_MASK (OVS_MAX_PID_ARRAY_SIZE - 1)
#define OVS_INTERNAL_VPORT_DEFAULT_INDEX 0
@@ -107,6 +109,7 @@ typedef struct _OVS_SWITCH_CONTEXT
PLIST_ENTRY ovsPortNameHashArray; // based on ovsName
PLIST_ENTRY portIdHashArray; // based on portId
PLIST_ENTRY portNoHashArray; // based on ovs port number
+ PLIST_ENTRY pidHashArray; // based on packet pids
UINT32 numPhysicalNics;
UINT32 numVports; // include validation port
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c
index 329b964b0..3e6cda256 100644
--- a/datapath-windows/ovsext/User.c
+++ b/datapath-windows/ovsext/User.c
@@ -143,6 +143,7 @@ OvsSubscribeDpIoctl(PVOID instanceP,
if (queue == NULL) {
return STATUS_NO_MEMORY;
}
+ InitializeListHead(&(instance->pidLink));
instance->packetQueue = queue;
RtlZeroMemory(queue, sizeof (*queue));
NdisAllocateSpinLock(&queue->queueLock);