summaryrefslogtreecommitdiff
path: root/datapath-windows
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* datapath-windows: Refactor Conntrack Module in Hyper-VSairam Venugopal2016-04-213-16/+14
| | | | | | | | | Minor refactors around naming and reusability in lieu of adding support for other protocols for tracking connections. 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: Removed always true condition in VXLANPaul Boca2016-04-211-4/+2
| | | | | | | | Instance ID flag must be set to 1 in case of valid VXLAN id 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: Removed double initialization on local variablesPaul Boca2016-04-218-20/+18
| | | | | | 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: Avoid using uninitialized gOvsExtDriverHandlePaul Boca2016-04-212-5/+8
| | | | | | | | | Ensure gOvsExtDriverHandle is not used if initialization fails Added PAGED_CODE() where needed 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: post event during vport deleteNithin Raju2016-04-141-0/+8
| | | | | | | | Got left out during the previous round of refactoring. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Add Connection Tracking SupportSairam Venugopal2016-04-1412-4/+1344
| | | | | | | | | | | | | | | | | | | | 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: Apply minor fixes in GetNICAlias().Nithin Raju2016-04-121-4/+4
| | | | | | Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: cleanup after NdisRegisterDeviceEx()Nithin Raju2016-04-121-10/+4
| | | | | | | | The error handling code seems to be wrong. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Hot add CPU support.Sorin Vinturis2016-04-107-108/+117
| | | | | | | | | | | | | | | | Hot add CPU is the ability to dynamically add CPUs to a running system. Adding CPUs can occur physically by adding new hardware, logically by online hardware partitioning, or virtually through a virtualization layer. This patch add support to reallocate any per-cpu resources, in case a new processor is added. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/112 Acked-by: Paul-Daniel Boca <pboca@cloudbasesolutions.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: Update Recirculation to use portId instead of portNoSairam Venugopal2016-03-311-1/+1
| | | | | | | | | | Fix OvsDoRecirc to use the right PortId when there is a flow miss. This is used to determine if a packet is received or transmitted by comparing against the virtualExternalPortId. 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: 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-254-0/+29
| | | | | | | 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-253-0/+53
| | | | | | | 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-2516-63/+851
| | | | | | | | | | | | | 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: Percpu allocation support functionSorin Vinturis2016-03-252-0/+17
| | | | | | | Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Change reported time for flowsAlin Serdean2016-03-232-24/+39
| | | | | | | | | | | | | | | | | | 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: Support for IPv6 in TCP segmentationSairam Venugopal2016-03-141-39/+80
| | | | | | | | | | | | | | | | | | | | When a packet which needs segmentation is received, the header for each segment is being calculated, i.e. IP length, checksum, TCP seq, TCP checksum. The problem with the current code is that it wrongly assumes that the Ethernet frame payload is always an IPv4 packet. This patch checks the EtherType field of the Ethernet frame to see which protocol is encapsulated in its payload, IPv4 or IPv6, and calculates the segment's header accordingly. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Co-authored-by: Sairam Venugopal <vsairam@vmware.com> Reported-by: Sairam Venugopal <vsairam@vmware.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/105 Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Enable multiprocessor compilation on solutionAlin Serdean2016-02-161-0/+4
| | | | | | | | | | Visual Studio defines by default the maximum number of concurrent jobs. This patch allows the parallel built of the solution. 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: Refactor sofware offloads and mssAlin Serdean2016-02-1011-214/+189
| | | | | | | | | | | | | | | | | | The purpose of this patch is to refactor the software offloads found in the VXLAN and GRE code and also to refactor how the maximmum segment size for a given NBL is obtained. This patch introduces two functions OvsApplySWChecksumOnNB and OVSGetTcpMSS. OVSGetTcpMSS - will return the mss found in a given NBL. OvsApplySWChecksumOnNB - will compute and set software offloads for a given NBL. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sorin Vinturis <svinturis at cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Fix small bug in MPLSAlin Serdean2016-02-102-0/+2
| | | | | | | | | 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: fix endless loop on rebootAlin Serdean2016-02-031-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | Testing under 2012 gave some more inisight on an old bug. If a PNP event with the value of NetEventSwitchActivate was triggered we were calling OvsQuerySwitchActivationComplete which does an OID request to the underlying drivers, however this triggered a hang because as per documentation: https://msdn.microsoft.com/en-us/library/windows/hardware/ff561830%28v=vs.85%29.aspx "A driver can call NdisFOidRequest when it is in the Restarting, Running, Pausing, or Paused state." This resulted in an endless booting cycle. Looking at the documentation again: https://msdn.microsoft.com/en-us/library/windows/hardware/ff568751%28v=vs.85%29.aspx NetEventSwitchActivate indicates that the extensible switch has completed activation so we can now safely query the switch itself. Also we are not forwarding the PNP event to the overlaying drivers unless we succeeded in the operation, this issue has been fixed also. 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: Accept MPLS feature probe.Sorin Vinturis2016-02-023-7/+92
| | | | | | | | | | | | 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-0211-31/+371
| | | | | | | | | | | | 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: Add LSOv2 support for VXLANAlin Serdean2016-01-111-3/+15
| | | | | | | | | | | This patch adds LSO version 2 support for the windows datapath. (https://msdn.microsoft.com/en-us/library/windows/hardware/ff568840%28v=vs.85%29.aspx) Tested using psping and iperf3. 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: Fix bug small bug in GRE.Alin Serdean2016-01-111-1/+0
| | | | | | | | Allow GRE encapsulation to take place in the case we have a TCP payload without LSO. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Fix subscribe/unsubscribe packetsAlin Serdean2016-01-041-2/+2
| | | | | | | | | | | | The policy of the subscribe packets is defined by the following: const NL_POLICY policy[] = { [OVS_NL_ATTR_PACKET_PID] = {.type = NL_A_U32 }, [OVS_NL_ATTR_PACKET_SUBSCRIBE] = {.type = NL_A_U8 } }; Switch the value of the join operation with the one from the policy. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Reduce padding size in _OVS_PACKET_HDR_INFO.Nithin Raju2015-12-231-1/+1
| | | | | | | | Fixes: efee3309 ("datapath-windows: Support for OVS_KEY_ATTR_SCTP attribute") Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
* datapath-windows: remove ASSERT in OvsDoFlowLookupOutput()Nithin Raju2015-12-151-1/+0
| | | | | | | | | | | | We needed this ASSERT earlier to catch unexpected cases. This code seems to be fairly stable, and we can remove the ASSERT. It is annoying to be hitting this ASSERT while changing the internal adapter properties. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Cleanup unused variablesAlin Serdean2015-12-142-9/+0
| | | | | | | | This patch removes unused variables defined in stt and vxlan ports. 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: Cleanup Stt.cAlin Serdean2015-12-111-22/+22
| | | | | | | | | | | | | Remove double include for Flow.h and sort the includes alphabetically. Also remove tabs. Found by inspection. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* datapath-windows: Fix small bug in STTAlin Serdean2015-12-111-1/+0
| | | | | | | | | Allow STT encapsulation to take place in the case we have a TCP payload without LSO. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* datapath-windows: Add GRE TEB support for windows datapathAlin Serdean2015-12-118-44/+656
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the support for GRE TEB (trasparent ethernet bridging) for the windows datapath. The GRE support is based on http://tools.ietf.org/html/rfc2890, without taking into account the GRE sequence, and it supports only the GRE protocol type 6558 (trasparent ethernet bridging) like its linux counterpart. Util.h: define the GRE pool tag Vport.c/h: sort the includes alphabetically add the function OvsFindTunnelVportByPortType which searches the tunnelVportsArray for a given port type Actions.c : sort the includes alphabetically call the GRE encapsulation / decapsulation functions when needed Gre.c/h : add GRE type defines add initialization/cleanup functions add encapsulation / decapsulation functions with software offloads (hardware offloads will be added in a separate patch) support Tested using: PSPING (https://technet.microsoft.com/en-us/sysinternals/psping.aspx) (ICMP, TCP, UDP) with various packet lengths IPERF3 (https://iperf.fr/iperf-download.php) (TCP, UDP) with various options Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* datapath-windows: Fix compilation issueSairam Venugopal2015-12-111-1/+1
| | | | | | | | | The previous patch was missing a ";". Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* datapath-windows: Don't assert for unknown actionsNithin Raju2015-12-081-15/+3
| | | | | | | | | | | | On Hyper-V, we currently don't validate a flow to see if datapath can indeed execute all the actions specified or not. While support for it gets implemented, an ASSERT seems too strong. I'm working on the support for actions validation. Here's a workaround in the meantime to help debugging. 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: fix MIN() macroNithin Raju2015-11-251-1/+1
| | | | | | | | | | | | | | | | | | A quick implementation of MIN() didn't take into account operator precedence as shown in the following example: #include <stdio.h> #define MYMIN(_a, _b) (_a) > (_b) ? (_b) : (_a) int main() { if (MYMIN(512, 256) < 14) { printf("buggy MYMIN\n"); } return 0; } Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Russell Bryant <russell@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath-windows: Fix HvUpdateNic() to handle name changesNithin Raju2015-11-252-54/+80
| | | | | | | | | | | | | | | | | If the name of an internal or external NIC changes, we need to disconnect the NIC from OVS since the name is the key. In this change, we generate a link down event. It is as though we got a call to HvDisconnectNic() for the old name and got a HvConnectNic() for the new name. Also, HvCreateNic() has been cleaned up to remove the code to look for existing vport. We won't have a vport now since we'd have deleted the vport in HvDeleteNic(). Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: cleanup AssignNicNameSpecial()Nithin Raju2015-11-251-29/+33
| | | | | | | | | | | | | | | AssignNicNameSpecial() needed to be called outside of a lock and was moved out in a previous change. But, it was accessing vport structure outside of the lock which isn't safe. In this change, we take care of that. I tried to trigger a call to HvUpdateNic() by renaming the interface from the GUI and didn't see any callback. Other changes are tested. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: nuke port # argument in IP helperNithin Raju2015-11-258-20/+18
| | | | | | | | | | | | Port # doesn't make much sense since it has not been computed yet. Also, get rid of OVS_DEFAULT_PORT_NO and use OVS_DPPORT_NUMBER_INVALID instead. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: cleanup events codeNithin Raju2015-11-256-115/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out that we don't need to generate an event is practically useful only in case of a port disconnect to let userspace know. Hence, this event is being posted from HvDisconnectNic(). In case of a new port appearing, it seems that userspace is not interested in a new port unless it was added by userspace itself. In my tests, userspce would end up deleting the port when it got a new port notification, despite the port existing in OVSDB. The reasoning seems simple enough: - On Linux, OVS is integrated with the hypervisor (libvirt for eg) and a port (ie. netdev) gets created in the Linux kernel and then get added to OVSDB. When vswitchd picks up the port addition in OVSDB, it adds the port in the OVS kernel DP. - If the kernel netdev does not exist while OVS userspace tries to create the port in OVS kernel DP, port addition fails. Moreover, the only way to re-add the port is to trigger userspace to re-add the port by deleting the port in OVSDB and re-adding it. With this patch, I have verified that if a VIF gets disconnected on the Hyper-V switch, it disappears from the OVS kernel DP as well. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: cleanup InitHvVportCommon()Nithin Raju2015-11-253-86/+104
| | | | | | | | | | | | | | | | | | | | | The workflow being implemented is that, we need to assign a special name to the internal and external NICs, and it it not necessary to do that from InitHvVportCommon(). The purpose of InitHvVportCommon() is to insert the vport into the hash tables and update the switch context. We special case the name assignment in HvCreateNIC() for internal and external NICs. That seems more meaningful. Also, reused HvCreatePort() to allocate a Vport for each of the external NICs with NicIndex != 0. Due to this HvCreatePort() now takes 'nicIndex' as an additional parameter. Renamed InitHvVportCommon() to UpdateSwitchCtxWithVport(). Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: refactor port enumeration codeNithin Raju2015-11-252-64/+31
| | | | | | | | | | | We already have functions HvCreatePort() and HvCreateNic() to do the work. Might as well use that during port enumeration. More refactoring in later patches. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* datapath-windows: Support for OVS_KEY_ATTR_SCTP attributeSorin Vinturis2015-11-245-2/+41
| | | | | | | | 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>
* datapath-windows: STT - Offload inner checksum calculationSairam Venugopal2015-11-031-75/+58
| | | | | | | | Offload the inner checksum computation to NDIS in OvsDecapStt function. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Report correctly when trying to add tunnel typesAlin Serdean2015-11-031-1/+2
| | | | | | | | | | Report invalid parameter to the userspace if the user tries to add a vport tunnel type which is not supported by the kernel extension. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>