summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Vport.c
Commit message (Collapse)AuthorAgeFilesLines
* datapath-windows: Do not delete internal port on OID_SWITCH_NIC_DISCONNECTJinjun Gao2019-12-091-3/+9
| | | | | | | | | | | | | | | | | | | 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 <jinjung@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add guards around IpHelper adapter binding callsSairam Venugopal via dev2019-04-031-3/+31
| | | | | | | | | | | | Protect internal adapter up/down calls with a dispatch lock. It was observed that the InternalAdapter bind calls could happen out of order thereby causing encap packets to not be sent properly. Add assert around the IpHelper bind calls to ensure Up/Down gets called only for the appropriate vports. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add annotations to find vport functionsAlin Gabriel Serdean2019-03-131-1/+6
| | | | | | | | | Add annotations to find vport functions to check if the dispatch lock is held. Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: Fix race condition during port creationSairam Venugopal2019-03-131-2/+1
| | | | | | | | | | Hold the dispatch lock until port-add operations are completed. 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>
* datapath-windows: Fix race condition when deleting internal portsAlin Gabriel Serdean2018-12-281-1/+1
| | | | | | | | | | | We need to hold the port lock until all the operations with a port are completed. Found by inspection. Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Anand Kumar <kumaranand@vmware.com>
* treewide: Remove pointless "return;" at ends of functions.Ben Pfaff2018-07-091-1/+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: Vport check RtlStringCbLengthW return valueAlin Serdean2017-11-291-2/+7
| | | | | | | | | | The result of `RtlStringCbLengthW` is not currently checked and triggers a warning using the WDK 8.1 static analysis. This patch treats the result of `RtlStringCbLengthW`. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Shashank Ram <shashank08@gmail.com>
* datapath-windows: Remove Strsafe usage from datapathAlin Serdean2017-05-251-2/+0
| | | | | | | | | | | | The removal is mandatory to use the VStudio 2013 static code analyzer. The only function that was used from the include is: 'StringCbLengthA'. We were not checking the result of that function, nor will the 'vportGet->name' exceed the 'OVS_MAX_PORT_NAME_LENGTH' limitation. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-By: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add a wrapper to retreive external vportShashank Ram2017-01-271-0/+6
| | | | | | | | This wrapper is to simplify readability. Signed-off-by: Shashank Ram <rams@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add multiple switch internal portsAlin Serdean2016-12-201-67/+64
| | | | | | | | | | | | 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: Explicitly name vport related event to vportEventSairam Venugopal2016-07-291-6/+6
| | | | | | | | | | | | | OVS_EVENT_ENTRY currently handles only Vport related events. Updating the name of the struct to OVS_VPORT_EVENT_ENTRY. Remove OVS_EVENT_STATUS since it's currently not in use. Update the datapath to refer to events as vportEvents. This will aid in the introduction of other events. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-By: Yin Lin <linyi@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-By: Yin Lin <linyi@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Fix various Geneve bugsYin Lin2016-07-211-1/+2
| | | | | | | Signed-off-by: Yin Lin <linyi@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add Geneve supportYin Lin2016-06-241-4/+16
| | | | | | Signed-off-by: Yin Lin <linyi@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Rename local variable in Vport.cSairam Venugopal2016-06-231-7/+7
| | | | | | | | | Declaration of 'event' hides previous local declaration. Rename this to evt. The other variable wasn't being used. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: use ip proto for tunnel port lookupNithin Raju2016-06-171-3/+61
| | | | | | | | | | | | | | | | | | In Actions.c, based on the IP Protocol type and L4 port of the outer packet, we lookup the tunnel port. The function that made this happen took the tunnel type as an argument. Semantically, is is better to pass the IP protocol type and let the lookup code map IP protocol type to tunnel type. In the vport add code, we make sure that we block tunnel port addition if there's already a tunnel port that uses the same IP protocol type and L4 port number. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Yin Lin <linyi@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Fix misc on vportAlin Serdean2016-06-141-3/+1
| | | | | | | | | Remove ununsed variables, found by inspection. On fail reset extInfo name. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: o/p buffer must fit NL error messageNithin Raju2016-05-251-19/+23
| | | | | | | | | | | | | | | | | OVS_IOCTL_WRITE and OVS_IOCTL_TRANSACT can generate a netlink error that is represented by a OVS_MESSAGE_ERROR struct. We want to make sure at the entry point of the ioctl processing that the output buffer is big enough to hold the error message. We were earlier checking for struct OVS_MESSAGE which is smaller. Since we are ensuring that output buffer can fit OVS_MESSAGE_ERROR at the top of the ioctl function, there's no need to check for that later. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* datapath-windows: Validate Netlink packets' integrity.Paul Boca2016-05-161-16/+18
| | | | | | | | | Solved access violation when trying to access Netlink message - obtained with forged IOCTLs. Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Fixed buffer overflow in OvsInitVportWithNicParamPaul Boca2016-04-221-3/+3
| | | | | | | | nicParam->PermanentMacAddress is 32 bytes and vport->permMacAddress is 6 bytes Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: post event during vport deleteNithin Raju2016-04-141-0/+8
| | | | | | | | Got left out during the previous round of refactoring. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Apply minor fixes in GetNICAlias().Nithin Raju2016-04-121-4/+4
| | | | | | Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Add GRE TEB support for windows datapathAlin Serdean2015-12-111-7/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the support for GRE TEB (trasparent ethernet bridging) for the windows datapath. The GRE support is based on http://tools.ietf.org/html/rfc2890, without taking into account the GRE sequence, and it supports only the GRE protocol type 6558 (trasparent ethernet bridging) like its linux counterpart. Util.h: define the GRE pool tag Vport.c/h: sort the includes alphabetically add the function OvsFindTunnelVportByPortType which searches the tunnelVportsArray for a given port type Actions.c : sort the includes alphabetically call the GRE encapsulation / decapsulation functions when needed Gre.c/h : add GRE type defines add initialization/cleanup functions add encapsulation / decapsulation functions with software offloads (hardware offloads will be added in a separate patch) support Tested using: PSPING (https://technet.microsoft.com/en-us/sysinternals/psping.aspx) (ICMP, TCP, UDP) with various packet lengths IPERF3 (https://iperf.fr/iperf-download.php) (TCP, UDP) with various options Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* datapath-windows: Fix HvUpdateNic() to handle name changesNithin Raju2015-11-251-51/+49
| | | | | | | | | | | | | | | | | If the name of an internal or external NIC changes, we need to disconnect the NIC from OVS since the name is the key. In this change, we generate a link down event. It is as though we got a call to HvDisconnectNic() for the old name and got a HvConnectNic() for the new name. Also, HvCreateNic() has been cleaned up to remove the code to look for existing vport. We won't have a vport now since we'd have deleted the vport in HvDeleteNic(). 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: cleanup AssignNicNameSpecial()Nithin Raju2015-11-251-29/+33
| | | | | | | | | | | | | | | AssignNicNameSpecial() needed to be called outside of a lock and was moved out in a previous change. But, it was accessing vport structure outside of the lock which isn't safe. In this change, we take care of that. I tried to trigger a call to HvUpdateNic() by renaming the interface from the GUI and didn't see any callback. Other changes are tested. 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: nuke port # argument in IP helperNithin Raju2015-11-251-1/+1
| | | | | | | | | | | | 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: cleanup events codeNithin Raju2015-11-251-35/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out that we don't need to generate an event is practically useful only in case of a port disconnect to let userspace know. Hence, this event is being posted from HvDisconnectNic(). In case of a new port appearing, it seems that userspace is not interested in a new port unless it was added by userspace itself. In my tests, userspce would end up deleting the port when it got a new port notification, despite the port existing in OVSDB. The reasoning seems simple enough: - On Linux, OVS is integrated with the hypervisor (libvirt for eg) and a port (ie. netdev) gets created in the Linux kernel and then get added to OVSDB. When vswitchd picks up the port addition in OVSDB, it adds the port in the OVS kernel DP. - If the kernel netdev does not exist while OVS userspace tries to create the port in OVS kernel DP, port addition fails. Moreover, the only way to re-add the port is to trigger userspace to re-add the port by deleting the port in OVSDB and re-adding it. With this patch, I have verified that if a VIF gets disconnected on the Hyper-V switch, it disappears from the OVS kernel DP as well. 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: cleanup InitHvVportCommon()Nithin Raju2015-11-251-84/+101
| | | | | | | | | | | | | | | | | | | | | The workflow being implemented is that, we need to assign a special name to the internal and external NICs, and it it not necessary to do that from InitHvVportCommon(). The purpose of InitHvVportCommon() is to insert the vport into the hash tables and update the switch context. We special case the name assignment in HvCreateNIC() for internal and external NICs. That seems more meaningful. Also, reused HvCreatePort() to allocate a Vport for each of the external NICs with NicIndex != 0. Due to this HvCreatePort() now takes 'nicIndex' as an additional parameter. Renamed InitHvVportCommon() to UpdateSwitchCtxWithVport(). 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: refactor port enumeration codeNithin Raju2015-11-251-63/+26
| | | | | | | | | | | We already have functions HvCreatePort() and HvCreateNic() to do the work. Might as well use that during port enumeration. More refactoring in later patches. 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: Report correctly when trying to add tunnel typesAlin Serdean2015-11-031-1/+2
| | | | | | | | | | Report invalid parameter to the userspace if the user tries to add a vport tunnel type which is not supported by the kernel extension. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Updating an External Adapter causes flow lookup failureSairam Venugopal2015-11-031-4/+36
| | | | | | | | | | | This patch fixes an issue with updating the propeties of an external adapter in Windows. The issue causes flow lookups to fail until the kernel is reinstalled. Reported-at: https://github.com/openvswitch/ovs-issues/issues/102 Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: fix NULL check in OvsGetExtInfoIoctl()Nithin Raju2015-10-211-1/+1
| | | | | | | | | | End result is that "mac_in_use" column gets populated in OVSDB for internal and external NICs. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: Removed hardcoded names for internal/external vportsSorin Vinturis2015-09-221-49/+58
| | | | | | | | | | The internal/external vports will have the actual OS-based names, which represent the NIC interface alias that is displayed by running 'Get-NetAdapter' Hyper-V PS command. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmare.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Add corresponding tag for tunnel context allocationsSorin Vinturis2015-09-041-1/+2
| | | | | | Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: check vport attribute before accessNithin Raju2015-09-041-4/+6
| | | | | | | | | OVS_VPORT_ATTR_OPTIONS being an optional attribute should be preceded by a check for valid value before access. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Fix iterator in NlAttrParse()Sairam Venugopal2015-08-261-6/+12
| | | | | | Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* tunneling: Remove gre64 tunnel support.Pravin B Shelar2015-08-201-3/+0
| | | | | | | | | | GRE64 was introduced to extend gre key from 32-bit to 64-bit using gre-key and sequence number field. But GRE64 is not standard protocol. There are not many users of this protocol. Therefore we have decided to remove it. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* treewide: Fix doubled "the".Ben Pfaff2015-08-031-1/+1
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com>
* datapath-windows: Avoid BSOD when cleaning up a tunnel vportSorin Vinturis2015-07-281-1/+6
| | | | | | | | | | | | | | If an error appears when creating a tunnel vport the cleanup is performed twice, which causes the tunnel vport to be released also twice and generate a BSOD. This patch modifies the tunnel filter cleanup logic to avoid this issue. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/97 Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Fixed spelling errors in OVSSorin Vinturis2015-07-161-1/+1
| | | | | | | Solved some spelling errors observed in the datapath code. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Solved BSOD when cleaning up the VXLAN tunnelSorin Vinturis2015-07-151-0/+6
| | | | | | | | | | When removing vport also remove the vxlan tunnel port. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/94 Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Rename 'vport->isPresentOnHv' to 'isAbsentOnHv'Nithin Raju2015-07-011-11/+11
| | | | | | | | | | | | | | | | | | | | Looking at the code, the flag 'vport->isPresentOnHv' is actually indicating if the vport is present on the Hyper-V switch or not, but the logic seems to be inverse. 'isPresentOnHv == TRUE' indicates that the vport is not present on the Hyper-V switch. Eg. VXLAN port, would have isPresentOnHv == TRUE. In this patch, we rename the variable to reflect its meaning. vport->isAbsentOnHv is TRUE iff: - vport is bridge internal port - vport is tunnel port - vport was added from Hyper-V and also from OVS, but got deleted from Hyper-V Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Code refactoring and fixes in Vport.cNithin Raju2015-07-011-112/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this patch, there a couple of fixes and some code refactoring: 1. During deletion of "internal" and "external" in OvsRemoveAndDeleteVport(), we need to check if 'hvDelete' is TRUE before updating the data structures. Added code comments explaining the same. 2. Added a OvsRemoveTunnelPort() that gets called from OvsRemoveAndDeletePort() for the special processing for tunnel ports. 3. Folded in OvsCleanupVportCommon() back into OvsRemoveAndDeletePort(), since we only need a part of the functionality of OvsCleanupVportCommon() to be called from OvsTunnelVportPendingUninit(), and not the entire function. 4. Renamed OvsTunnelVportPendingUninit() to OvsTunnelVportPendingRemove() since it is basically a "pending" version of OvsVportTunnelRemove(). Validation: - Add external port from Hyper-V, add external port from OVS, remove external port from OVS, remove external port from Hyper-V. No ASSERT hit. - Add external port from Hyper-V, add external port from OVS, remove external port from Hyper-V, remove external port from OVS. No ASSERT hit. - Vxlan tunnel port creation/deletion - Stt tunnel port creation/deletion - Ping on Vxlan/Stt tunnels - Ovs Extension load/unload. There's an unrelated issue I found that is reported in: https://github.com/openvswitch/ovs-issues/issues/86 Signed-off-by: Nithin Raju <nithin@vmware.com>V Reported-at: https://github.com/openvswitch/ovs-issues/issues/79 Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Reported-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Failed initialization for datapath tunnel portsSorin Vinturis2015-07-011-1/+1
| | | | | | | | | | | | | Tunnel ports are not initialized with the corresponding default port. The newly allocated vport is not yet initialized and the ovsType member does not reflect the correct tunnel port type, thus the transport port destination won't be correctly initialized. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/88 Acked-by: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Stateless TCP Tunnelling protocol - Initial implementationEitan Eliahu2015-06-111-10/+42
| | | | | | | | | | | | | | | | | | | This change include an initial implementable of STT. The following should be added: [1] Checksum offload (SW and HW) [2] LSO (SW and HW) [3] IP layer WFP callout for IP segments Added support for multiple (per TCP port) STT ports Testing: link layer connection through ping works. File transfer. Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Co-authored-by: Saurabh Shah <ssaurabh@vmware.com> Signed-off-by: Saurabh Shah <ssaurabh@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Support for multiple VXLAN tunnelsSorin Vinturis2015-05-271-7/+37
| | | | | | | | | | | | | | At the moment the OVS extension supports only one VXLAN tunnel that is cached in the extension switch context. Replaced the latter cached pointer with an array list that contains all VXLAN tunnel vports. 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/64 Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Support for custom VXLAN tunnel portSorin Vinturis2015-05-271-85/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel datapath supports only port 4789 for VXLAN tunnel creation. Added support in order to allow for the VXLAN tunnel port to be configurable to any port number set by the userspace. The patch also checks to see if an existing WFP filter, for the necessary UDP tunnel port, is already created before adding a new one. This is a double check, because currently the userspace also verifies this, but it is necessary to avoid future issues. Custom VXLAN tunnel port requires the addition of a new WFP filter with the new UDP tunnel port. The creation of a new WFP filter is triggered in OvsInitVxlanTunnel function and the removal of the WFP filter in OvsCleanupVxlanTunnel function. But the latter functions are running at IRQL = DISPATCH_LEVEL, due to the NDIS RW lock acquisition, and all WFP calls must be running at IRQL = PASSIVE_LEVEL. This is why I have created a system thread which records all filter addition/removal requests into a list for later processing by the system thread. The ThreadStart routine processes all received requests at IRQL = PASSIVE_LEVEL, which is the required IRQL for the necessary WFP calls for adding/removal of the WFP filters. The WFP filter for the default VXLAN port 4789 is not added anymore at filter attach. All WFP filters for the tunnel ports are added when the tunnel ports are initialized and are removed at cleanup. WFP operation status is then reported to userspace. It is necessary that OvsTunnelFilterUninitialize function is called after OvsClearAllSwitchVports in order to allow for the added WFP filters to be removed. OvsTunnelFilterUninitialize function closes the global engine handle used by most of the WFP calls, including filter removal. 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/66 Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Removed gOvsCtrlLock global spinlockSorin Vinturis2015-04-231-20/+2
| | | | | | | | | | | | | There is no need to use gOvsCtrlLock spinlock to guard the switch context, as there is now the switch context's reference count used for this purpose. Now the gOvsCtrlLock spinlock guards only one shared resource, the OVS_OPEN_INSTANCE global instance array. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows Release lock on HVUpdateNICAlin Serdean2015-04-061-0/+1
| | | | | | | | | Release switchContext->dispatchLock in case the vport has not been found. Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Allow NdisSwitchPortTypeSynthetic to be updatedAlin Serdean2015-04-061-2/+2
| | | | | | | | | | | Allow the port to be updated if it the type is only: NdisSwitchPortTypeSynthetic Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Added specific pool tag for vport codeSorin Vinturis2015-03-261-15/+16
| | | | | | | | | | | All memory allocations within vport code have 'PSVO' 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>