summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/IpHelper.c
Commit message (Collapse)AuthorAgeFilesLines
* datapath-windows: Add IPv6 Geneve tunnel support in WindowsWilson Peng2022-04-101-167/+315
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the first step OVS Windows will support IPv6 tunnel(Geneve IPv6 tunnel). Implementation on Windows ------------------------- 1. For the IPv6 tunnel support,  OvsIPTunnelKey will replace original OvsIPv4TunnelKey in the related flow context handing. 2. The related src and dst address will be  changed to SOCKADDR_INET type from UINT32. 3. For the IPv6 tunnel,  one node running OVS-Windows could encapsulate IPv4/IPv6 Packets via IPV6 Geneve Tunnel, and the node could also encapsulate IPv4/IPv6 packet Via IPv4 Geneve tunnel. 4. Related IPHelper data structure will be adapted to support IPv6 Tunnel. In the IPHelper part the related Windows API(such as GetUnicastIpAddressTable/GetBestRoute2/GetIpNetEntry2/ ResolveIpNetEntry2) and Windows data structure(MIB_IPFORWARD_ROW2/MIB_IPNET_ROW2/IP_ADDRESS_PREFIX) Have already supported both IPv4 and IPV6. Now OVS Windows has been adjusted some functions And data structured to support IPV6 tunnel also. 5. OVS_TUNNEL_KEY_ATTR_IPV6_SRC and OVS_TUNNEL_KEY_ATTR_IPV6_DST filed will be supported in OVS-Windows kernel for IPV6 tunnel. Testing done. ------------------------- Related topo, 1 Windows VM(Win2019) and 2 Ubuntu 16.04 server. Both VMs Are running on one ESX host. 1. Setup one IPV6 Geneve Tunnel between 1 Windows VM and 1 Ubuntu server. Windows VM, vif0( 6000::2/40.1.1.10) vif1(5000::2)—— Ubuntu VM Eth2(5000::9), name space ns1 with interface ns1_link_peer(6000::9/40.1.1.2) Related tunnnel, ovs-vsctl.exe add-port br-int bms-tun0 -- set interface bms-tun0 type=Geneve options:csum=true options:key=flow options:local_ip="5000::2" options:remote_ip=flow In this topo, traffic from Vif0(Win) to ns1_link_peer(Ubuntu) will be gone through the Geneve tunnel (5000::2—>5000::9) for both IPv4 traffic(40.1.1.10-->40.1.1.2) and IPv6 traffic(6000::2—>6000::9) 2. Setup one IPV4 Geneve Tunnel between Windows VM and 1 Ubuntu server. Windows VM, vif0( 6000::2/40.1.1.10) vif1(50.1.1.11)—— Ubuntu, Eth2(50.1.1.9), name space ns1 with interface ns1_link_peer(6000::19/40.1.1.9) Related tunnnel, ovs-vsctl.exe -- set Interface bms-tun0 type=geneve options:csum=true options:key=flow options:local_ip="50.1.1.11" options:remote_ip=flow In this topo, traffic from Vif0(Win) to ns1_link_peer(Ubuntu) will be gone through the Geneve Tunnel (50.1.1.11—>50.1.1.9) for both IPv4 traffic(40.1.1.10-->40.1.1.9) and IPv6 traffic(6000::2—>6000::19). 3.Regression test for IpV4 in Antrea project (about 60 test case) is PASS Future Work ----------- Add other type IPv6 tunnel support for Gre/Vxlan/Stt. Signed-off-by: Wilson Peng <pweisong@vmware.com> Signed-off-by: Alin-Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Remove IP neighbor entries when internal adapter is down.Anand Kumar2018-10-241-18/+18
| | | | | | | | | | | | | Remove the IP neighboring entries when adapter is down, so that when 'OVS_IPHELPER_INSTANCE' is deleted, no stale entries are present Also fix accessing iphelper instance without acquiring the lock. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Tested-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Move OVS_IPHELPER_INSTANCE to IpHelper.hSairam Venugopal2018-10-021-30/+2
| | | | | | | | | | | | Move the IPHelper Instance to the main header file and update the usage to explicitly point to POVS_IPHELPER_INSTANCE instead of PVOID. Also rename the ipn->context to ipn->instance to make it more readable. Found by inspection. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* treewide: Remove pointless "return;" at ends of functions.Ben Pfaff2018-07-091-6/+0
| | | | | | | | | Found with: git ls-files | xargs pcregrep -n -M 'return;\n*}' Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Darrell Ball <dlu998@gmail.com> Tested-by: Darrell Ball <dlu998@gmail.com>
* datapath-windows: Fix static analysis warnings around ovsInstanceListLockAlin Serdean2017-11-291-4/+7
| | | | | | | | | Check for return value when trying to initialize ovsInstanceListLock. Also return the status back to caller of `OvsInitIpHelper`. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Shashank Ram <shashank08@gmail.com>
* datapath-windows: prettify logging in iphelperAlin Serdean2017-11-291-2/+3
| | | | | | | Found by inspection. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Shashank Ram <shashank08@gmail.com>
* datapath-windows: Check return status when using APIsAlin Serdean2017-08-021-7/+12
| | | | | | | | | | | Check the return status of `ConvertInterfaceLuidToAlias` and `RtlStringCbLengthW` and treat them accordingly. Also remove unneeded initialization for `interfaceName`. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Shashank Ram <rams@vmware.com>
* datapath-windows: fix excessive stack usage in iphelperAlin Serdean2017-08-021-8/+7
| | | | | | | | | | | | `OvsGetOrResolveIPNeigh` uses a stack over 1024 bytes. Switch one parameter to be a pointer. Found using WDK 8.1 static code analysis. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Shashank Ram <rams@vmware.com>
* datapath-windows: Add dummy parameter for NotifyRouteChange2Alin Serdean2017-08-021-1/+3
| | | | | | | | | Add a dummy parameter when using `NotifyRouteChange2` to keep static static analysis happy. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Shashank Ram <rams@vmware.com>
* datapath-windows: interfaceName overflow in IpHelperAlin Serdean2017-08-021-2/+2
| | | | | | | | | | | Bump the size of interfaceName so an overflow cannot occur when using `ConvertInterfaceLuidToAlias`. Found using WDK 10 static code analysis. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Shashank Ram <rams@vmware.com>
* datapath-windows: WDK 10 Iphelper rename local variablesAlin Serdean2017-01-041-9/+10
| | | | | | | | | | | | | Compiling under WDK 10 triggers some warnings in IpHelper, which lead to a failing build. The root cause is that local variables `ipAddr` and `link` hide the previous local declaration. This patch just renames the variables. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Add multiple switch internal portsAlin Serdean2016-12-201-244/+675
| | | | | | | | | | | | 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>
* datapath-windows: Avoid busy wait in OvsStartIpHelperShashank Ram2016-12-121-2/+13
| | | | | | | | | | | | | | | | | | | | | Previously, the IP Helper thread would wait for an event but with a timeout of 0, which resulted in the thread busy waiting causing high CPU usage by the kernel. Since the IP Helper thread is only required based on certain events, it makes sense to wait indefinitely till we receieve such an event notification to wake up the thread. This change aims to address this issue. When OvsEnqueueIpHelperRequest() or OvsInternalAdapterUp() is called, the ovsNumIpHelperRequests counter is incremented, but upon consumption of the request, is not decremented. Since the wakeup logic for the thread is determined by this counter value, we need to reset the counter back correctly once the request has been consumed by the IP Helper thread. Signed-off-by: Shashank Ram <rams@vmware.com> Acked-by: Yin Lin <linyi@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Removed double initialization on local variablesPaul Boca2016-04-211-2/+2
| | | | | | Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: nuke port # argument in IP helperNithin Raju2015-11-251-7/+6
| | | | | | | | | | | | Port # doesn't make much sense since it has not been computed yet. Also, get rid of OVS_DEFAULT_PORT_NO and use OVS_DPPORT_NUMBER_INVALID instead. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Added specific pool tag for iphelper codeSorin Vinturis2015-03-261-34/+36
| | | | | | | | | | | All memory allocations within iphelper code have 'HSVO' pool tag. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/56 Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: cleanup DpInternal.hNithin Raju2014-11-201-5/+5
| | | | | | | | | | Getting rid of unused definitions in DpInternal.h. This is only the first round. There's scope for more cleanup. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: Rename files.Samuel Ghinet2014-08-291-0/+1689
This patch includes the file renaming and accommodations needed for the file renaming to build the forwarding extension for Hyper-V. This patch is also a follow-up for the thread: http://openvswitch.org/pipermail/dev/2014-August/044005.html Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>