summaryrefslogtreecommitdiff
path: root/datapath-windows
Commit message (Collapse)AuthorAgeFilesLines
...
* datapath-windows: Add support to configure ct zone limitsAnand Kumar2018-09-204-3/+211
| | | | | | | | | | | | | | | | | This patch implements limiting conntrack entries per zone using dpctl commands. Example: ovs-appctl dpctl/ct-set-limits default=5 zone=1,limit=2 zone=1,limit=3 ovs-appctl dpct/ct-del-limits zone=4 ovs-appctl dpct/ct-get-limits zone=1,2,3 - Also update the netlink-socket.c to support netlink family 'OVS_WIN_NL_CTLIMIT_FAMILY_ID' for conntrack zone limit. Signed-off-by: Anand Kumar <kumaranand@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-094-9/+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: Compute ct hash based on 5-tuple and zoneAnand Kumar2018-06-242-114/+116
| | | | | | | | | | | | | | | | Conntrack 5-tuple consists of src address, dst address, src port, dst port and protocol which will be unique to a ct session. Use this information along with zone to compute hash. Also re-factor conntrack code related to parsing netlink attributes. Testing: Verified loading/unloading the driver with driver verified enabled. Ran TCP/UDP and ICMP traffic. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Implement locking in conntrack NAT.Anand Kumar2018-06-245-92/+101
| | | | | | | | | | | | | | | | | | | | | | | This patch primarily replaces existing ndis RWlock based implementaion for NAT in conntrack with a spinlock based implementation inside NAT, module along with some conntrack optimization. - The 'ovsNatTable' and 'ovsUnNatTable' tables are shared between cleanup threads and packet processing thread. In order to protect these two tables use a spinlock. Also introduce counters to track number of nat entries. - Introduce a new function OvsGetTcpHeader() to retrieve TCP header and payload length, to optimize for TCP traffic. - Optimize conntrack look up. - Remove 'bucketlockRef' member from conntrack entry structure. Testing: Verified loading/unloading the driver with driver verified enabled. Ran TCP/UDP and ICMP traffic. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Use spinlock instead of RW lock for ct entryAnand Kumar2018-06-245-87/+96
| | | | | | | | | | | | | | | | | | | This patch mainly changes a ndis RW lock for conntrack entry to a spinlock along with some minor refactor in conntrack. Using spinlock instead of RW lock as RW locks causes performance hits when acquired/released multiple times. - Use NdisInterlockedXX wrapper api's instead of InterlockedXX. - Update 'ctTotalRelatedEntries' using interlocked functions. - Move conntrack lock out of NAT module. Testing: Verified loading/unloading the driver with driver verified enabled. Ran TCP/UDP and ICMP traffic. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add support for handling DEI bit of VLAN headerAnand Kumar2018-06-112-6/+14
| | | | | | | | | | The Drop eligible indicator(DEI) is 1 bit wide and it is part of Tag control information (TCI) in VLAN header, which indicates that the frame can be dropped during congestion. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Prevent ct-counters from getting redundantly incrementedAnand Kumar2018-04-301-3/+4
| | | | | | | | The conntrack-counters ought to be incremented only if it's a new lookup or if it's recirculated through a different zone for the first time. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Do not drop Ip fragments less than MIN_FRAGMENT_SIZEAnand Kumar2018-03-081-6/+3
| | | | | | | | | | | | | | | | | Previously ipfragment module would drop any fragments less than MIN_FRAGMENT_SIZE (400 bytes), which was added to safeguard against the vulnerability CVE-2000-0305. This check is incorrect, since minimum size of the Ipfragment is 68 bytes (i.e. max length of Ip Header + 8 bytes of L4 header). So Ip fragments less than MIN_FRAGMENT_SIZE (400 bytes) is not guranted to be malformed or illegal. To guard against security vulnerability CVE-2000-0305, for a given ip datagram, ipfragments should be dropped only when number of smallest fragments recieved reaches a certain threshold. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Fix static analysis in Stt.cAlin Gabriel Serdean2018-03-061-2/+2
| | | | | | | | | | The WDK 10 static analysis complains: stt.c(427): warning C30030: Warning: Allocating executable memory via specifying a MM_PAGE_PRIORITY type without a bitwise OR with MdlMappingNoExecute. Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: On Debug builds, dump NBL info based on OVS_DBG_DEFAULT macroAnand Kumar2018-03-011-1/+12
| | | | | | | | | | | Currently nbl information is getting dumped whenever a nbl is copied or allocated, since OVS_DBG_DEFAULT is set to OVS_DBG_INFO for debug builds, which affects the ovs performance. Instead dump nbl information only when OVS_DBG_DEFAULT is set to OVS_LOG_LOUD Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: fix hash creation on ct markAlin Gabriel Serdean2018-02-271-1/+1
| | | | | | | | | Use key->ct.mark instead of key->ct.zone when generating the hash over the mark. Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Anand Kumar <kumaranand@vmware.com>
* datapath-windows: Allow compiling all targets using SDK 10.0Shashank Ram2018-02-062-29/+49
| | | | | | | | | | | | | Previously, Win8/8.1 targets would use SDK8.1. However, its recommended to use the newer SDK as newer VS versions typically drop support for older SDKs later on. This patch adds support to compile all targets (Win8/8.1/10) using the 10.0 SDK. Note that his patch does not drop support for older SDKs. Signed-off-by: Shashank Ram <rams@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add trace level logs in conntrack for invalid ct state.Anand Kumar2018-02-033-0/+11
| | | | | | Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Optimize conntrack lock implementation.Anand Kumar2018-02-023-85/+160
| | | | | | | | | | | | | | | | | | | | | | | | Currently, there is one global lock for conntrack module, which protects conntrack entries and conntrack table. All the NAT operations are performed holding this lock. This becomes inefficient, as the number of conntrack entries grow. With new implementation, we will have two PNDIS_RW_LOCK_EX locks in conntrack. 1. ovsCtBucketLock - one rw lock per bucket of the conntrack table, which is shared by all the ct entries that belong to the same bucket. 2. lock - a rw lock in OVS_CT_ENTRY structure that protects the members of conntrack entry. Also, OVS_CT_ENTRY structure will have a lock reference(bucketLockRef) to the corresponding OvsCtBucketLock of conntrack table. We need this reference to retrieve ovsCtBucketLock from ct entry for delete operation. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add a global level RW lock for NATAnand Kumar2018-02-021-2/+34
| | | | | | | | | | Currently NAT module relies on the existing conntrack lock. This patch provides a basic lock implementation for NAT module in conntrack. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Refactor conntrack code.Anand Kumar2018-02-023-86/+103
| | | | | | | | | Some of the functions and code are refactored so that new conntrack lock can be implemented Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add include directory to ovsext projectAlin Gabriel Serdean2018-01-081-3/+3
| | | | | | | | | | | When trying to compile with WDK 10, the files under datapath-windows/ovsext/Netlink can't see the headers from datapath-windows/ovsext. This patch adds the project directory under the include files. Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Change include type in Iphelper.hAlin Gabriel Serdean2018-01-081-1/+1
| | | | | | | Found while compiling with VS2017. Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Add directory to .gitignoreAlin Gabriel Serdean2018-01-081-0/+1
| | | | | | | | | Visual Studio 2017 uses `.vs` directory for temporary files. Add the directory to gitignore. Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Add support for deleting conntrack entry by 5-tuple.Anand Kumar2017-12-111-12/+134
| | | | | | | | | To delete a conntrack entry specified by 5-tuple pass an additional conntrack 5-tuple parameter to flush-conntrack. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Correct endianness for deleting zone.Justin Pettit2017-12-071-1/+1
| | | | | | | | | | | The zone Netlink attribute is supposed to be in network-byte order, but the Windows code for deleting conntrack entries was treating it as host-byte order. Found by inspection. Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: Fix possible NULL dereference in IpFragmentAlin Serdean2017-11-291-0/+1
| | | | | | | | | If we can't allocate the NBL just go to the cleanup sequence. Found using WDK 10 static code analysis. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Shashank Ram <shashank08@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: Fix static analysis warnings in OvsGetTcpPayloadLengthAlin Serdean2017-11-291-10/+7
| | | | | | | | This fixes the static code analysis over the function 'OvsGetTcpPayloadLength'. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Shashank Ram <shashank08@gmail.com>
* datapath-windows: Add assert to ethHdr in OvsActionMplsPushAlin Serdean2017-11-291-0/+1
| | | | | | | | | `ethHdr` cannot be NULL because we did a partial copy before it. Add an assert to keep the static analysis happy. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Shashank Ram <shashank08@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: 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: Use only non executable memoryAlin Serdean2017-11-2910-28/+35
| | | | | | | | | | | Use only non-executable memory when using MmGetSystemAddressForMdlSafe. Introduce a new function called OvsGetMdlWithLowPriority for readability. Found using WDK 10 static code analysis. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Shashank Ram <shashank08@gmail.com>
* datapath-windows: Account for VLAN tag in tunnel DecapShashank Ram2017-11-2810-37/+111
| | | | | | | | | | | | | | | | | | | | | | | | | Decap functions for tunneling protocols do not compute the packet header offsets correctly when there is a VLAN tag in the L2 header. This results in incorrect checksum computation causing the packet to be dropped. This patch adds support to account for the VLAN tag in the packet if its present, and makes use of the OvsExtractLayers() function to correctly compute the header offsets for different layers. Testing done: - Tested Geneve, STT, Vxlan and Gre and verified that there are no regressions. - Verified that packets with VLAN tags are correctly handled in the decap code of all tunneling protocols. Previously, this would result in packet drops due to invalid checksums being computed. - Verified that non-VLAN tagged packets are handled correctly. Signed-off-by: Shashank Ram <rams@vmware.com> Acked-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* build-windows: Suppress output from MSBuildAlin Gabriel Serdean2017-11-141-2/+2
| | | | | | | | | Add `nologo` parameter to MSBuild to suppress the banner. This will make tidier log messages. Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
* datapath-windows: Update OvsCompleteNbl argument to match definitionSairam Venugopal2017-10-311-1/+2
| | | | | | | | | | | | Update the OvsCompleteNbl to take in a PVOID and explicitly cast to POVS_SWITCH_CONTEXT. This is useful when finding declarations in Visual Studio. The mismatch breaks this functionality. Found by inspection. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Shashank Ram <rams@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Update OvsIPv4TunnelKey flags in geneve decap.Anand Kumar2017-10-201-4/+5
| | | | | | | | | | | | | | | Currently, the OvsLookupFlow fails for the decap packet, when the Geneve options are present in the packet as the OvsIPv4TunnelKey flags are not set in the Geneve decap. Set the OvsIPv4TunnelKey flags OVS_TNL_F_OAM and OVS_TNL_F_CRT_OPT in OvsDecapGeneve based on the geneve header. Also set OVS_TNL_F_GENEVE_OPT if the packet has geneve options. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-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: Remove the workaround in NAT for TCP checksumAnand Kumar2017-10-161-49/+11
| | | | | | | | | When checksum offload is enabled, compute checksum using the TCP pseudo header. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Fix bugs in cleaner threadsShashank Ram2017-09-284-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conntrack, Conntrack-related, Stt, and IP fragmentation have cleaner threads that run periodically to clean up their respective tables. During driver unload, OvsExtDetach() calls into routines that are meant for explicitly cleaning these tables up and freeing the resources associated with these threads. If during driver unload, these cleaner threads run immediately after the resources are freed, such as locks used by these threads, then the cleaner threads result in a kernel crash since they try to acquire locks that have already been freed. For eg, OvsIpFragmentEntryCleaner() caused a kernel crash because it tried to acquire a lock that was already freed by OvsCleanupIpFragment(). The fix is to simply exit the cleaner thread if the lock associated with the thread is not initialized, because the only way the threads can run when the lock is invalid is when the lock has been freed up during driver unload. Testing done: Verified that cleaner threads run as expected without crashing during driver unload. Signed-off-by: Shashank Ram <rams@vmware.com> Acked-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Increment ct packet counters based on ct_state.Anand Kumar2017-09-071-13/+22
| | | | | | | | | | | | | | | | | | | | For a given packet, packet counters in conntrack should be accounted only once, even if the packet is processed multiple times by conntrack. When a packet is processed by conntrack, ct_state flag is set to OVS_CS_F_TRACKED. Use this state to identify if a packet has been processed previously by conntrack. Also update the ct packet counters when ct entry is created. With this patch, the conntrack's packet counters behavior is similar to linux Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Ram Shashank Ram <rams@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Remove unnecessary call to OvsInitForwardingCtxAnand Kumar2017-09-041-8/+1
| | | | | | | | | | | Only curNbl in the forwarding context needs to be updated with fragmented NBL. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Shashank Ram <rams@vmware.com> Acked-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: Add an upper limit to conntrack entriesSairam Venugopal2017-09-012-0/+11
| | | | | | | | | | The current implementation lacked an upper bound of number of entries in the system. Set the size to ~2M (2^21) for the time being. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Shashank Ram <rams@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Move OvsCreateNewNBLsFromMultipleNBs to BuggerMgmtShashank Ram2017-08-233-42/+51
| | | | | | | | | | Moves function OvsCreateNewNBLsFromMultipleNBs() to BufferMgmt.c to facilitate consumption from outside PacketIO.c. Signed-off-by: Shashank Ram <rams@vmware.com> Acked-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Do not modify port field for ICMP during SNAT/DNATAnand Kumar2017-08-171-3/+19
| | | | | | | | | | | | | | | | | | | During SNAT/DNAT, we should not be updating the port field of ct_endpoint struct, as ICMP packets do not have port information. Since port and icmp_id are overlapped in ct_endpoint struct, icmp_id gets changed. As a result, NAT look up fails to find a matching entry. This patch addresses this issue by not modifying icmp_id field during SNAT/DNAT only for ICMP traffic The current NAT module doesn't take the ICMP type/code into account during the lookups. Fix this to make it similar with the other conntrack module. Acked-by: Shashank Ram <rams@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Update Orig Tuple to use ICMP Type and CodeAnand Kumar2017-08-172-4/+13
| | | | | | | | | | | - Also add some padding for the ct_endpoint's union, so that each member of ct_endpoint's union are of same size. Co-authored-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Acked-by: Shashank Ram <rams@vmware.com> Signed-off-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Fix conntrack lookups for reversed keysSairam Venugopal2017-08-031-9/+10
| | | | | | | | | | | | | | | | | | The conntrack table needs to be queried for entries in either directions to determine if the packet is in forward direction or reply direction. The current behavior ends up reversing the incoming packet's 5-Tuple for every entry in the loop instead of doing it only once. Testing Done: - Verified that ICMP requests are no longer treated as replies in Conntrack. Co-authored-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Shashank Ram <rams@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
* datapath-windows: Refactor OvsCreateNewNBLsFromMultipleNBsShashank Ram2017-08-021-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the function would take the curNbl and nextNbl as inputs, and modify the linked list, and merge the input linked list with the newly generated newNbl list. This is confusing for the caller, and the function has unnecessary logic for merging linked lists that instead the caller should take care of. This is because the OvsCreateNewNBLsFromMultipleNBs() is a generic API that can be used by other functions as well, and its natural for different callers to have different needs. This patch refactors the behavior of OvsCreateNewNBLsFromMultipleNBs to take in the curNbl and lastNbl, and it returns a linked list of NBLs and sets the HEAD and TAIL of the new list obtained from the curNbl. If the caller wants to chain a new linked list at the HEAD or TAIL, it can make use of the curNbl and lastNbl to do so. Signed-off-by: Shashank Ram <rams@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Anand Kumar <kumaranand@vmware.com>
* datapath-windows: Fix shared variables which use Interlocked functionsAlin Serdean2017-08-021-3/+3
| | | | | | | | | Instead of assigning a value directly to the variable use `InterlockedAdd` with 0. 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 annotation for OvsIpFragmentEntryCleanerAlin Serdean2017-08-021-1/+1
| | | | | | | | Make the function `OvsIpFragmentEntryCleaner` aware it is a kstart_routine. 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 annotation for OvsCtRelatedEntryCleanerAlin Serdean2017-08-021-3/+4
| | | | | | | | | | Make the function `OvsCtRelatedEntryCleaner` aware it is a kstart_routine. Also, the function is not compliant with the coding standard. 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: Treat TCP_HDR_LEN static analysis warningsAlin Serdean2017-08-021-1/+1
| | | | | | | | | | Using the shift operator in macros makes the static analyzer on WDK 8.1 confused. Switch to multiplication when trying to get the data offset of the TCP header. 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: 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: Suppress warning in jhashAlin Serdean2017-08-021-0/+2
| | | | | | | | Suppress overflow warning to keep static code 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>