summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Flow.c
Commit message (Collapse)AuthorAgeFilesLines
* datapath-windows: Update layers for multiple tunnels processingWilson Peng2022-06-221-1/+1
| | | | | | | | | | | | | | | | | | | While testing OVS-windows for multiple IPV6 Geneve tunnels on Windows2019VM, for the broadcast/mutlicast packets, it needs to flood out via configured multiple Geneve tunnels. Then in some flow pipeline processing, it may have at least two tunnel processing in OVS_ACTION_ATTR_SET action. When processing the second tunnel setting it may need flush out the packet out via tunnel before setting new tunnel parameter in tunKey. We found in this case, after flushing out the packet out via tunnel, the related layers pointer does not update. In our test setup on Windows2019VM, it will cause BSOD which is triggered in other Windows processes. We suspect it may be related to memory overwriting. When we apply the fix in the patch, no BSOD is observed on the same VM and same packet/tunnel settting. Another thing needs to be mentioned is for multiple Geneve IPv4 tunnels, the same kind broadcase/multicast packet will not cause BSOD. Signed-off-by: Wilson Peng <pweisong@vmware.com> Signed-off-by: Alin-Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add IPv6 conntrack support on Windows.ldejing2022-04-221-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementation on Windows: Currently, IPv4 conntrack was supported on the windows platform. In this patch we have implemented ipv6 conntrack functions according to the current logic of the IPv4 conntrack. This implementation has included TcpV6(nat and normal scenario), UdpV6(nat and normal scenario), IcmpV6 conntrack of echo request/reply packet and FtpV6(nat and normal scenario). Testing Topology: On the Windows VM runs on the ESXi host, two hyper-v ports attached to the ovs bridge; one hyper-v port worked as client and the other port worked as server. Testing Case: 1. TcpV6 a) Tcp request/reply conntrack for normal scenario. In this scenario, 20::1 as client, 20::2 as server, it will generate following conntrack entry: (Origin(src=20::1, src_port=1555, dst=20::2, dst_port=1556), reply(src=20::2,src_port=1556,dst=20::1,dst_port=1555),protocol=tcp) b) Tcp request/reply conntrack for nat scenario. In this scenario, 20::1 as client, 20::10 as floating ip, 21::3 as server, it will generate following conntrack entry: (Origin(src=20::1, src_port=1555, dst=20::10, dst_port=1556), reply(src=21::3, src_port=1556, dst=20::1, dst_port= 1555),protocol=tcp) 2. UdpV6 a) Udp request/reply conntrack for normal scenario. (Origin(src=20::1, src_port=1555, dst=20::2, dst_port=1556), reply(src=20::2,src_port=1556,dst=20::1,dst_port=1555),protocol=udp) b) Udp request/reply conntrack for nat scenario. (Origin(src=20::1, src_port=1555, dst=20::10, dst_port=1556), reply(src=21::3, src_port=1556, dst=20::1, dst_port= 1555),protocol=udp) 3. IcmpV6: a) Icmpv6 request/reply conntrack for normal scenario. Currently Icmpv6 only support to construct conntrack for echo request/reply packet, take (20::1 -> 20::2) for example, it will generate following conntrack entry: (origin(src = 20::1, dst=20::2), reply(src=20::2, dst=20::1), protocol=icmp) b) Icmp request/reply conntrack for dnat scenario, for example (20::1->20::10->21::3), 20::1 is client, 20::10 is floating ip, 21::3 is server ip. It will generate flow like below: (origin(src=20::1, dst=20::10), reply(src=21::3, dst=20::1), protocol=icmp) 4. FtpV6 a) Ftp request/reply conntrack for normal scenario. In this scenario, take 20::1 as client, 20::2 as server, it will generate two conntrack entries: Ftp active mode (Origin(src=20::1, src_port=1555, dst=20::2, dst_port=21), reply(src=20::2, src_port=21, dst=20::1, dst_port=1555), protocol=tcp) (Origin(src=20::2, src_port=20, dst=20::1, dst_port=1556), reply(src=20::1, src_port=1556, dst=20::2, dst_port=20), protocol=tcp) Ftp passive mode (Origin(src=20::1, src_port=1555, dst=20::2, dst_port=21), reply(src=20::2,src_port=21,dst=20::1,dst_port=1555),protocol=tcp) (Origin(src=20::1, src_port=1556, dst=20::2, dst_port=1557), reply(src=20::2,src_port=1557, dst=20::1, dst_port=1556) protocol=tcp) b) Ftp request/reply conntrack for nat scenario. Ftp passive mode, In this secnario, 20::1 as client, 20::10 as floating ip, 21::3 as server ip. It will generate following flow: (Origin(src=20::1, src_port=1555, dst=20::10, dst_port=21), reply(src=21::3, src_port=21, dst=20::1, dst_port= 1555),protocol=tcp) (Origin(src=20::1, src_port=1556, dst=20::10, dst_port=1557), reply(src=21::3, src_port=1557, dst=20::1, dst_port= 1556),protocol=tcp) 5. Regression test for IpV4 in Antrea project (about 60 test case) Future work: 1) IcmpV6 redirect packet conntrack. 2) IpV6 fragment support on Udp. 3) Support napt for IPv6. 4) FtpV6 active mode for nat. Signed-off-by: ldejing <ldejing@vmware.com> Signed-off-by: Alin-Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add IPv6 Geneve tunnel support in WindowsWilson Peng2022-04-101-44/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the first step OVS Windows will support IPv6 tunnel(Geneve IPv6 tunnel). Implementation on Windows ------------------------- 1. For the IPv6 tunnel support,  OvsIPTunnelKey will replace original OvsIPv4TunnelKey in the related flow context handing. 2. The related src and dst address will be  changed to SOCKADDR_INET type from UINT32. 3. For the IPv6 tunnel,  one node running OVS-Windows could encapsulate IPv4/IPv6 Packets via IPV6 Geneve Tunnel, and the node could also encapsulate IPv4/IPv6 packet Via IPv4 Geneve tunnel. 4. Related IPHelper data structure will be adapted to support IPv6 Tunnel. In the IPHelper part the related Windows API(such as GetUnicastIpAddressTable/GetBestRoute2/GetIpNetEntry2/ ResolveIpNetEntry2) and Windows data structure(MIB_IPFORWARD_ROW2/MIB_IPNET_ROW2/IP_ADDRESS_PREFIX) Have already supported both IPv4 and IPV6. Now OVS Windows has been adjusted some functions And data structured to support IPV6 tunnel also. 5. OVS_TUNNEL_KEY_ATTR_IPV6_SRC and OVS_TUNNEL_KEY_ATTR_IPV6_DST filed will be supported in OVS-Windows kernel for IPV6 tunnel. Testing done. ------------------------- Related topo, 1 Windows VM(Win2019) and 2 Ubuntu 16.04 server. Both VMs Are running on one ESX host. 1. Setup one IPV6 Geneve Tunnel between 1 Windows VM and 1 Ubuntu server. Windows VM, vif0( 6000::2/40.1.1.10) vif1(5000::2)—— Ubuntu VM Eth2(5000::9), name space ns1 with interface ns1_link_peer(6000::9/40.1.1.2) Related tunnnel, ovs-vsctl.exe add-port br-int bms-tun0 -- set interface bms-tun0 type=Geneve options:csum=true options:key=flow options:local_ip="5000::2" options:remote_ip=flow In this topo, traffic from Vif0(Win) to ns1_link_peer(Ubuntu) will be gone through the Geneve tunnel (5000::2—>5000::9) for both IPv4 traffic(40.1.1.10-->40.1.1.2) and IPv6 traffic(6000::2—>6000::9) 2. Setup one IPV4 Geneve Tunnel between Windows VM and 1 Ubuntu server. Windows VM, vif0( 6000::2/40.1.1.10) vif1(50.1.1.11)—— Ubuntu, Eth2(50.1.1.9), name space ns1 with interface ns1_link_peer(6000::19/40.1.1.9) Related tunnnel, ovs-vsctl.exe -- set Interface bms-tun0 type=geneve options:csum=true options:key=flow options:local_ip="50.1.1.11" options:remote_ip=flow In this topo, traffic from Vif0(Win) to ns1_link_peer(Ubuntu) will be gone through the Geneve Tunnel (50.1.1.11—>50.1.1.9) for both IPv4 traffic(40.1.1.10-->40.1.1.9) and IPv6 traffic(6000::2—>6000::19). 3.Regression test for IpV4 in Antrea project (about 60 test case) is PASS Future Work ----------- Add other type IPv6 tunnel support for Gre/Vxlan/Stt. Signed-off-by: Wilson Peng <pweisong@vmware.com> Signed-off-by: Alin-Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Append tunnel info to upcall for correct templateAmber Hu via dev2020-02-101-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Formerly, there is no tunnel information appended in the upcall’s packet data, which is expected by IPFIX in userspace to calculate the template for exporting the sampled flow record of on egress tunnel port. To fix this, during performing OvsOutputUserspaceAction(), we would check whether it is initiated by the sampling on egress tunnel which would be indicated by the attribute as OVS_USERSPACE_ATTR_EGRESS_TUN_PORT in the nested attribute list. If so, we would append the tunKey in OvsForwardingContext indexed by OVS_PACKET_ATTR_EGRESS_TUN_KEY to the upcall. Besides, at this point, the source transport port and source ip address are not available in the structure, so we have to fill it in the way how the packet would be capsulated during performing OvsEncapGeneve(), which is following the OvsOutputUserspaceAction() unfortunately. I have tested the IPFIX functionality with the change, we could see the template is correct and the expected tunnel information could be packed in the IPFIX packet finally. The traffic for test is generated by PING utility. >From d727d051c9a44a4a93e5ee5f3da3ca9b125aad29 Mon Sep 17 00:00:00 2001 From: Amber Hu <qhu@vmware.com> Date: Thu, 30 Jan 2020 18:01:32 -0800 Subject: [PATCH v3] datapath-windows: Append tunnel info to upcall for correct template Signed-off-by: Amber Hu <qhu@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Fix vlan key getting stored in host byte order.Anand Kumar via dev2019-04-091-2/+2
| | | | | | | Update flowkey to set vlan information in network byte order. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add support for 'OVS_KEY_ATTR_ENCAP' key attribute.Anand Kumar2019-01-281-13/+113
| | | | | | | | | | | | | | | | | Add a new structure in l2 header to accomodate vlan header, based of commit "d7efce7beff25052bd9083419200e1a47f0d6066 datapath: 802.1AD Flow handling, actions, vlan parsing, netlink attributes" Also reset vlan header in flow key, after deleting vlan tag from nbl With this change a sample vlan flow would look like, eth(src=0a:ea:8a:24:03:86,dst=0a:cd:fa:4d:15:5c),in_port(3),eth_type(0x8100), vlan(vid=2239,pcp=0),encap(eth_type(0x0800),ipv4(src=13.12.11.149,dst=13.12.11.107, proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)) 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: Use only non executable memoryAlin Serdean2017-11-291-1/+1
| | | | | | | | | | | 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: Add validations for IP_HEADER_LENShashank Ram2017-06-221-0/+5
| | | | | | | | | | | Adds validations in OvsGetIp() to make sure the IHL is within valid bounds. If IHL is invalid, then the packet is dropped by the callers of this function. 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>
* datapath-windows: Add support for NAT in conntrackAnand Kumar2017-06-121-2/+2
| | | | | | | | | | | | | Add support for parsing netlink attributes related to NAT in conntrack. Co-Authored-by: Yin Lin <linyi@vmware.com> Co-Authored-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Yin Lin <linyi@vmware.com> Signed-off-by: Darrell Ball <dlu998@gmail.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Add original conntrack tuple to FlowKeySairam Venugopal2017-06-081-2/+48
| | | | | | | | | Add the original tuple to Flow Key. In case of ICMP and UDP, default the parent entry to NULL until related connections is supported. 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 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: 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 assert in OvsHashFlow()Nithin Raju2016-09-011-0/+1
| | | | | | Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: remove invalid ASSERT in Flow.cNithin Raju2016-08-311-1/+0
| | | | | | | | | | Since the Geneve changes, the key->l2.offset will no longer be 0 when the tunnel key is valid within the OVS flow key. key->l2.offset would be determined by the amount of tunnel options. 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: Fix various Geneve bugsYin Lin2016-07-211-1/+1
| | | | | | | 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-16/+163
| | | | | | 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: comment cleanup and indentationNithin Raju2016-06-201-10/+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: Improved offloading on STT tunnelPaul Boca2016-06-071-37/+206
| | | | | | | | | | | | | | | | | *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: o/p buffer must fit NL error messageNithin Raju2016-05-251-7/+9
| | | | | | | | | | | | | | | | | 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: Make _MapTunAttrToFlowPut() globalNithin Raju2016-05-251-9/+7
| | | | | | | | 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: Validate Netlink packets' integrity.Paul Boca2016-05-161-19/+23
| | | | | | | | | 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: Removed double initialization on local variablesPaul Boca2016-04-211-1/+1
| | | | | | Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Add Connection Tracking SupportSairam Venugopal2016-04-141-2/+126
| | | | | | | | | | | | | | | | | | | | Enable support for Stateful Firewall in Hyper-V by adding a Connection Tracking module. The module has been ported over from the userspace implementation patch of a similar name. The current version of the module supports ct - zone, mark and label for TCP packets. Support for other packet formats will be added in subsequent patches. The conntrack-tcp module is adapted from FreeBSD's pf subsystem and hence the BSD license. It has been ported over to match OVS Hyper-V coding style. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Co-Authored-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Update flow lookup to support RecircId and DpHashSairam Venugopal2016-03-311-9/+24
| | | | | | | | | | | Update the OvsLookupFlow to include RecircId and DpHash in its flow comparison. Revert the keyLen related changes until they are aligned appropriately. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-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 OVS_KEY_ATTR_ICMP supportAlin Serdean2016-03-311-3/+9
| | | | | | | | | | | Revisit the mapping of an IPv4 key to netlink key and add the according transformation. Also add support for OVS_KEY_ATTR_ICMP to the windows datapath. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Fix OVS_KEY_ATTR_ICMPV6 supportAlin Serdean2016-03-311-5/+4
| | | | | | | | This patch applies the conversions needed for the ICMPv6 type and code. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Fix alignment in Flow.c.Nithin Raju2016-03-251-28/+28
| | | | | | | Cosmetic changes. Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Extract flow metadata in execute cmd handler.Sorin Vinturis2016-03-251-0/+19
| | | | | | | Signed-off-by: Sorin Vinturis <svinturis@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: Support for OVS_ACTION_ATTR_HASH attributeSorin Vinturis2016-03-251-0/+14
| | | | | | | Signed-off-by: Sorin Vinturis <svinturis@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: Allow recirculation feature probe.Sorin Vinturis2016-03-251-1/+8
| | | | | | | | | | | | | Recirculation feature probe messages sent from userspace are suppressed by the OVS extension. This patch changes the current behaviour to allow feature probe for recirculation. Signed-off-by: Sorin Vinturis <svinturis@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: Added recirculation support.Sorin Vinturis2016-03-251-7/+18
| | | | | | | | | | | | | Recirculation support for the OVS extension. Tested using PING and iperf with Driver Verifier enabled. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/104 Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Change reported time for flowsAlin Serdean2016-03-231-23/+38
| | | | | | | | | | | | | | | | | | Currently the datapath reports the tick counter to the userspace. The userspace uses KeQueryPerformanceCounter as a monotonic clock. This patch changes the flow stats to be reported in a monotonic format, while also decaying the time between the flow actual usage and the flow report usage. This patch also changes to report EEXIST if the userspace tries to add the same flow twice. After adding a flow, lookup the flow only if the extension is compiled in debug mode. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Fix small bug in MPLSAlin Serdean2016-02-101-0/+1
| | | | | | | | | The keylen is not properly updated in the case of MPLS, directly causing the hash to be calculated improperly. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Accept MPLS feature probe.Sorin Vinturis2016-02-021-7/+65
| | | | | | | | | | | | Currently all feature probe messages sent from userspace are suppressed by the OVS extension. This patch changes the current behaviour to allow feature probe for MPLS. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Support for OVS_KEY_ATTR_MPLS attributeSorin Vinturis2016-02-021-6/+96
| | | | | | | | | | | | This patch adds OVS_KEY_ATTR_MPLS to the OVS flow mechanism. Tested using ping. Tested using iperf (TCP and UDP). Tested using DriverVerifier. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Support for OVS_KEY_ATTR_SCTP attributeSorin Vinturis2015-11-241-1/+5
| | | | | | | | This patch adds OVS_KEY_ATTR_SCTP to the OVS flow mechanism. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Revert "datapath-windows: Support attribute OVS_KEY_ATTR_TCP_FLAGS"Alin Serdean2015-10-271-31/+9
| | | | | | | | | | | | | | This reverts commit a26b2023ce33fed1ef962012dc2c03765d2e92cb. This patch punishes performance without the implementation of megaflows on Windows. Once megaflows is implemented in the flow logic this patch will be revisited. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: Support attribute OVS_KEY_ATTR_TCP_FLAGSAlin Gabriel Serdean2015-10-231-9/+31
| | | | | | | | | | | | This patch adds OVS_KEY_ATTR_TCP_FLAGS to our flow mechanism. Also clean unecesarry parts of code. 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: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: Fix IP fragmentationAlin Serdean2015-10-021-3/+3
| | | | | | | | | | | | | Currently in the case of IP fragmentation we send to the userspace that the flag for the last fragment is 3 when it actually should be a value between 0..2. This patch fixes the problem and also uses the values used in the common header of the datapath. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Append flow attribute keyAlin Serdean2015-09-181-19/+41
| | | | | | | | | | | | | | | | | | | | | | | | Currently when running the vswitch daemon we get a lot of messages of the form: 2015-09-10T23:04:21Z|07255|dpif(revalidator11)|WARN|system@ovs-system: failed to flow_del (Invalid argument). The userspace expects after sending a delete flow command, to receive the flow key of the deleted flow. Currently we only send back the statiscs. This patch appends back the flow key attribute for to the response buffer for the flow commands new, modify and delete. This patch also responds to the userspace with ENOENT in the case the flow was not modified, deleted, created or retrieved. Also incorporate some refactors. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Fix broken build.Alin Serdean2015-08-281-5/+5
| | | | | | | | Change variable name from nlAttrs to flowAttrs. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Suppress flow attribute probe.Alin Serdean2015-08-281-1/+8
| | | | | | | | This patch surpresses flow attribute probing in the windows datapath. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Fix iterator in NlAttrParse()Sairam Venugopal2015-08-261-5/+12
| | | | | | Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Solved datapath-windows: BSOD when initializing switch contextAlin Serdean2015-07-021-0/+9
| | | | | | | | | | | | Add check in case of NdisAllocateRWLock fails to allocate the resources. Check datapath->lock before trying to free it. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/92 Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Solved BSOD when handling flowsSorin Vinturis2015-07-011-1/+0
| | | | | | | | | | | | OvsPrepareFlow() returns an error only when the new flow allocation fails. In this case HandleFlowPut() should return error without trying to free the flow, thus avoiding the BSOD. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/91 Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Removed gOvsCtrlLock global spinlockSorin Vinturis2015-04-231-26/+13
| | | | | | | | | | | | | 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: Make GET_PID a separate IOCTLSorin Vinturis2015-04-021-1/+1
| | | | | | | | | | | | | | Added a new IOCTL in order to retrieve the PID from the kernel datapath. The new method uses a direct and cleaner way, as opposed to the old way of using a Netlink transaction, avoiding the unnecessary overhead. 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/31 Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Added specific pool tag for flow codeSorin Vinturis2015-03-261-5/+6
| | | | | | | | | | | All memory allocations within flow code have 'LSVO' pool tag. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/56 Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: set the nlBuf tail properlyAlin Serdean2015-01-061-2/+7
| | | | | | | | | Move the the tail of the netlink buffer accordingly to the input data. Currently _MapFlowStatsToNlStats overrides the netlink header information. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>