datapath-windows: rename 'hvDeleted' to 'isPresentOnHv'
authorNithin Raju <nithin@vmware.com>
Thu, 20 Nov 2014 03:41:22 +0000 (19:41 -0800)
committerGurucharan Shetty <gshetty@nicira.com>
Thu, 20 Nov 2014 17:32:18 +0000 (09:32 -0800)
'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>
datapath-windows/ovsext/Datapath.c
datapath-windows/ovsext/Vport.c
datapath-windows/ovsext/Vport.h

index cd7da07..bdbf72c 100644 (file)
@@ -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;
         }
     }
 
index 52208b5..77a7148 100644 (file)
@@ -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);
         }
     }
index 724b126..348fbfd 100644 (file)
@@ -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;