datapath-windows: Fixes in HvCreatePort() to re-add a port
authorNithin Raju <nithin@vmware.com>
Wed, 19 Nov 2014 01:42:48 +0000 (17:42 -0800)
committerGurucharan Shetty <gshetty@nicira.com>
Thu, 20 Nov 2014 15:13:52 +0000 (07:13 -0800)
commit25f44d58248cf4ef46303cf3c35fbd28a493b266
treee905de4ed18c364c690cb4e27ef94461c80c51f1
parent8ea43bad3d4bf56d29c1390a9c7f5c8f9cb4e252
datapath-windows: Fixes in HvCreatePort() to re-add a port

In this patch, we update HvCreatePort() to be able to re-add a Hyper-V
port. Specifically, we handle the case where the port had also been
added by OVS userspace, so that when the port was previously deleted
from Hyper-V, we did not deallocate the port.

The key to a vport is its name. We lookup the list of vports both in the
'portIdHashArray' as well as 'portNoHashArray' to make sure that we
don't have a port with the same name.

Validation:
- deleted an re-added a port with and without the corresponding OVS port
existing
- deleted, changed the name of a port, and re-added it back with and
without the corresponding OVS port existing.
- uninstall was succcessful. No asserts hit.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows/ovsext/Vport.c