From 35f20164e225240e443b9140313ce75539c841d3 Mon Sep 17 00:00:00 2001 From: Nithin Raju Date: Thu, 23 Oct 2014 17:33:13 -0700 Subject: datapath-windows: Update vport add code. In this patch, we make the following updates to the vport add code: 1. Clarify the roles of the different hash tables, so it is easier to read/write code in the future. 2. Update OvsNewVportCmdHandler() to support adding bridge-internal ports. 3. Fixes in OvsNewVportCmdHandler() to support adding external port. Earlier, we'd hit ASSERTs. 4. I could not figure out way to add a port of type OVS_PORT_TYPE_INTERNAL with name "internal" to the confdb using ovs-vsctl.exe. And, this is needed in order to add the Hyper-V internal port from userspace. To workaround this problem, we treat a port of type OVS_PORT_TYPE_NETDEV with name "internal" as a request to add the Hyper-V internal port. This is a workaround. The end result is that there's a discrepancy between the port type in the datpaath v/s confdb, but this has not created any trouble in testing so far. If this ends up becoming an issue, we can mark the Hyper-V internal port to be of type OVS_PORT_TYPE_NETDEV. No harm. 5. Because of changes indicated in #1, we also update the vport dump code to look at the correct hash table for ports added from userspace. 6. Add a OvsGetTunnelVport() for convenience. 7. Update ASSERTs() while cleaning up the switch. 8. Nuke OvsGetExternalVport() and OvsGetExternalMtu(). Signed-off-by: Nithin Raju Acked-by: Alin Gabriel Serdean Tested-by: Alin Gabriel Serdean Acked-by: Ankur Sharma Signed-off-by: Ben Pfaff --- datapath-windows/ovsext/Switch.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'datapath-windows/ovsext/Switch.c') diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index a540926e8..2b68037c2 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -433,6 +433,7 @@ OvsUninitSwitchContext(POVS_SWITCH_CONTEXT switchContext) /* We need to do cleanup for tunnel port here. */ ASSERT(switchContext->numHvVports == 0); + ASSERT(switchContext->numNonHvVports == 0); NdisFreeRWLock(switchContext->dispatchLock); switchContext->dispatchLock = NULL; @@ -493,12 +494,6 @@ cleanup: return status; } -PVOID -OvsGetExternalVport() -{ - return gOvsSwitchContext->virtualExternalVport; -} - /* * -------------------------------------------------------------------------- -- cgit v1.2.1