summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Vport.h
diff options
context:
space:
mode:
authorNithin Raju <nithin@vmware.com>2014-10-23 17:33:10 -0700
committerBen Pfaff <blp@nicira.com>2014-10-28 08:39:13 -0700
commit7434992b73bbcbc9d1f9cbe6a74f270ad434a7fb (patch)
treea994be4f073f333665344a86fae890edc44d0433 /datapath-windows/ovsext/Vport.h
parent25e39a6047f19b84612bfa8bb28b573c7a3f02bc (diff)
downloadopenvswitch-7434992b73bbcbc9d1f9cbe6a74f270ad434a7fb.tar.gz
datapath-windows: Introduce bridge-internal ports.
In this patch, we provide explanation and the reasoning for bridge-internal ports. The code to add such a port in come in later patch in the series. We also fix some formatting issues in PacketIO.c. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/Vport.h')
-rw-r--r--datapath-windows/ovsext/Vport.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Vport.h b/datapath-windows/ovsext/Vport.h
index 9fe9f54c9..73ab80fb6 100644
--- a/datapath-windows/ovsext/Vport.h
+++ b/datapath-windows/ovsext/Vport.h
@@ -32,6 +32,11 @@
*/
#define OVS_DPPORT_NUMBER_LOCAL 0
+#define OVS_DPPORT_INTERNAL_NAME_A "internal"
+#define OVS_DPPORT_INTERNAL_NAME_W L"internal"
+#define OVS_DPPORT_EXTERNAL_NAME_A "external"
+#define OVS_DPPORT_EXTERNAL_NAME_W L"external"
+
/*
* A Vport, or Virtual Port, is a port on the OVS. It can be one of the
* following types. Some of the Vports are "real" ports on the hyper-v switch,
@@ -106,6 +111,21 @@ typedef struct _OVS_VPORT_ENTRY {
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;
@@ -165,6 +185,15 @@ OvsIsInternalVportType(OVS_VPORT_TYPE ovsType)
return ovsType == OVS_VPORT_TYPE_INTERNAL;
}
+static __inline BOOLEAN
+OvsIsBridgeInternalVport(POVS_VPORT_ENTRY vport)
+{
+ if (vport->isBridgeInternal) {
+ ASSERT(vport->ovsType == OVS_VPORT_TYPE_INTERNAL);
+ }
+ return vport->isBridgeInternal == TRUE;
+}
+
static __inline UINT32
OvsGetExternalMtu()
{