summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Switch.h
Commit message (Collapse)AuthorAgeFilesLines
* datapath-windows: Add guards around IpHelper adapter binding callsSairam Venugopal via dev2019-04-031-0/+2
| | | | | | | | | | | | Protect internal adapter up/down calls with a dispatch lock. It was observed that the InternalAdapter bind calls could happen out of order thereby causing encap packets to not be sent properly. Add assert around the IpHelper bind calls to ensure Up/Down gets called only for the appropriate vports. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add function annotations for OvsReleaseDatapathAlin Serdean2017-08-021-0/+4
| | | | | | | | | | | The function should be aware that it requires a certain dispatch level, restores the dispatch level, requires lock held and releases a lock. This patch adds annotation for that. 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 function annotations for OvsAcquireDatapathWriteAlin Serdean2017-08-021-0/+3
| | | | | | | | | | | The function should be aware that it raises the dispatch level, saves the dispatch level and acquires a lock. This patch adds annotation for that. 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 function annotations for OvsAcquireDatapathReadAlin Serdean2017-08-021-0/+3
| | | | | | | | | | | The function should be aware that it raises the dispatch level, saves the dispatch level and acquires a lock. This patch adds annotation for that. 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 multiple switch internal portsAlin Serdean2016-12-201-4/+5
| | | | | | | | | | | | This patch adds multiple internal ports support to the windows datapath. All tunnels types have been updated to accommodate this new functionality. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Co-authored-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Paul Boca <pboca@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* tunneling: Remove gre64 tunnel support.Pravin B Shelar2015-08-201-2/+1
| | | | | | | | | | GRE64 was introduced to extend gre key from 32-bit to 64-bit using gre-key and sequence number field. But GRE64 is not standard protocol. There are not many users of this protocol. Therefore we have decided to remove it. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath-windows: Stateless TCP Tunnelling protocol - Initial implementationEitan Eliahu2015-06-111-2/+0
| | | | | | | | | | | | | | | | | | | This change include an initial implementable of STT. The following should be added: [1] Checksum offload (SW and HW) [2] LSO (SW and HW) [3] IP layer WFP callout for IP segments Added support for multiple (per TCP port) STT ports Testing: link layer connection through ping works. File transfer. Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Co-authored-by: Saurabh Shah <ssaurabh@vmware.com> Signed-off-by: Saurabh Shah <ssaurabh@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Support for multiple VXLAN tunnelsSorin Vinturis2015-05-271-2/+4
| | | | | | | | | | | | | | At the moment the OVS extension supports only one VXLAN tunnel that is cached in the extension switch context. Replaced the latter cached pointer with an array list that contains all VXLAN tunnel vports. 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/64 Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Solved BSOD when uninstalling the driver (race condition)Sorin Vinturis2015-04-071-1/+5
| | | | | | | | | | | | | | The BSOD occurred because the FilterAttach routine released the switch context, while there were IRPs in processing. The solution was to add a reference count to prevent premature deallocation of the global switch context structure, gOvsSwitchContext. 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/58 Acked-by: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: Add a WFP system providerSorin Vinturis2015-01-061-0/+1
| | | | | | | | | | | | This patch was enforced by the WHCK logo testing. In order to pass the Windows Filtering Platform tests we need to add a persistent system provider. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/65 Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: clarify 'portIdHashArray' in the swithc contextNithin Raju2014-11-201-1/+4
| | | | | | | | | | | | In this patch, we update the documentation for 'portIdHashArray' to indicate that a vport would exist in this hash table if and only if it also exists on the Hyper-V switch. This functionality to implement this semantic will follow in subsequent patches. Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: Update vport add code.Nithin Raju2014-10-281-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this patch, we make the following updates to the vport add code: 1. Clarify the roles of the different hash tables, so it is easier to read/write code in the future. 2. Update OvsNewVportCmdHandler() to support adding bridge-internal ports. 3. Fixes in OvsNewVportCmdHandler() to support adding external port. Earlier, we'd hit ASSERTs. 4. I could not figure out way to add a port of type OVS_PORT_TYPE_INTERNAL with name "internal" to the confdb using ovs-vsctl.exe. And, this is needed in order to add the Hyper-V internal port from userspace. To workaround this problem, we treat a port of type OVS_PORT_TYPE_NETDEV with name "internal" as a request to add the Hyper-V internal port. This is a workaround. The end result is that there's a discrepancy between the port type in the datpaath v/s confdb, but this has not created any trouble in testing so far. If this ends up becoming an issue, we can mark the Hyper-V internal port to be of type OVS_PORT_TYPE_NETDEV. No harm. 5. Because of changes indicated in #1, we also update the vport dump code to look at the correct hash table for ports added from userspace. 6. Add a OvsGetTunnelVport() for convenience. 7. Update ASSERTs() while cleaning up the switch. 8. Nuke OvsGetExternalVport() and OvsGetExternalMtu(). Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Clarify externalVport.Nithin Raju2014-10-281-9/+43
| | | | | | | | | | | | | | In this patch, we add some explanation about the usage of 'externalVport' in the switch context. Also, we rename 'externalVport' to 'virtualExternalVport' in alignment with the explanation. Also, we rename 'numVports' to 'numHvVports' since ports are added from 2 ends now. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Refactor CreateQueue function to handle vport pid.Ankur Sharma2014-10-241-0/+1
| | | | | | | | | Refactored CreateQueue function so that packets are enqueued to correct corresponding queue. Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: pid-instance hash table data structure.Ankur Sharma2014-10-231-0/+3
| | | | | | | | | This patch introduces data structure for holding instances hashed by pid. Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> cked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: pass NDIS_RWL_AT_DISPATCH_LEVEL instead of BOOLEANNithin Raju2014-10-131-2/+4
| | | | | | | | | | In 'OvsAcquireDatapathRead()' and 'OvsAcquireDatapathWrite()', we seem to be passing a BOLEAN instead of NDIS_RWL_AT_DISPATCH_LEVEL. Signed-off-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: Make VPORT ovs number values smaller than MAXUINT16Alin Serdean2014-10-091-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For this, the old method of finding vports based on the ovs port numbers is removed. Now, the lookup of a vport by ovs port number is done the same way as the lookup by hyper-v switch port id. This is done so that the kernel is able to interact with the userspace correctly when using vport channels. The problem manifested in lib/dpif-netlink.c, at the function vport_add_channels. This patch removes the field vportArray from OVS_SWITCH_CONTEXT. In its place, portNoHashArray is set. In the OVS_VPORT_ENTRY struct, we also add portNoLink. This new method will do lookup and insertions of vports by ovs (datapath) port numbers the same way it is done for hyper-v switch port ids. This patch implicitly removes the indexes, which were previously used in insertions and lookups on ovs port numbers. The removal of the index also means that the vxlan vport can no longer be looked up the same way as it was done before: now we hold a pointer to it, vxlanVport in OVS_SWITCH_CONTEXT. For the moment, we can have only one vxlan vport. When more will be allowed, this field will turn into a list of vxlan ports. The invalid port number value (held in OVS_DPPORT_NUMBER_INVALID) is now changed from 0 to MAXUINT16, the same as it is on linux. The function OvsComputeVportNo has also been removed, since the computation of a vport port number can no longer be done like this. When vport add will be added, a new, updated OvsComputeVportNo function will be added. Also, in OvsInitVportCommon, we no longer need to (and no longer can) initialize vport->ovsName, nor vport->ovsNameLen, because they will be initialized by the netlink command vport add. Since the netlink command vport add will generate numbers for the datapath (ovs) port numbers and set the port names, we cannot insert the vport into the hash array of port numbers here, nor into the hash array of port names. Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Tested-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Rename switch context's portHashArray and vport's portLinkAlin Serdean2014-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The field portLink of the OVS_VPORT_ENTRY is the link within the OVS_SWITCH_CONTEXT's hash array of vports portHashArray, hashed by the portId field of the OVS_VPORT_ENTRY. Later on, we will need to modify the OVS_VPORT_ENTRY so that its port numbers are set to maximum MAXUINT16. This will require that the field vportArray of OVS_SWITCH_CONTEXT be removed and replaced with a hash array, portNoHashArray. Also, a new field, portNoLink, will need to be added to OVS_VPORT_ENTRY. In order to differentiate between portHashArray and portNoHashArray, portHashArray is renamed to portIdHashArray. Also, in order to differentiate between portLink and portNoLink, portLink is renamed to portIdLink. In a future patch the vport functionality will be changed to constraint the port numbers to MAXUINT16. Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Tested-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Rename switch context's nameHashArray and vport's nameLink ↵Alin Serdean2014-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | login register The field nameLink of the OVS_VPORT_ENTRY is the link within the OVS_SWITCH_CONTEXT's hash array of vports nameHashArray, hashed by the ovsName field of the OVS_VPORT_ENTRY. Later on, the friendly name of the hyper-v switch port will need to be set from userspace using WMI. This will require that the hyper-v switch port friendly name be set to the exact string value as the ovs (datapath) port name set from netlink command vport add. The vport will need to differentiate between the ovs (datapath) port name and hyper-v switch port friendly name, because they may differ in erroneous scenarios, or state differences between the hyper-v switch port and the ovs (datapath) port. This may happen if the vport was created by the netlink command vport add, but the VM disconnected (i.e. the hyper-v switch port was later deleted). Storing another field in vport, "portFriendlyName" would normally make the current switchContext->nameHashArray and vport->nameLink confusing since the "name"-s may be understood to mean the hyper-v switch port friendly name, or the hyper-v switch port name, when it actually refers to the ovs (datapath) port name. Hence, the variable nameHashArray is renamed to ovsPortNameHashArray, while the nameLink is renamed to ovsPortNameLink. This change will make a clearer connection between these and the vport field "ovsName" to which they revolve around. Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Tested-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Update OVS_SWITCH_CONTEXT: external and internal portAlin Serdean2014-10-091-2/+4
| | | | | | | | | | | | | | | | | | | The fields externalVport and internalVport of the OVS_SWITCH_CONTEXT struct are currently defined as PVOID. However, all over the code they are used as POVS_VPORT_ENTRY. In order to improve clarity and reduce the need for useless casts to POVS_VPORT_ENTRY, this patch changes the type from PVOID to POVS_VPORT_ENTRY. This patch does not cleanup the code that already uses casts to POVS_VPORT_ENTRY. This cleanup can be done later on as well. Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Tested-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Rename files.Samuel Ghinet2014-08-291-0/+169
This patch includes the file renaming and accommodations needed for the file renaming to build the forwarding extension for Hyper-V. This patch is also a follow-up for the thread: http://openvswitch.org/pipermail/dev/2014-August/044005.html Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>