According to the microsoft doc:
https://docs.microsoft.com/en-us/windows-hardware/drivers/network/hyper-v-extensible-switch-port-and-network-adapter-states
Below OID request sequence is validation:
         OID_SWITCH_NIC_CONNECT -> OID_SWITCH_NIC_DISCONNECT
                  ^                           |
                  |                           V
         OID_SWITCH_NIC_CREATE  <- OID_SWITCH_NIC_DELETE

In above sequence, the windows extensible switch interface assumes the
OID_SWITCH_PORT_CREATE has issued and the port has been created
successfully. If delete the internal port in HvDisconnectNic(),
HvCreateNic() will fail when received OID_SWITCH_NIC_CREATE late because
there is no corresponding port.

Signed-off-by: Jinjun Gao <[email protected]>
---
datapath-windows/ovsext/Vport.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c
index 57e7510..c3362d7 100644
--- a/datapath-windows/ovsext/Vport.c
+++ b/datapath-windows/ovsext/Vport.c
@@ -640,8 +640,14 @@ HvDisconnectNic(POVS_SWITCH_CONTEXT switchContext,
     if (isInternalPort) {
         OvsUnBindVportWithIpHelper(vport, switchContext);
-        OvsRemoveAndDeleteVport(NULL, switchContext, vport, TRUE, TRUE);
-        OvsPostVportEvent(&event);
+        /*
+         * Don't delete the port from the hash tables here for internal port
+         * because the internal port cannot be recreated in HvCreateNic(). It
+         * only can be created in HvCreatePort() by issuing
+         * OID_SWITCH_PORT_CREATE. We should wait extensible switch interface
+         * to issue OID_SWITCH_PORT_TEARDOWN and OID_SWITCH_PORT_DELETE to
+         * delete the internal port.
+         */
     }
     NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
--
1.8.5.6
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to