summaryrefslogtreecommitdiff
path: root/datapath-windows
diff options
context:
space:
mode:
authorNithin Raju <nithin@vmware.com>2015-06-26 11:51:29 -0700
committerBen Pfaff <blp@nicira.com>2015-07-01 14:13:46 -0700
commit421e24220fc9493683f75fafc7e2ced8ba60bf30 (patch)
tree94de54bc0c6dec8c78897410c799ba84532dbf1e /datapath-windows
parentb8155080abc546d3d0cac3f316929904e8737bc8 (diff)
downloadopenvswitch-421e24220fc9493683f75fafc7e2ced8ba60bf30.tar.gz
datapath-windows: Rename 'vport->isPresentOnHv' to 'isAbsentOnHv'
Looking at the code, the flag 'vport->isPresentOnHv' is actually indicating if the vport is present on the Hyper-V switch or not, but the logic seems to be inverse. 'isPresentOnHv == TRUE' indicates that the vport is not present on the Hyper-V switch. Eg. VXLAN port, would have isPresentOnHv == TRUE. In this patch, we rename the variable to reflect its meaning. vport->isAbsentOnHv is TRUE iff: - vport is bridge internal port - vport is tunnel port - vport was added from Hyper-V and also from OVS, but got deleted from Hyper-V Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows')
-rw-r--r--datapath-windows/ovsext/Vport.c22
-rw-r--r--datapath-windows/ovsext/Vport.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c
index a2762125d..43154641f 100644
--- a/datapath-windows/ovsext/Vport.c
+++ b/datapath-windows/ovsext/Vport.c
@@ -129,7 +129,7 @@ HvCreatePort(POVS_SWITCH_CONTEXT switchContext,
vport = OvsFindVportByHvNameW(gOvsSwitchContext,
portParam->PortFriendlyName.String,
portParam->PortFriendlyName.Length);
- if (vport && vport->isPresentOnHv == FALSE) {
+ if (vport && vport->isAbsentOnHv == FALSE) {
OVS_LOG_ERROR("Port add failed since a port already exists on "
"the specified port Id: %u, ovsName: %s",
portParam->PortId, vport->ovsName);
@@ -138,7 +138,7 @@ HvCreatePort(POVS_SWITCH_CONTEXT switchContext,
}
if (vport != NULL) {
- ASSERT(vport->isPresentOnHv);
+ ASSERT(vport->isAbsentOnHv);
ASSERT(vport->portNo != OVS_DPPORT_NUMBER_INVALID);
/*
@@ -153,7 +153,7 @@ HvCreatePort(POVS_SWITCH_CONTEXT switchContext,
status = STATUS_DATA_NOT_ACCEPTED;
goto create_port_done;
}
- vport->isPresentOnHv = FALSE;
+ vport->isAbsentOnHv = FALSE;
} else {
vport = (POVS_VPORT_ENTRY)OvsAllocateVport();
if (vport == NULL) {
@@ -759,7 +759,7 @@ OvsAllocateVport(VOID)
}
RtlZeroMemory(vport, sizeof (OVS_VPORT_ENTRY));
vport->ovsState = OVS_STATE_UNKNOWN;
- vport->isPresentOnHv = FALSE;
+ vport->isAbsentOnHv = FALSE;
vport->portNo = OVS_DPPORT_NUMBER_INVALID;
InitializeListHead(&vport->ovsNameLink);
@@ -1152,7 +1152,7 @@ OvsRemoveAndDeleteVport(PVOID usrParamsContext,
switch (vport->ovsType) {
case OVS_VPORT_TYPE_INTERNAL:
if (!vport->isBridgeInternal) {
- if (hvDelete && vport->isPresentOnHv == FALSE) {
+ if (hvDelete && vport->isAbsentOnHv == FALSE) {
switchContext->internalPortId = 0;
switchContext->internalVport = NULL;
OvsInternalAdapterDown();
@@ -1200,7 +1200,7 @@ OvsRemoveAndDeleteVport(PVOID usrParamsContext,
*
* Both 'hvDelete' and 'ovsDelete' can be set to TRUE by the caller.
*/
- if (vport->isPresentOnHv == TRUE) {
+ if (vport->isAbsentOnHv == TRUE) {
deletedOnHv = TRUE;
}
if (vport->portNo == OVS_DPPORT_NUMBER_INVALID) {
@@ -1208,7 +1208,7 @@ OvsRemoveAndDeleteVport(PVOID usrParamsContext,
}
if (hvDelete && !deletedOnHv) {
- vport->isPresentOnHv = TRUE;
+ vport->isAbsentOnHv = TRUE;
if (vport->isExternal) {
ASSERT(vport->nicIndex != 0);
@@ -1447,7 +1447,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->isPresentOnHv == TRUE);
+ vport->isBridgeInternal) || vport->isAbsentOnHv == TRUE);
OvsRemoveAndDeleteVport(NULL, switchContext, vport, TRUE, TRUE);
}
}
@@ -2198,7 +2198,7 @@ OvsNewVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
* Allow the vport to be deleted, because there is no
* corresponding hyper-v switch part.
*/
- vport->isPresentOnHv = TRUE;
+ vport->isAbsentOnHv = TRUE;
} else {
goto Cleanup;
}
@@ -2523,7 +2523,7 @@ OvsTunnelVportPendingRemove(PVOID context,
}
}
- ASSERT(vport->isPresentOnHv == TRUE);
+ ASSERT(vport->isAbsentOnHv == TRUE);
ASSERT(vport->portNo != OVS_DPPORT_NUMBER_INVALID);
/* Remove the port from the relevant lists. */
@@ -2600,7 +2600,7 @@ OvsTunnelVportPendingInit(PVOID context,
* Allow the vport to be deleted, because there is no
* corresponding hyper-v switch part.
*/
- vport->isPresentOnHv = TRUE;
+ vport->isAbsentOnHv = TRUE;
if (vportAttrs[OVS_VPORT_ATTR_PORT_NO] != NULL) {
/*
diff --git a/datapath-windows/ovsext/Vport.h b/datapath-windows/ovsext/Vport.h
index 3ea3d0303..4c6e858b1 100644
--- a/datapath-windows/ovsext/Vport.h
+++ b/datapath-windows/ovsext/Vport.h
@@ -132,7 +132,7 @@ typedef struct _OVS_VPORT_ENTRY {
BOOLEAN isExternal;
UINT32 upcallPid; /* netlink upcall port id */
PNL_ATTR portOptions;
- BOOLEAN isPresentOnHv; /* Is this port present on the
+ BOOLEAN isAbsentOnHv; /* Is this port present on the
Hyper-V switch? */
} OVS_VPORT_ENTRY, *POVS_VPORT_ENTRY;