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>
vport = OvsFindVportByHvNameW(gOvsSwitchContext,
portParam->PortFriendlyName.String,
portParam->PortFriendlyName.Length);
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);
OVS_LOG_ERROR("Port add failed since a port already exists on "
"the specified port Id: %u, ovsName: %s",
portParam->PortId, vport->ovsName);
- ASSERT(vport->isPresentOnHv);
+ ASSERT(vport->isAbsentOnHv);
ASSERT(vport->portNo != OVS_DPPORT_NUMBER_INVALID);
/*
ASSERT(vport->portNo != OVS_DPPORT_NUMBER_INVALID);
/*
status = STATUS_DATA_NOT_ACCEPTED;
goto create_port_done;
}
status = STATUS_DATA_NOT_ACCEPTED;
goto create_port_done;
}
- vport->isPresentOnHv = FALSE;
+ vport->isAbsentOnHv = FALSE;
} else {
vport = (POVS_VPORT_ENTRY)OvsAllocateVport();
if (vport == NULL) {
} else {
vport = (POVS_VPORT_ENTRY)OvsAllocateVport();
if (vport == NULL) {
}
RtlZeroMemory(vport, sizeof (OVS_VPORT_ENTRY));
vport->ovsState = OVS_STATE_UNKNOWN;
}
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);
vport->portNo = OVS_DPPORT_NUMBER_INVALID;
InitializeListHead(&vport->ovsNameLink);
switch (vport->ovsType) {
case OVS_VPORT_TYPE_INTERNAL:
if (!vport->isBridgeInternal) {
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();
switchContext->internalPortId = 0;
switchContext->internalVport = NULL;
OvsInternalAdapterDown();
*
* Both 'hvDelete' and 'ovsDelete' can be set to TRUE by the caller.
*/
*
* 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) {
deletedOnHv = TRUE;
}
if (vport->portNo == OVS_DPPORT_NUMBER_INVALID) {
}
if (hvDelete && !deletedOnHv) {
}
if (hvDelete && !deletedOnHv) {
- vport->isPresentOnHv = TRUE;
+ vport->isAbsentOnHv = TRUE;
if (vport->isExternal) {
ASSERT(vport->nicIndex != 0);
if (vport->isExternal) {
ASSERT(vport->nicIndex != 0);
vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY, portNoLink);
ASSERT(OvsIsTunnelVportType(vport->ovsType) ||
(vport->ovsType == OVS_VPORT_TYPE_INTERNAL &&
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);
}
}
OvsRemoveAndDeleteVport(NULL, switchContext, vport, TRUE, TRUE);
}
}
* Allow the vport to be deleted, because there is no
* corresponding hyper-v switch part.
*/
* Allow the vport to be deleted, because there is no
* corresponding hyper-v switch part.
*/
- vport->isPresentOnHv = TRUE;
+ vport->isAbsentOnHv = TRUE;
- ASSERT(vport->isPresentOnHv == TRUE);
+ ASSERT(vport->isAbsentOnHv == TRUE);
ASSERT(vport->portNo != OVS_DPPORT_NUMBER_INVALID);
/* Remove the port from the relevant lists. */
ASSERT(vport->portNo != OVS_DPPORT_NUMBER_INVALID);
/* Remove the port from the relevant lists. */
* Allow the vport to be deleted, because there is no
* corresponding hyper-v switch part.
*/
* 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) {
/*
if (vportAttrs[OVS_VPORT_ATTR_PORT_NO] != NULL) {
/*
BOOLEAN isExternal;
UINT32 upcallPid; /* netlink upcall port id */
PNL_ATTR portOptions;
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;
Hyper-V switch? */
} OVS_VPORT_ENTRY, *POVS_VPORT_ENTRY;