summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Datapath.h
Commit message (Collapse)AuthorAgeFilesLines
* datapath-windows: Add annotations for OvsReleaseCtrlLockAlin Serdean2017-08-021-0/+5
| | | | | | | | | | | Add function annotations for `OvsReleaseCtrlLock`. We make it aware that it requires a certain dispatch level, that it restores the dispatch level, that it requires a lock held and release a lock. 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 annotations for OvsAcquireCtrlLockAlin Serdean2017-08-021-0/+3
| | | | | | | | | | Add annotations to the function `OvsAcquireCtrlLock`. We make it aware that it raises the dispatch level, where it saves the dispatch level and it acquires a lock. 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: Define new multicast conntrack events and netlink protocolSairam Venugopal2016-07-291-1/+2
| | | | | | | | | | | | | | | The Hyper-V datapath supports NETLINK_GENERIC and NETLINK_NETFILTER protocols for netlink communication. Define these two protocols in the datapath. Define new Conntrack events (new and delete) and add support for subscribing to these events. Parse out OVS_NL_ATTR_MCAST_GRP and store it as part of OVS_EVENT_SUBSCRIBE structure. Signed-off-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>
* Windows: Add support for handling protocol (netlink family)Sairam Venugopal2016-07-131-0/+1
| | | | | | | | | | | | | | | 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: Hot add CPU support.Sorin Vinturis2016-04-101-1/+1
| | | | | | | | | | | | | | | | 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: Removed memory barrier and master lockSorin Vinturis2015-05-271-14/+0
| | | | | | | | | | | | | | There is no need to enforce Netlink serialization on transactions sent from userspace. The access to the driver's shared resources is synchronized anyway. Thus I have removed the master lock. I also removed the memory barrier from filter dispatch routine. A memory barrier is already in place in OvsReleaseSwitchContext function, due to the use of InterlockedCompareExchange function. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovs-hyperv: make kernel return values netlink socket likeNithin Raju2015-04-291-2/+0
| | | | | | | | | | | | | | | | | | | | | | | In this patch, we make changes to usersapce as well as kernel datapath on hyperv to make it more netlink socket like. Previously, the kernel datapath did not distinguish between "transport errors" and other errors. Netlink semantics dictate that netlink functions should only return an error only in the case of a "transport error" which is generally something fatal. Eg. failure to communicate with the OVS module, or an invalid command altogether. Other errors such as an unsupported action, or an invalid flow key is not considered a "transport error", and in such cases, netlink functions are to return success with a 'struct nlmsgerr' populated in the output buffer. This patch implements these semantics. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/72 Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Added specific pool tag for datapath codeSorin Vinturis2015-03-261-28/+3
| | | | | | | | | | | All memory allocations within datapath code have 'DSVO' 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: Solved BSOD when loading an activated extensionSorin Vinturis2015-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the OVS extension was previously enabled and the driver unloaded, when the driver is loaded again a BSOD is triggered. This happens because the OVS extension registers its FilterXxx routines to NDIS, by calling NdisFRegisterFilterDriver, before performing all the necessary initialization. Because drivers that call NdisFRegisterFilterDriver must be prepared for an immediate call to any of their FilterXxx functions. The BSOD is triggered because the FilterAttach routine, OvsExtAttach, tries to acquire the control lock, when the lock is not yet initialized. This happens because the FilterAttach is called before the driver finishes initialization, in OvsInit(). The solution is to perform all necessary initialization before registering OVS FilterXxx routines. If device object creation fails, all allocated resources during init phase are released by calling OvsCleanup and NdisFDeregisterFilterDriver functions. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/67 Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Move Build*Msg() to Netlink.cNithin Raju2014-12-051-14/+0
| | | | | | | | | Moving the functions that build netlink messages to Netlink.c from Vport.c Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: nuke non-netlink based interfaceNithin Raju2014-11-201-6/+0
| | | | | | Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: pid-instance hash table data structure.Ankur Sharma2014-10-231-0/+2
| | | | | | | | | 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: Packet subscribe handlerEitan Eliahu2014-10-171-1/+5
| | | | | | | | | | | | | This change includes the following: [1] Handler for subscribe/unsubscribe to a packet queue associated with a socket pid. [2] Allocation of per socket packet queue on a packet subscription. [3] Removal of static allocated queues. [4] Freeing the packet queue (on user mode process termination). Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Add packet miss read Netlink command.Eitan Eliahu2014-10-161-0/+1
| | | | | | | | | | | The change include the Packet Read handler. The current implementation reads once packet at a time. This should be updated once user mode code is in place. Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Co-authored-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Some fixes in vport get codeNithin Raju2014-10-061-0/+9
| | | | | | | | | | | In this patch, we make some fixes in the vport get code as well as elevating some utility functions from static to non-static. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@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: Flow Dump handlerAnkur Sharma2014-10-061-2/+12
| | | | | | | | | | In this patch we have added basic changes for handler registeration for FLOW_GET command. Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: move OVS_MESSAGE to Netlink.hAnkur Sharma2014-09-291-10/+0
| | | | | | | | | | | | | | | | | | | | Moved the structure OVS_MESSAGE to Netlink.h. This change is done for following reasons. a. Patch 2 in this series provides a generic API in Netlink.c for creating netlink message. That API needs OVS_MESSAGE. Including Datapath.h in Netlink.c/h gives compilation error. b. OVS_MESSAGE defines netlink messages hence moving it to Netlink.h looked fine to me. Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Tested-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Add file NetlinkError.h.Samuel Ghinet2014-09-261-1/+9
| | | | | | | | | | | | | | | Contains error codes for netlink transactional errors. These errors are passed to the "error" field (INT) of the NL_MSG_ERR struct. The userspace requires them to be negative values: the nl_msg_nlmsgerr userspace function transforms them from negative to positive values. These error codes correspond to the userspace error codes defined in: "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\errno.h" Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.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: add a context structure for user parametersNithin Raju2014-09-041-0/+38
| | | | | | | | | | | | | | | In this patch we add a context structure for collecting all the parameters passed from usersapce in one place. The idea is to reduce the number of parameters being passed to the netlink command handler functions. It can be argued that not all functions require all the arguments, but this approach keeps the code clean, IMO. Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Saurabh Shah <ssaurabh@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Data structures and functions for dump stateNithin Raju2014-09-041-10/+48
| | | | | | | | Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Saurabh Shah <ssaurabh@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Rename files.Samuel Ghinet2014-08-291-4/+4
| | | | | | | | | | | | 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>
* datapath-windows: Using windows kernel netlink parsing APIs.Ankur Sharma2014-08-221-2/+2
| | | | | | | | | | In this patch we incorporate the usage of netlink message and the parsing APIs that were added in previous commit. Signed-off-by: Ankur Sharma <ankursharma@vmware.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/18 Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: add infrastructure for supporting netlinkNithin Raju2014-08-191-0/+25
| | | | | | | | | | | | | | | | | | | | | In this change, we define netlink families and commands supported by the Windows datapath. Only the control family and one command is supported today to get the PID. We also implement the 3 ioctls: read, write and transact. This is bare minimum and can be used to implement the equivalent of a recv, send, and send-recv in userspace netlink. This interface is subject to change as iron out the details of the user-kernel interface for operations around packet receive, events, dump, etc. We also turn on OVS_USE_NL_INTERFACE to 1 in the ovsext project. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Saurabh Shah <ssaurabh@vmware.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/18 Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Add Datapath.[ch] and OVS_USE_NL_INTERFACE CPPNithin Raju2014-08-191-0/+57
In this change we create peer to OvsIoctl.[ch] that would interface with userspace using the netlink interface. The new files are called Datapath.[ch]. We are not deleting OvsIoctl.[ch] yet. Datapath.[ch] provides bare minimum functionality to register a pseudo device for communication with userspace. We also define a CPP called OVS_USE_NL_INTERFACE in the ovsext project. This defines if the old interface (pre-netlink based) or the new interface (netlink- based) should be enabled in the kernel. By default, the value is 0 since the Datapath.[ch] are minimal. In the next change, we'll turn it to 1. Since Datapath.[ch] containes code copied from OvsIoctl.[ch], acking the original author as well. Signed-off-by: Nithin Raju <nithin@vmware.com> Co-authored-by: Guolin Yang <gyang@vmware.com> Acked-by: Alin Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Saurabh Shah <ssaurabh@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>