datapath-windows: Update OVS_SWITCH_CONTEXT: external and internal port
authorAlin Serdean <aserdean@cloudbasesolutions.com>
Thu, 9 Oct 2014 17:46:55 +0000 (17:46 +0000)
committerBen Pfaff <blp@nicira.com>
Thu, 9 Oct 2014 22:47:24 +0000 (15:47 -0700)
The fields externalVport and internalVport of the OVS_SWITCH_CONTEXT
struct are currently defined as PVOID. However, all over the code they
are used as POVS_VPORT_ENTRY. In order to improve clarity and reduce the
need for useless casts to POVS_VPORT_ENTRY, this patch changes the type
from PVOID to POVS_VPORT_ENTRY.

This patch does not cleanup the code that already uses casts to
POVS_VPORT_ENTRY. This cleanup can be done later on as well.

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>
datapath-windows/ovsext/Switch.h

index 5199268..f7acd87 100644 (file)
@@ -53,6 +53,8 @@
 
 #define OVS_HASH_BASIS   0x13578642
 
+typedef struct _OVS_VPORT_ENTRY *POVS_VPORT_ENTRY;
+
 typedef struct _OVS_DATAPATH
 {
    PLIST_ENTRY             flowTable;       // Contains OvsFlows.
@@ -104,8 +106,8 @@ typedef struct _OVS_SWITCH_CONTEXT
 
     NDIS_SWITCH_PORT_ID     externalPortId;
     NDIS_SWITCH_PORT_ID     internalPortId;
-    PVOID                   externalVport;  // the virtual adapter vport
-    PVOID                   internalVport;
+    POVS_VPORT_ENTRY        externalVport;  // the virtual adapter vport
+    POVS_VPORT_ENTRY        internalVport;
 
     PVOID                  *vportArray;
     PLIST_ENTRY             nameHashArray;  // based on ovsName