summaryrefslogtreecommitdiff
path: root/datapath-windows
diff options
context:
space:
mode:
authorNithin Raju <nithin@vmware.com>2014-11-19 19:41:22 -0800
committerGurucharan Shetty <gshetty@nicira.com>2014-11-20 09:32:18 -0800
commit66d9484fd7bbf086ee91cbcb55d29ac68fcdf561 (patch)
tree527e7b5b8f8233e38394e54ab1bd19e79c007e51 /datapath-windows
parent741224c9a2de24d23fdf1352e34681a8026e71f1 (diff)
downloadopenvswitch-66d9484fd7bbf086ee91cbcb55d29ac68fcdf561.tar.gz
datapath-windows: rename 'hvDeleted' to 'isPresentOnHv'
'hvDeleted' was originally added to track vports that got deleted from the Hyper-V switch, but which still exists in OVS. Since then, it has taken a new meaning: eg. it is set to TRUE for VXLAN ports which don't exist on the Hyper-V switch at all. Hence renaming it to something more appropriate. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Diffstat (limited to 'datapath-windows')
-rw-r--r--datapath-windows/ovsext/Datapath.c2
-rw-r--r--datapath-windows/ovsext/Vport.c14
-rw-r--r--datapath-windows/ovsext/Vport.h3
3 files changed, 10 insertions, 9 deletions
diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c
index cd7da079e..bdbf72c27 100644
--- a/datapath-windows/ovsext/Datapath.c
+++ b/datapath-windows/ovsext/Datapath.c
@@ -1820,7 +1820,7 @@ OvsNewVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
* Allow the vport to be deleted, because there is no
* corresponding hyper-v switch part.
*/
- vport->hvDeleted = TRUE;
+ vport->isPresentOnHv = TRUE;
}
}
diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c
index 52208b512..77a714845 100644
--- a/datapath-windows/ovsext/Vport.c
+++ b/datapath-windows/ovsext/Vport.c
@@ -103,7 +103,7 @@ HvCreatePort(POVS_SWITCH_CONTEXT switchContext,
vport = OvsFindVportByHvNameW(gOvsSwitchContext,
portParam->PortFriendlyName.String,
portParam->PortFriendlyName.Length);
- if (vport && vport->hvDeleted == FALSE) {
+ if (vport && vport->isPresentOnHv == FALSE) {
OVS_LOG_ERROR("Port add failed since a port already exists on "
"the specified port Id: %u, ovsName: %s",
portParam->PortId, vport->ovsName);
@@ -112,7 +112,7 @@ HvCreatePort(POVS_SWITCH_CONTEXT switchContext,
}
if (vport != NULL) {
- ASSERT(vport->hvDeleted);
+ ASSERT(vport->isPresentOnHv);
ASSERT(vport->portNo != OVS_DPPORT_NUMBER_INVALID);
/*
@@ -127,7 +127,7 @@ HvCreatePort(POVS_SWITCH_CONTEXT switchContext,
status = STATUS_DATA_NOT_ACCEPTED;
goto create_port_done;
}
- vport->hvDeleted = FALSE;
+ vport->isPresentOnHv = FALSE;
} else {
vport = (POVS_VPORT_ENTRY)OvsAllocateVport();
if (vport == NULL) {
@@ -709,7 +709,7 @@ OvsAllocateVport(VOID)
}
RtlZeroMemory(vport, sizeof (OVS_VPORT_ENTRY));
vport->ovsState = OVS_STATE_UNKNOWN;
- vport->hvDeleted = FALSE;
+ vport->isPresentOnHv = FALSE;
vport->portNo = OVS_DPPORT_NUMBER_INVALID;
InitializeListHead(&vport->ovsNameLink);
@@ -1114,7 +1114,7 @@ OvsRemoveAndDeleteVport(POVS_SWITCH_CONTEXT switchContext,
*
* Both 'hvDelete' and 'ovsDelete' can be set to TRUE by the caller.
*/
- if (vport->hvDeleted == TRUE) {
+ if (vport->isPresentOnHv == TRUE) {
deletedOnHv = TRUE;
}
if (vport->portNo == OVS_DPPORT_NUMBER_INVALID) {
@@ -1122,7 +1122,7 @@ OvsRemoveAndDeleteVport(POVS_SWITCH_CONTEXT switchContext,
}
if (hvDelete && !deletedOnHv) {
- vport->hvDeleted = TRUE;
+ vport->isPresentOnHv = TRUE;
/* Remove the port from the relevant lists. */
RemoveEntryList(&vport->portIdLink);
@@ -1315,7 +1315,7 @@ OvsClearAllSwitchVports(POVS_SWITCH_CONTEXT switchContext)
vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portNoLink);
ASSERT(OvsIsTunnelVportType(vport->ovsType) ||
(vport->ovsType == OVS_VPORT_TYPE_INTERNAL &&
- vport->isBridgeInternal) || vport->hvDeleted == TRUE);
+ vport->isBridgeInternal) || vport->isPresentOnHv == TRUE);
OvsRemoveAndDeleteVport(switchContext, vport, TRUE, TRUE, NULL);
}
}
diff --git a/datapath-windows/ovsext/Vport.h b/datapath-windows/ovsext/Vport.h
index 724b126c8..348fbfd7d 100644
--- a/datapath-windows/ovsext/Vport.h
+++ b/datapath-windows/ovsext/Vport.h
@@ -129,7 +129,8 @@ typedef struct _OVS_VPORT_ENTRY {
BOOLEAN isExternal;
UINT32 upcallPid; /* netlink upcall port id */
PNL_ATTR portOptions;
- BOOLEAN hvDeleted; /* is the hyper-v switch port deleted? */
+ BOOLEAN isPresentOnHv; /* Is this port present on the
+ Hyper-V switch? */
} OVS_VPORT_ENTRY, *POVS_VPORT_ENTRY;
struct _OVS_SWITCH_CONTEXT;