summaryrefslogtreecommitdiff
path: root/datapath-windows
Commit message (Collapse)AuthorAgeFilesLines
* datapath-windows: Fix various Geneve bugsYin Lin2016-07-213-2/+8
| | | | | | | 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: Fixed packet limits on STT protocolPaul Boca2016-07-151-169/+194
| | | | | | | | | | | "If the length of the payload to be encapsulated exceeds 64KB, or if the offset to the L4 header exceeds 255 bytes, then it will not be possible to offload the packet to the NIC for segmentation." (STT RFC) In this case the packet needs to be segmented by us, before sending it. Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* Windows: Add support for handling protocol (netlink family)Sairam Venugopal2016-07-133-3/+119
| | | | | | | | | | | | | | | Windows datapath currently has no notion of netlink family. It assumes all netlink messages to belong to NETLINK_GENERIC family. This patch adds support for handling other protocols if the userspace sends it down to kernel. This patch introduces a new NETLINK_CMD - OVS_CTRL_CMD_SOCK_PROP to manage all properties associated with a socket. The properties are passed down as netlink message attributes. This makes it easier to introduce other properties in the future. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: remove unused 'ovsUserTimestampDelta'Nithin Raju2016-07-111-1/+0
| | | | | | 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: Track the number of conntrack entriesSairam Venugopal2016-07-011-48/+62
| | | | | | | | | Add a counter to track the number of connection tracking entries. Iterate over the conntrack entry table only if there are entries. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add support for Conntrack IPCTNL_MSG_CT_GET cmd in Datapath.cSairam Venugopal2016-07-011-2/+9
| | | | | | | | | | This will be used by userspace for dumping conntrack entries - "ovs-dpctl dump-conntrack". Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Conntrack - Handle memory allocation failureSairam Venugopal2016-07-012-2/+7
| | | | | | | | | Return null if Windows fails to allocate memory for the conntrack entry. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add support for dump-conntrack in datapathSairam Venugopal2016-07-014-3/+514
| | | | | | | | | | | Create the methods used for dumping conntrack entries from the hyper-v datapath to userspace by means of netfilter netlink messages. Some of the attributes are not supported by the datapath and have been defaulted to 0. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add support for Conntrack IPCTNL_MSG_CT_DELETE cmd in ↵Sairam Venugopal2016-07-012-4/+66
| | | | | | | | | | | | | | Datapath.c Create new NETLINK_CMD and NETLINK_FAMILY to assist in flushing conntrack entries. Modify Datapath.c to now support netfilter-netlink messages apart from the existing netfilter-generic messages. Also hookup the command handler to execute the OvsCtFlush in Conntrack.c Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add support for flushing conntrack entriesSairam Venugopal2016-07-011-0/+93
| | | | | | | | | | | Flush out all conntrack entries or those that match a given zone. Since the conntrack module is internal to OVS in Windows, this functionality needs to be added in. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add new NlFillOvsMsgForNfGenMsg method in Netlink.cSairam Venugopal2016-07-012-0/+43
| | | | | | | | | | Create a new method to create and fill OvsMessage with NfGenMsg. This will be used for sending Netfilter based Netlink messages. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add support for Netfilter netlink messageSairam Venugopal2016-07-013-2/+27
| | | | | | | | | | | Introduce NF_GEN_MSG_HDR similar to GENL_MSG_HDR that will be used for communicating via netfilter-netlink channel. This will be used by userspace to retrieve and modify Conntrack data in Windows. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* Windows: Add conntrack netfilter netlink definitions to kernel and userspaceSairam Venugopal2016-07-014-0/+426
| | | | | | | | | | | | Include netfilter-conntrack header definitions. This will be used by Windows userspace for adding debugging support in Conntrack. Few of these files are intentionally left blank to avoid removing #includes in userspace. New file - OvsDpInterfaceCtExt.h has been defined similar to OvsDpInterfaceExt.h to be reused by userspace and kernel. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Cleanup conntrack-tcp.cSairam Venugopal2016-07-012-53/+51
| | | | | | | | | | Update the code to use tcp->flags. This keeps the kernel conntrack-tcp.c file in sync with userspace version. This patch also addresses an warning - 'Comparison of a boolean expression with an integer other than 0 or 1' - (tcp_flags & (TCP_ACK|TCP_RST)) == (TCP_ACK|TCP_RST)) Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Conntrack - Fix variable initializationSairam Venugopal2016-06-271-1/+1
| | | | | | | | Initialize the variable pktMdLabel. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Handle possible NULL pointer dereference in STT.Paul Boca2016-06-271-9/+43
| | | | | | | | | Check if OvsAllocatememoryWithTag succeeded or not. In case of failure propagate cleanup and return. Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Address minor alignment issues in Stt code.Yin Lin2016-06-241-1/+1
| | | | | | 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: Add Geneve supportYin Lin2016-06-2411-75/+715
| | | | | | 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: Remove double semi-colon(; ) in Tunnel.cSairam Venugopal2016-06-241-1/+1
| | | | | | | Found by inspection. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Handle memory allocation failure for event creationSairam Venugopal2016-06-241-0/+7
| | | | | | | | Release the lock and return if an event entry fails to get allocated. 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: Add support for UDP and ICMP to Conntrack ModuleSairam Venugopal2016-06-246-53/+239
| | | | | | | | | Enable support for UDP and ICMP in the connection tracking module on Hyper-V. Define 1s as variable and reuse it. 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: Add GRE checksumAlin Serdean2016-06-242-36/+92
| | | | | | | | | | | | | This patch introduces GRE checksum computation if the userspace requires it on Tx. On Rx we verify the GRE checksum if the checksum bit was specified and also inform the userspace about it. Also fix the GRE header length as specified by the GRE flags not the tunnel flags. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.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: Remove unused headers in Event.cSairam Venugopal2016-06-221-2/+0
| | | | | | | | Cleanup unused headers. Found by inspection. 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: Remove unused headers from Datapath.cSairam Venugopal2016-06-211-7/+0
| | | | | | | | Clean up unused headers in Datapath.c. Found by inspection. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Yin Lin<linyi@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: comment cleanup and indentationNithin Raju2016-06-202-15/+10
| | | | | | | Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolution.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: use ip proto for tunnel port lookupNithin Raju2016-06-174-30/+91
| | | | | | | | | | | | | | | | | | 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: Sample action support.Sorin Vinturis2016-06-142-33/+175
| | | | | | | | | | | | | This patch adds support for sampling to the OVS extension. The following flow was used for generating sample actions: ovs-ofctl add-flow tcp:127.0.0.1:9999 "actions=sample( probability=12345,collector_set_id=23456,obs_domain_id=34567, obs_point_id=45678)" Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Add ECN support on STT decapsulationPaul Boca2016-06-073-11/+85
| | | | | Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: STT reassemble small fixPaul Boca2016-06-072-3/+14
| | | | | | | | | Fixed possible deadlock in case NdisGetDataBuffer fails Validate the segment length and offset on reassemble to avoid buffer overflow Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Add VLAN support to STTPaul Boca2016-06-071-1/+21
| | | | | | | | Add VLAN to STT header and on receive applyit to encapsulated packet Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Improved offloading on STT tunnelPaul Boca2016-06-076-114/+377
| | | | | | | | | | | | | | | | | *Added OvsExtractLayers - populates only the layers field without unnecessary memory operations for flow part *If in STT header the flags are 0 then force packets checksums calculation on receive. *Ensure correct pseudo checksum is set for LSO both on send and receive. Linux includes the segment length to TCP pseudo-checksum conforming to RFC 793 but in case of LSO Windows expects this to be only on Source IP Address, Destination IP Address, and Protocol. *Fragment expiration on rx side of STT was set to 30 seconds, but the correct timeout would be TTL of the packet Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Fix alignment on Offload.cAlin Serdean2016-06-011-3/+5
| | | | | | | | Found by inspection. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Add UDP checksum verifications for VXLANAlin Serdean2016-06-011-10/+33
| | | | | | | | | | | | | Introduce UDP checksum if it was specified in the tunnel information on Tx. Set the tunnel checksum information flag on the flow if the UDP checksum was non zero on the Rx. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com>
* datapath-windows: Move UDP checksum computation to Offload.cYin Lin2016-06-013-46/+53
| | | | | | | | | UDP checksum computation is shared by both vxlan and geneve on Windows. Move the function so that the code can be shared. Signed-off-by: Yin Lin <linyi@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: o/p buffer must fit NL error messageNithin Raju2016-05-256-45/+48
| | | | | | | | | | | | | | | | | 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: don't map output buffer in OVS_IOCTL_WRITENithin Raju2016-05-251-13/+0
| | | | | | | | | | | The contract of OVS_IOCTL_WRITE is that write operations will not need the output buffer. Only the input buffer will be used in the IRP. So, better to not map the output buffer at all. 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: remove extract flow in OvsDoRecirc()Nithin Raju2016-05-251-9/+0
| | | | | | | | | | | | | It is not necessary to do a flow extract in OvsDoRecirc(). In fact, doing it would overwrite the tunnel key within 'key'. So, let's remove the call. Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Co-Authored-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* datapath-windows: Use l2 port and tunkey during executeNithin Raju2016-05-251-2/+30
| | | | | | | | | | | | | While testing DFW and recirc code it was found that userspace was calling into packet execute with the tunnel key and the vport added as part of the execute structure. We were not passing this along to the code that executes actions. The right thing is to contruct the key based on all of the attributes sent down from userspace. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* datapath-windows: Make _MapTunAttrToFlowPut() globalNithin Raju2016-05-252-9/+9
| | | | | | | | Move this function out from file scope. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* datapath-windows: add nlMsgHdr to OvsPacketExecuteNithin Raju2016-05-252-5/+9
| | | | | | | | We'll need this for parsing nested attributes. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* datapath-windows: Validate Netlink packets' integrity.Paul Boca2016-05-166-55/+150
| | | | | | | | | 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: Fix recirculation when it is not the last attributeSairam Venugopal2016-04-271-2/+6
| | | | | | | | | | When the recirc action is in middle, the current code creates a clone of the NBL. However, it overwrites the pointer to point to the cloned NBL without completing it. This causes a memory leak that crashes the kernel. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Fix bug in OvsTcpGetWscale().Daniele Di Proietto2016-04-271-3/+3
| | | | | | | | | | | | | | The userspace conntrack had a bug in tcp_wscale_get(), where the length of an option would be read from the third octet of the option TLV instead of the second. This could cause an incorrect wscale value to be returned, and it would at least impact performance. Also use 'int' instead of 'unsigned' for 'len', since the value can be negative. CC: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* datapath-windows: Pause switch state on PnP eventAlin Serdean2016-04-261-2/+6
| | | | | | | | | | | | | | | | A PnP(plug and play) event will be triggered before trying to disable the extension. We could use this PnP event to prepare for detaching the datapath. This patch sets the switch into a paused state so no more net buffers are queued. Also clean some commentaries. 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@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: Add braces to fix error C2275.Sairam Venugopal2016-04-221-1/+2
| | | | | | | | | | | Add braces around the if statement to prevent Visual Studio from giving the "error C2275: illegal use of this type as an expresion". This happens when a variable is declared after a block. This error occurs on certain versions of compilers. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: remove OvsAllocateForwardingContextForNBLNithin Raju2016-04-211-10/+0
| | | | | | | | Dead code. 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: Add ICMP types in NetProto.hSairam Venugopal2016-04-211-7/+46
| | | | | | | | | Update NetProto.h to include ICMP and ICMPv6 types. Update ICMP header to keep it consistent with KVM. Add UDP and ICMP min length definitions. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>