summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Vport.h
diff options
context:
space:
mode:
authorAlin Serdean <aserdean@cloudbasesolutions.com>2016-12-20 19:42:19 +0000
committerGurucharan Shetty <guru@ovn.org>2016-12-20 12:22:48 -0800
commitcd30b3460ac53719a6b8aaaba89b29c0304ac335 (patch)
treeddf8a6e75efbdf59ef999bba6ded22eff01be3c1 /datapath-windows/ovsext/Vport.h
parentda467899ab6e67b645840195a64600d1484d0dce (diff)
downloadopenvswitch-cd30b3460ac53719a6b8aaaba89b29c0304ac335.tar.gz
datapath-windows: Add multiple switch internal ports
This patch adds multiple internal ports support to the windows datapath. All tunnels types have been updated to accommodate this new functionality. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Co-authored-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Paul Boca <pboca@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/Vport.h')
-rw-r--r--datapath-windows/ovsext/Vport.h104
1 files changed, 42 insertions, 62 deletions
diff --git a/datapath-windows/ovsext/Vport.h b/datapath-windows/ovsext/Vport.h
index 1f4968ee7..4dc4e0094 100644
--- a/datapath-windows/ovsext/Vport.h
+++ b/datapath-windows/ovsext/Vport.h
@@ -26,7 +26,7 @@
#define OVS_MAX_DPPORTS MAXUINT16
#define OVS_DPPORT_NUMBER_INVALID OVS_MAX_DPPORTS
/*
- * The local port (0) is a reserved port, that is not allowed to be be
+ * The local port (0) is a reserved port, that is not allowed to be
* created by the netlink command vport add. On linux, this port is created
* at netlink command datapath new. However, on windows, we do not need to
* create it, and more, we shouldn't. The userspace attempts to create two
@@ -80,58 +80,44 @@ typedef struct _OVS_VPORT_FULL_STATS {
* tunnel type, such as vxlan, gre
*/
typedef struct _OVS_VPORT_ENTRY {
- LIST_ENTRY ovsNameLink;
- LIST_ENTRY portIdLink;
- LIST_ENTRY portNoLink;
- LIST_ENTRY tunnelVportLink;
-
- OVS_VPORT_STATE ovsState;
- OVS_VPORT_TYPE ovsType;
- OVS_VPORT_STATS stats;
- OVS_VPORT_ERR_STATS errStats;
- UINT32 portNo;
- UINT32 mtu;
+ LIST_ENTRY ovsNameLink;
+ LIST_ENTRY portIdLink;
+ LIST_ENTRY portNoLink;
+ LIST_ENTRY tunnelVportLink;
+
+ OVS_VPORT_STATE ovsState;
+ OVS_VPORT_TYPE ovsType;
+ OVS_VPORT_STATS stats;
+ OVS_VPORT_ERR_STATS errStats;
+ UINT32 portNo;
+ UINT32 mtu;
/* ovsName is the ovs (datapath) port name - it is null terminated. */
- CHAR ovsName[OVS_MAX_PORT_NAME_LENGTH];
-
- 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;
- NDIS_SWITCH_PORT_TYPE portType;
-
- UINT8 permMacAddress[ETH_ADDR_LEN];
- UINT8 currMacAddress[ETH_ADDR_LEN];
- UINT8 vmMacAddress[ETH_ADDR_LEN];
-
- NDIS_SWITCH_PORT_NAME hvPortName;
- IF_COUNTED_STRING portFriendlyName;
- NDIS_SWITCH_NIC_NAME nicName;
- NDIS_VM_NAME vmName;
- GUID netCfgInstanceId;
- /*
- * OVS userpace has a notion of bridges which basically defines an
- * L2-domain. Each "bridge" has an "internal" port of type
- * OVS_VPORT_TYPE_INTERNAL. Such a port is connected to the OVS datapath in
- * one end, and the other end is a virtual adapter on the hypervisor host.
- * This is akin to the Hyper-V "internal" NIC. It is intuitive to map the
- * Hyper-V "internal" NIC to the OVS bridge's "internal" port, but there's
- * only one Hyper-V NIC but multiple bridges. To support multiple OVS bridge
- * "internal" ports, we use the flag 'isBridgeInternal' in each vport. We
- * support addition of multiple bridge-internal ports. A vport with
- * 'isBridgeInternal' == TRUE is a dummy port and has no backing currently.
- * If a flow actions specifies the output port to be a bridge-internal port,
- * the port is silently ignored.
- */
- BOOLEAN isBridgeInternal;
- BOOLEAN isExternal;
- UINT32 upcallPid; /* netlink upcall port id */
- PNL_ATTR portOptions;
- BOOLEAN isAbsentOnHv; /* Is this port present on the
- Hyper-V switch? */
+ CHAR ovsName[OVS_MAX_PORT_NAME_LENGTH];
+
+ 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;
+ NDIS_SWITCH_PORT_TYPE portType;
+
+ UINT8 permMacAddress[ETH_ADDR_LEN];
+ UINT8 currMacAddress[ETH_ADDR_LEN];
+ UINT8 vmMacAddress[ETH_ADDR_LEN];
+
+ NDIS_SWITCH_PORT_NAME hvPortName;
+ IF_COUNTED_STRING portFriendlyName;
+ NDIS_SWITCH_NIC_NAME nicName;
+ NDIS_SWITCH_NIC_FRIENDLYNAME nicFriendlyName;
+ NDIS_VM_NAME vmName;
+ GUID netCfgInstanceId;
+ BOOLEAN isExternal;
+ UINT32 upcallPid; /* netlink upcall port id */
+ PNL_ATTR portOptions;
+ BOOLEAN isAbsentOnHv; /* Is this port present on the
+ Hyper-V switch? */
} OVS_VPORT_ENTRY, *POVS_VPORT_ENTRY;
struct _OVS_SWITCH_CONTEXT;
@@ -143,6 +129,8 @@ POVS_VPORT_ENTRY OvsFindVportByOvsName(POVS_SWITCH_CONTEXT switchContext,
PSTR name);
POVS_VPORT_ENTRY OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext,
PSTR name);
+POVS_VPORT_ENTRY OvsFindVportByHvNameW(POVS_SWITCH_CONTEXT switchContext,
+ PWSTR wsName, SIZE_T wstrSize);
POVS_VPORT_ENTRY OvsFindVportByPortIdAndNicIndex(POVS_SWITCH_CONTEXT switchContext,
NDIS_SWITCH_PORT_ID portId,
NDIS_SWITCH_NIC_INDEX index);
@@ -217,14 +205,6 @@ OvsIsRealExternalVport(POVS_VPORT_ENTRY vport)
}
static __inline BOOLEAN
-OvsIsBridgeInternalVport(POVS_VPORT_ENTRY vport)
-{
- 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;
@@ -261,7 +241,7 @@ GetPortFromPriv(POVS_VPORT_ENTRY vport)
UINT16 dstPort = 0;
PVOID vportPriv = GetOvsVportPriv(vport);
- /* XXX would better to have a commom tunnel "parent" structure */
+ /* XXX would better to have a common tunnel "parent" structure */
ASSERT(vportPriv);
switch(vport->ovsType) {
case OVS_VPORT_TYPE_GRE:
@@ -273,7 +253,7 @@ GetPortFromPriv(POVS_VPORT_ENTRY vport)
dstPort = ((POVS_VXLAN_VPORT)vportPriv)->dstPort;
break;
case OVS_VPORT_TYPE_GENEVE:
- dstPort = ((POVS_GENEVE_VPORT) vportPriv)->dstPort;
+ dstPort = ((POVS_GENEVE_VPORT)vportPriv)->dstPort;
break;
default:
ASSERT(! "Port is not a tunnel port");