summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Vport.h
diff options
context:
space:
mode:
authorNithin Raju <nithin@vmware.com>2015-11-25 12:00:58 -0800
committerGurucharan Shetty <gshetty@nicira.com>2015-11-25 13:54:41 -0800
commitd49b001d137eba8296d3f9581c91fea8067c4352 (patch)
tree473e937f7b6048245d603dcb7c529a4f6d33f805 /datapath-windows/ovsext/Vport.h
parent34be96cabf1e0ef684764feaa797ee410c86b049 (diff)
downloadopenvswitch-d49b001d137eba8296d3f9581c91fea8067c4352.tar.gz
datapath-windows: Fix HvUpdateNic() to handle name changes
If the name of an internal or external NIC changes, we need to disconnect the NIC from OVS since the name is the key. In this change, we generate a link down event. It is as though we got a call to HvDisconnectNic() for the old name and got a HvConnectNic() for the new name. Also, HvCreateNic() has been cleaned up to remove the code to look for existing vport. We won't have a vport now since we'd have deleted the vport in HvDeleteNic(). Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/Vport.h')
-rw-r--r--datapath-windows/ovsext/Vport.h34
1 files changed, 31 insertions, 3 deletions
diff --git a/datapath-windows/ovsext/Vport.h b/datapath-windows/ovsext/Vport.h
index 0d56484ae..e9f3b0389 100644
--- a/datapath-windows/ovsext/Vport.h
+++ b/datapath-windows/ovsext/Vport.h
@@ -95,6 +95,7 @@ typedef struct _OVS_VPORT_ENTRY {
PVOID priv;
NDIS_SWITCH_PORT_ID portId;
NDIS_SWITCH_NIC_INDEX nicIndex;
+ NDIS_SWITCH_NIC_TYPE nicType;
UINT16 numaNodeId;
NDIS_SWITCH_PORT_STATE portState;
NDIS_SWITCH_NIC_STATE nicState;
@@ -194,14 +195,41 @@ OvsIsInternalVportType(OVS_VPORT_TYPE ovsType)
}
static __inline BOOLEAN
+OvsIsVirtualExternalVport(POVS_VPORT_ENTRY vport)
+{
+ return vport->nicType == NdisSwitchNicTypeExternal &&
+ vport->nicIndex == 0;
+}
+
+static __inline BOOLEAN
+OvsIsRealExternalVport(POVS_VPORT_ENTRY vport)
+{
+ return vport->nicType == NdisSwitchNicTypeExternal &&
+ vport->nicIndex != 0;
+}
+
+static __inline BOOLEAN
OvsIsBridgeInternalVport(POVS_VPORT_ENTRY vport)
{
- if (vport->isBridgeInternal) {
- ASSERT(vport->ovsType == OVS_VPORT_TYPE_INTERNAL);
- }
+ ASSERT(vport->isBridgeInternal != TRUE ||
+ vport->ovsType == OVS_VPORT_TYPE_INTERNAL);
return vport->isBridgeInternal == TRUE;
}
+static __inline BOOLEAN
+OvsIsInternalNIC(NDIS_SWITCH_NIC_TYPE nicType)
+{
+ return nicType == NdisSwitchNicTypeInternal;
+}
+
+static __inline BOOLEAN
+OvsIsRealExternalNIC(NDIS_SWITCH_NIC_TYPE nicType,
+ NDIS_SWITCH_NIC_INDEX nicIndex)
+{
+ return nicType == NdisSwitchNicTypeExternal &&
+ nicIndex != 0;
+}
+
NTSTATUS OvsRemoveAndDeleteVport(PVOID usrParamsCtx,
POVS_SWITCH_CONTEXT switchContext,
POVS_VPORT_ENTRY vport,