summaryrefslogtreecommitdiff
path: root/datapath-windows
Commit message (Collapse)AuthorAgeFilesLines
* datapath-windows: Trigger conntrack event after setting mark and labelSairam Venugopal2017-03-071-7/+21
| | | | | | | | | | | | New Conntrack Entry event should be triggered after setting the mark and label fields. The current RW lock implementation prevents Event Handler from reading the entry until mark/label is set. Fixing the workflow to trigger the event after setting mark/label. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Shashank Ram <rams@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Fix GENEVE option headerAlin Serdean2017-03-061-2/+2
| | | | | | | | | | | | | The GENEVE option header is defined in big endian, however we support only little endian on Windows at the moment. This patch changes the GENEVE option header into little endian. Found while testing. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Yin Lin <linyi@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: GENEVE Check for flow destination portAlin Serdean2017-02-021-1/+2
| | | | | | | | | | | Change the UDP destination port(GENEVE header) to check if it was set by the userspace, use it if it was set. If the userspace did not specify a destination port, use the configured vport destination port. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: STT Check for flow destination portAlin Serdean2017-02-021-1/+2
| | | | | | | | | | | Change the TCP destination port(STT header) to check if it was set by the userspace, use it if it was set. If the userspace did not specify a destination port, use the configured vport destination port. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: VXLAN Check for flow destination portAlin Serdean2017-02-021-1/+2
| | | | | | | | | | | Change the UDP destination port(VXLAN header) to check if it was set by the userspace, use it if it was set. If the userspace did not specify a destination port, use the configured vport destination port. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: Add support for OVS_TUNNEL_KEY_ATTR_TP_DSTAlin Serdean2017-02-021-0/+8
| | | | | | | | | Add support for netlink attribute OVS_TUNNEL_KEY_ATTR_TP_DST get/set flow functions. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: Allow tunnel action to modify destination portAlin Serdean2017-02-021-2/+2
| | | | | | | | | | | | 'OvsTunnelAttrToIPv4TunnelKey' modifies 'tunkey' with the received netlink attributes(i.e. OVS_TUNNEL_KEY_ATTR_IPV4_DST). Change the order of the value assignment to reflect the values received via userspace. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: Fix alignment in MapTunAttrToFlowPutAlin Serdean2017-01-271-1/+1
| | | | | | | | Found by inspection. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add a wrapper to retreive external vportShashank Ram2017-01-274-7/+15
| | | | | | | | 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 support for OVS_KEY_ATTR_TCP set actionAlin Serdean2017-01-271-0/+48
| | | | | | | | | | | | | | This patch adds support for set action with OVS_KEY_ATTR_TCP attribute (change TCP source or destination port). If the source or destination TCP port was changed, update the TCP checksum. A sample flow can look like the following: set(tcp(src=80,dst=443)) Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add support for OVS_KEY_ATTR_UDP set actionAlin Serdean2017-01-271-1/+51
| | | | | | | | | | | | | | This patch adds support for set action with OVS_KEY_ATTR_UDP attribute (change UDP source or destination port). If the source or destination UDP port was changed, update the UDP checksum. A sample flow can look like the following: set(udp(src=67,dst=68)) Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add function to get continuous buffer from contextAlin Serdean2017-01-271-38/+62
| | | | | | | | | | | | | This patch extracts the code that tries to get a continuous IPv4 header buffer from the function 'OvsUpdateIPv4Header' and moves it to a new function 'OvsGetHeaderBySize'. The new function can be used later when trying to change the UDP/TCP/MPLS etc., headers. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: OvsUpdateIPv4Header remove unnecessary additionAlin Serdean2017-01-271-4/+4
| | | | | | | | | bufferStart can be used directly to access the data of the net buffer. Add the MDL offset to save unnecessary additions. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* windows: Change driver and MSI company name to LFAlin Serdean2017-01-263-3/+3
| | | | | | | | | | | | | Until now we used 'Open vSwitch' as the company/organization name. The project is now under The Linux Foundation ownership. This patch updates the MSI and driver attributes to reflect that ownership. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Fix typo in OvsUpdateIPv4HeaderAlin Serdean2017-01-061-1/+1
| | | | | | | Found by inspection. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* 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 Windows 10 family to solutionAlin Gabriel Serdean2017-01-035-0/+126
| | | | | | | | | | | | This patch adds two more compiling targets: - one for Windows 10 release - one for Windows 10 Debug The new targets are flagged properly to use the new Windows 10 kernel mode driver and its toolchain. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: Conntrack disable type truncation warningAlin Serdean2017-01-031-0/+5
| | | | | | | | | | | | Compiling with the WDK 10 gave the following warning: Warning C4311 'type cast': pointer truncation from 'POVS_CT_ENTRY' to 'UINT32' ovsext (OVSExt\ovsext) Conntrack.c 1139 This patch disables the warning on the file Conntrack.c. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Force driver version to depend on a variableAlin Serdean2016-12-212-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following components use Windows driver information: - System (inf file); used during device installation - Resource file (rc file); used by applications when looking over the driver file(sys) Currently we have the following for the driver version number: - (inf file) generated value from the build timestamp - (rc file) predefined value This patch forces both files to depend on a variable: '$(Version)'. This is a predefined variable from Visual Studio. To achieve the above we change the current project settings used by the 'stampinf' utility and we define a new preprocessor value named 'VersionWithCommas' (which is obtained by replacing all '.' with ',' from $(Version) ). Certain values from the resource file are expected to use ',' instead of '.' . The resource file has been updated to use the new values when generating information about the driver (sys). The variable '$(Version' can be changed from the command line via the 'msbuild' utility. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Fix function prototypesAlin Serdean2016-12-211-2/+2
| | | | | | | | | | | | | | | There is a mismatch between OvsInitCompletionList and OvsAddPktCompletionList prototypes. Eg: https://github.com/openvswitch/ovs/blob/master/datapath-windows/ovsext/PacketIO.h#L33 https://github.com/openvswitch/ovs/blob/master/datapath-windows/ovsext/PacketIO.c#L54 Found while compiling with Windows 10 kernel tool chain. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Remove unused section from driver infAlin Serdean2016-12-211-1/+0
| | | | | | | | | | | | The new tool chain for Windows 10 driver contains a inf file checker. While compiling it found the following issue: - Common.Params.reg is missing. This patch removes the entry since it is not used, and at the moment we do not add any specific keys to the Windows registry. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Ignore VStudio 2015 temporary filesAlin Serdean2016-12-211-0/+2
| | | | | | | | | Ignore the temporary files created by Visual Studio 2015 when opening a solution. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Remove dead code from PacketIOAlin Serdean2016-12-211-1/+0
| | | | | | | | | Assigning value to 'nativeNbls' has no effect outside the function and the variable is not used inside the function. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: Add multiple switch internal portsAlin Serdean2016-12-2014-428/+868
| | | | | | | | | | | | 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: Conntrack - Enable FTP supportSairam Venugopal2016-12-205-2/+92
| | | | | | | | | | | Enable the support for tracking FTP connections in the Connection tracker. This checks an incoming ftp control connection to extract the related data connection. When a matching data connection arrives, it would then update the connection entry to point to the original control connection. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Conntrack - Introduce support for tracking related connectionsSairam Venugopal2016-12-204-0/+540
| | | | | | | | | | | | | Introduce a new table to track related connections. This table will be used to track FTP data connections based on the control connection. There is a new Conntrack-ftp.c to parse incoming FTP messages to determine the related data ports. It creates a new entry in the related connections tracker table. If there is a matching FTP data connection, then the state for that connection is marked as RELATED. Signed-off-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 Conntrack definitions and introduce related entriesSairam Venugopal2016-12-202-21/+42
| | | | | | | | | Consolidate the reusable structs and includes. Introduce the new OVS_CT_REL_ENTRY to track related connections. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Conntrack - Fix OvsGetTcpPayloadLength()Sairam Venugopal2016-12-202-15/+22
| | | | | | | | | Move the OvsGetTcpPayloadLength() to common header. Update the code to check for null references and the correct size of the TCP header. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Fix issues related to packet completionShashank Ram2016-12-151-5/+20
| | | | | | | | | | | | | | | In OvsTunnelPortTx() function, for packets coming from the VIF port, the srcVportNo, srcPortId and srcNicIndex were getting modified for the original NBL prior to creation of newNbl. This is not correct since modifying the original packet's forwarding detail can cause completion issues. Instead, we should keep the forwarding detail of the original packet as is, and only update the forwarding detail for the newNbl. 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: Conntrack move null checks to functionsAlin Serdean2016-12-133-3/+11
| | | | | | | | | | Add null checks inside OvsConntrackValidateIcmpPacket, OvsConntrackValidateTcpPacket to make the functions self-contained. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Suggested-by: Yin Lin <linyi@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Fix the redefinition of variablesSairam Venugopal2016-12-132-15/+15
| | | | | | | | | Some of the variables were getting re-defined in the function. This causes compiler warning in Windows SDK 10. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.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>
* doc: Populate 'topics' sectionStephen Finucane2016-12-122-511/+0
| | | | | | | | | | | There are many docs that don't need to kept at the top level, along with many more hidden in random folders. Move them all. This also allows us to add the '-W' flag to Sphinx, ensuring unindexed docs result in build failures. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
* doc: Populate 'internals' sectionStephen Finucane2016-12-122-184/+0
| | | | | | | | | | This is mostly docs moved from the top-level directory and content scraped from the Open vSwitch website source [1]. [1] https://github.com/openvswitch/openvswitch.github.io/ Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Fix typos in function summariesSairam Venugopal2016-12-022-2/+2
| | | | | | | Fixed mismatch between function names and descriptions. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: conntrack leaksAlin Serdean2016-11-291-0/+5
| | | | | | | | | | | | | All conntrack entries should be removed before unloading/disabling the driver. This patch forces a flush of all the entries during the cleanup routine. The bug was found using driver verifier. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: null comparison for icmp and tcp headerAlin Serdean2016-11-291-2/+2
| | | | | | | | | | | This patch checks if the TCP or ICMP header exists before trying to use them. The issue was found using the driver under low resources. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: fix return value in conntrackAlin Serdean2016-11-291-6/+8
| | | | | | | | 'status' is of type 'NTSTATUS' and NlFillOvsMsgForNfGenMsg is of type bool. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: pop buffer from packet / pop_vlan bugAlin Serdean2016-11-291-5/+10
| | | | | | | | | | | | | | | | Switch too memmove(RtlMoveMemory) instead of copy and predefined allocated buffer. Currently if we receive a pop_vlan action, and the vlan tag is inside the Ethernet frame(not in the net buffer list information) we change the frame without checking if the it was a vlan tagged or not. This patch checks if it a vlan tagged frame and makes the action a non-operation. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add ovsext/Conntrack-icmp.c to automake.mkJarno Rajahalme2016-11-111-0/+1
| | | | | | Fix build breakage. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: else-if block in OvsExtNetPnPEventNithin Raju2016-11-111-5/+3
| | | | | | Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Enable support for tracking ICMP code and typeSairam Venugopal2016-11-116-32/+190
| | | | | | | | | Add support for tracking ICMP code and Type in the Hyper-V Conntrack module. This code is similar to the userspace connection tracker. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Fix the isActivated flag in OvsActivateSwitchShashank Ram2016-11-111-2/+6
| | | | | | | | | | Previously, the driver would enter a deadlock because the OvsInitConfiguredSwitchNics() function would wait till switchContext->isActivated flag is set. 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: clean code in geneveAlin Serdean2016-11-041-3/+3
| | | | | | | | | The purpose of this patch is to make the code more readable and fix a static analyzer warning. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: clean code in greAlin Serdean2016-11-041-3/+3
| | | | | | | | | The purpose of this patch is to make the code more readable and fix a static analyzer warning. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: clean code in sttAlin Serdean2016-11-041-3/+3
| | | | | | | | | The purpose of this patch is to make the code more readable and fix a static analyzer warning. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: clean code in vxlanAlin Serdean2016-11-041-3/+3
| | | | | | | | | The purpose of this patch is to make the code more readable and fix a static analyzer warning. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* doc: Convert datapath-windows/DESIGN to rSTStephen Finucane2016-11-032-226/+279
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* doc: Convert datapath-windows/CodingStyle to rSTStephen Finucane2016-11-033-155/+184
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* datapath-windows: Set isActivated flag only on successShashank Ram2016-10-311-5/+2
| | | | | | | | | | | | | @Switch.c: Modifies OvsActivateSwitch() function to mark the switch as activated only if the the status is success. The callers itself only call this method when the isActivated flag is unset. Signed-off-by: Shashank Ram <rams@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>