summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Switch.c
diff options
context:
space:
mode:
authorAlin Serdean <aserdean@cloudbasesolutions.com>2014-10-09 17:46:56 +0000
committerBen Pfaff <blp@nicira.com>2014-10-09 15:47:38 -0700
commit147c91db1c2af16e05029998a80438949a3535c6 (patch)
tree5397bf1016b543ef23eaed6cb8db85236a9cf3f4 /datapath-windows/ovsext/Switch.c
parent1eda776120c4884d55f6ea75313bc49f52a41f1c (diff)
downloadopenvswitch-147c91db1c2af16e05029998a80438949a3535c6.tar.gz
datapath-windows: Rename switch context's nameHashArray and vport's nameLink login register
The field nameLink of the OVS_VPORT_ENTRY is the link within the OVS_SWITCH_CONTEXT's hash array of vports nameHashArray, hashed by the ovsName field of the OVS_VPORT_ENTRY. Later on, the friendly name of the hyper-v switch port will need to be set from userspace using WMI. This will require that the hyper-v switch port friendly name be set to the exact string value as the ovs (datapath) port name set from netlink command vport add. The vport will need to differentiate between the ovs (datapath) port name and hyper-v switch port friendly name, because they may differ in erroneous scenarios, or state differences between the hyper-v switch port and the ovs (datapath) port. This may happen if the vport was created by the netlink command vport add, but the VM disconnected (i.e. the hyper-v switch port was later deleted). Storing another field in vport, "portFriendlyName" would normally make the current switchContext->nameHashArray and vport->nameLink confusing since the "name"-s may be understood to mean the hyper-v switch port friendly name, or the hyper-v switch port name, when it actually refers to the ovs (datapath) port name. Hence, the variable nameHashArray is renamed to ovsPortNameHashArray, while the nameLink is renamed to ovsPortNameLink. This change will make a clearer connection between these and the vport field "ovsName" to which they revolve around. 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 9578680e0..d9c76175b 100644
--- a/datapath-windows/ovsext/Switch.c
+++ b/datapath-windows/ovsext/Switch.c
@@ -356,7 +356,7 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
switchContext->vportArray =
(PVOID *)OvsAllocateMemory(sizeof (PVOID) * OVS_MAX_VPORT_ARRAY_SIZE);
- switchContext->nameHashArray = (PLIST_ENTRY)
+ switchContext->ovsPortNameHashArray = (PLIST_ENTRY)
OvsAllocateMemory(sizeof (LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE);
switchContext->portHashArray = (PLIST_ENTRY)
OvsAllocateMemory(sizeof (LIST_ENTRY) * OVS_MAX_VPORT_ARRAY_SIZE);
@@ -368,7 +368,7 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
if (status != NDIS_STATUS_SUCCESS ||
switchContext->dispatchLock == NULL ||
switchContext->vportArray == NULL ||
- switchContext->nameHashArray == NULL ||
+ switchContext->ovsPortNameHashArray == NULL ||
switchContext->portHashArray == NULL) {
if (switchContext->dispatchLock) {
NdisFreeRWLock(switchContext->dispatchLock);
@@ -376,8 +376,8 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
if (switchContext->vportArray) {
OvsFreeMemory(switchContext->vportArray);
}
- if (switchContext->nameHashArray) {
- OvsFreeMemory(switchContext->nameHashArray);
+ if (switchContext->ovsPortNameHashArray) {
+ OvsFreeMemory(switchContext->ovsPortNameHashArray);
}
if (switchContext->portHashArray) {
OvsFreeMemory(switchContext->portHashArray);
@@ -390,7 +390,7 @@ OvsInitSwitchContext(POVS_SWITCH_CONTEXT switchContext)
}
for (i = 0; i < OVS_MAX_VPORT_ARRAY_SIZE; i++) {
- InitializeListHead(&switchContext->nameHashArray[i]);
+ InitializeListHead(&switchContext->ovsPortNameHashArray[i]);
}
for (i = 0; i < OVS_MAX_VPORT_ARRAY_SIZE; i++) {
InitializeListHead(&switchContext->portHashArray[i]);
@@ -417,7 +417,7 @@ OvsCleanupSwitchContext(POVS_SWITCH_CONTEXT switchContext)
ASSERT(switchContext->numVports == 0);
NdisFreeRWLock(switchContext->dispatchLock);
- OvsFreeMemory(switchContext->nameHashArray);
+ OvsFreeMemory(switchContext->ovsPortNameHashArray);
OvsFreeMemory(switchContext->portHashArray);
OvsFreeMemory(switchContext->vportArray);
OvsDeleteFlowTable(&switchContext->datapath);