summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Switch.c
diff options
context:
space:
mode:
authorAlin Serdean <aserdean@cloudbasesolutions.com>2014-10-09 17:46:57 +0000
committerBen Pfaff <blp@nicira.com>2014-10-09 15:47:48 -0700
commit91c261cd0efc40f7ed70427441141656cf5a3932 (patch)
treeff4b86bc136ab564da93b35d9776f6031f7f7af5 /datapath-windows/ovsext/Switch.c
parent147c91db1c2af16e05029998a80438949a3535c6 (diff)
downloadopenvswitch-91c261cd0efc40f7ed70427441141656cf5a3932.tar.gz
datapath-windows: Rename switch context's portHashArray and vport's portLink
The field portLink of the OVS_VPORT_ENTRY is the link within the OVS_SWITCH_CONTEXT's hash array of vports portHashArray, hashed by the portId field of the OVS_VPORT_ENTRY. Later on, we will need to modify the OVS_VPORT_ENTRY so that its port numbers are set to maximum MAXUINT16. This will require that the field vportArray of OVS_SWITCH_CONTEXT be removed and replaced with a hash array, portNoHashArray. Also, a new field, portNoLink, will need to be added to OVS_VPORT_ENTRY. In order to differentiate between portHashArray and portNoHashArray, portHashArray is renamed to portIdHashArray. Also, in order to differentiate between portLink and portNoLink, portLink is renamed to portIdLink. In a future patch the vport functionality will be changed to constraint the port numbers to MAXUINT16. Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Tested-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/Switch.c')
-rw-r--r--datapath-windows/ovsext/Switch.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c
index d9c76175b..7d8aa7a1f 100644
--- a/datapath-windows/ovsext/Switch.c
+++ b/datapath-windows/ovsext/Switch.c
@@ -358,7 +358,7 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
(PVOID *)OvsAllocateMemory(sizeof (PVOID) * OVS_MAX_VPORT_ARRAY_SIZE);
switchContext->ovsPortNameHashArray = (PLIST_ENTRY)
OvsAllocateMemory(sizeof (LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE);
- switchContext->portHashArray = (PLIST_ENTRY)
+ switchContext->portIdHashArray= (PLIST_ENTRY)
OvsAllocateMemory(sizeof (LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE);
status = OvsAllocateFlowTable(&switchContext->datapath, switchContext);
@@ -369,7 +369,7 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
switchContext->dispatchLock == NULL ||
switchContext->vportArray == NULL ||
switchContext->ovsPortNameHashArray == NULL ||
- switchContext->portHashArray == NULL) {
+ switchContext->portIdHashArray== NULL) {
if (switchContext->dispatchLock) {
NdisFreeRWLock(switchContext->dispatchLock);
}
@@ -379,8 +379,8 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
if (switchContext->ovsPortNameHashArray) {
OvsFreeMemory(switchContext->ovsPortNameHashArray);
}
- if (switchContext->portHashArray) {
- OvsFreeMemory(switchContext->portHashArray);
+ if (switchContext->portIdHashArray) {
+ OvsFreeMemory(switchContext->portIdHashArray);
}
OvsDeleteFlowTable(&switchContext->datapath);
OvsCleanupBufferPool(switchContext);
@@ -393,7 +393,7 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
InitializeListHead(&switchContext->ovsPortNameHashArray[i]);
}
for (i = 0; i < OVS_MAX_VPORT_ARRAY_SIZE; i++) {
- InitializeListHead(&switchContext->portHashArray[i]);
+ InitializeListHead(&switchContext->portIdHashArray[i]);
}
RtlZeroMemory(switchContext->vportArray,
sizeof (PVOID) * OVS_MAX_VPORT_ARRAY_SIZE);
@@ -418,7 +418,7 @@ OvsCleanupSwitchContext(POVS_SWITCH_CONTEXT switchContext)
NdisFreeRWLock(switchContext->dispatchLock);
OvsFreeMemory(switchContext->ovsPortNameHashArray);
- OvsFreeMemory(switchContext->portHashArray);
+ OvsFreeMemory(switchContext->portIdHashArray);
OvsFreeMemory(switchContext->vportArray);
OvsDeleteFlowTable(&switchContext->datapath);
OvsCleanupBufferPool(switchContext);