summaryrefslogtreecommitdiff
path: root/datapath-windows/include/OvsDpInterfaceExt.h
Commit message (Collapse)AuthorAgeFilesLines
* datapath-windows: support meter action initial versionldejing2022-09-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implemented meter action, currently, meter only support drop method and only support one band. The overall implementation is, when a packet comes in, it will first lookup meter according to the meter id, then get the band->rates and delta time since last access the same meter from the meter struct. Add the multiply result(band->rates * delta_time) to bucket, finally bucket minus the packet size, if the result larger than zero, allow the packet go through, otherwise deny the packet go through. Test case: 1. Setting the size meter size 3M, then the bandwidth was limit around 3M; ovs-ofctl -O OpenFlow13 add-meter br-test meter=2,kbps,\ band=type=drop,rate=3000 ovs-ofctl add-flow br-test "table=0,priority=1,ip \ actions=meter:2,normal" -O OpenFlow13 2. Setting the meter size 8M, then the bandwidth was limit around 8M; ovs-ofctl -O OpenFlow13 add-meter br-test meter=2,\ kbps,band=type=drop,rate=8000 ovs-ofctl add-flow br-test "table=0,priority=1,ip\ actions=meter:2,normal" -O OpenFlow13 Signed-off-by: ldejing <ldejing@vmware.com> Signed-off-by: Alin-Gabriel Serdean <aserdean@ovn.org>
* datapath-windows: Add support to configure ct zone limitsAnand Kumar2018-09-201-0/+1
| | | | | | | | | | | | | | | | | This patch implements limiting conntrack entries per zone using dpctl commands. Example: ovs-appctl dpctl/ct-set-limits default=5 zone=1,limit=2 zone=1,limit=3 ovs-appctl dpct/ct-del-limits zone=4 ovs-appctl dpct/ct-get-limits zone=1,2,3 - Also update the netlink-socket.c to support netlink family 'OVS_WIN_NL_CTLIMIT_FAMILY_ID' for conntrack zone limit. 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>
* Windows: Add support for handling protocol (netlink family)Sairam Venugopal2016-07-131-2/+15
| | | | | | | | | | | | | | | 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: Add support for Conntrack IPCTNL_MSG_CT_DELETE cmd in ↵Sairam Venugopal2016-07-011-0/+7
| | | | | | | | | | | | | | 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: Make GET_PID a separate IOCTLSorin Vinturis2015-04-021-7/+11
| | | | | | | | | | | | | | 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: Increase the maximum size of port name.Nithin Raju2014-10-311-4/+1
| | | | | | | | | | | | | | | | | | | | In userspace, port name sizes are restricted to IFNAMSIZ which is defined to IF_NAME_SIZE in: C:\Program Files (x86)\Windows Kits\8.1\Include\shared\netioapi.h In the kernel, since IFNAMSIZ was not available, we previously defined a value of 16 for the kernel. This is restrictive for Openstack integration where we use UUID as the name. In this patch, we make the kernel code also use the same value as the userspace. Also updated is the OVS.psm1 powershell script which now allows friendly names to be upto 48 bytes. 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: Implement missed packet kernel-to-user mode notification.Eitan Eliahu2014-10-201-0/+1
| | | | | | | | | | An I/O request is queued in Kernel to be completed upon a packet mismatch. This mechanism is similar to the port state notification. Access to instance data should be under a lock (TBD) Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
* datapath-windows: Packet subscribe handlerEitan Eliahu2014-10-171-2/+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-1/+2
| | | | | | | | | | | 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>
* OvsDpInterfaceExt.h: add support for netlink family for netdevNithin Raju2014-10-061-1/+59
| | | | | | | | | | | | | | | | | | | | | In this patch, we define netlink family, attributes and commands for query the 'network device' information of VPORTs, such as MTU, Link status, etc. I considered adding the netdev command to the OVS_WIN_CONTROL_FAMILY itself, but the netdev attributes are not compatible with the existing attributes for the events. I also considered adding new attributes to the VPORT family, but we'll have to extend the standard datapath interface for that. In this patch, we fix the definition of 'OVS_WIN_CONTROL_ATTR_MAX' as well. 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: Implement event read handler.Eitan Eliahu2014-09-291-2/+11
| | | | | | | | | | | | | | | | | The Read event handler is executed when user mode issues a socket receive on an MC socket associated with the event queue. A new IOCTL READ command is used to differentiate between transaction based and packet miss sockets. An entry for the handler will be added once the Control family (logically should have been added to the Vport family) implementation checked in. User mode code for setting the socket type will follow Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Acked-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: fix OVS_VPORT_TYPESamuel Ghinet2014-09-261-0/+1
| | | | | | | | | | | | | | | | | The windows ovs kernel uses an OVS_VPORT_TYPE enum that is incompatible with the userspace counterpart (enum ovs_vport_type from openvswitch.h). We must use the same enum type for the netlink communication to work properly. This patch makes the fix: "typedef enum ovs_vport_type OVS_VPORT_TYPE" and changes the afferent kernel driver code: o) vport types synthetic and emulated turn to: netdev o) vport type internal turns to: internal o) vport type external truns to: netdev (plus, we hold a field in vport, "isExternal" Signed-off-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: use the Netlink set API and need new APIsNithin Raju2014-09-161-0/+2
| | | | | | | | | | | | | | | | | In this change: 1. we refactor the code that fills up information about the DP into a seprate function. 2. use the netlink set APIs to fill up the netlink attributes. 3. we define a OVS_DP_STATS to be a typedef of 'struct ovs_dp_stats' in keeping with the Windows kernel naming conventions. 4. In the absence of netlink set API, I had put in an ASSERT earlier that the output buffer should be limited to 512 bytes. This is not true anymore. The netlink set API checks for bounds of the buffer. Hence removed the ASSERT. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Netlink_socket.c Join/Unjoin an MC group for event subscriptionEitan Eliahu2014-09-121-1/+8
| | | | | | | | | | | | Use a specific out of band device control to subscribe/unsubscribe a socket to the driver event queue for notification. Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Acked-by: Saurabh Shah <ssaurabh@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* netlink-socket: Add support for async notification on Windows.Eitan Eliahu2014-09-091-0/+1
| | | | | | | | | | | | | | | We keep an outstanding, out of band, I/O request in the driver at all time. Once an event generated the driver queues the event message, completes the pending I/O and unblocks the calling thread through setting the event in the overlapped structure in the NL socket. The thread will read all all event messages synchronously through the call of nl_sock_recv() Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com> Acked-by: Saurabh Shah <ssaurabh@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Update netlink family IDsNithin Raju2014-08-271-5/+5
| | | | | | | | | | | | | | | I didn't realize earlier while defining OvsDpInterfaceExt.h that there are special values defined in netlink-protocol.h for nlmsg_type. For Eg. NLMSG_ERROR is defined to be 2. In this patch, we update the values of the family IDs to not clash with the special defines. I'm using NLMSG_MIN_TYPE as a reference. All this points to doing family ID lookup from the kernel rather than returning values from netlink-socket.c. We should move to that model after we get through the first round of netlink commands. Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: define mcgroup IDs for VPORT and other familiesNithin Raju2014-08-271-0/+4
| | | | | | | | | | | | | | | | | dpif-linux.c makes a nl_lookup_genl_mcgroup(OVS_VPORT_FAMILY) that is not implemented yet on Windows yet. Multicast group is used currently to subscribe to events related to VPORTs. Whether the exact same mechanism would be used is unclear yet. In the interim, we can implement code to support nl_lookup_genl_mcgroup(). and make progress with the other simpler commands. In this patch, we define a ID for the VPORT MC group and use it. The IDs for other families were also defined, but without usage, were seen as unclear. Hence we define only the VPORT group. Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: define a version number in DP extensionsNithin Raju2014-08-221-0/+3
| | | | | | | | We need a version number for the datapath interface extensions that we can leverage at some point. Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Add extentions to the standard datapath interfaceNithin Raju2014-08-191-0/+68
The datapath interface defined in odp-netlink.h needs some extensions that are platform dependent. Some examples are the name of the communication device on Windows and a set of commands that are specific to Windows. In this change we define a datapath-windows/include/OvsDpInterfaceExt.h to include any platform specific interface extensions. OvsDpInterfaceExt.h is in turn included in odp-netlink.h ONLY for _WIN32. This approach was chosen to avoid including OvsDpInterfaceExt.h directly although the latter approach is as good as the former. Also, we define three ioctls in OvsDpInterfaceExt.h: read: provides an output buffer (mimics a recv) write: provides an input buffer (mimics a send) transact: provides an input and optionally an output buffer. (mimics a send followed by recv) Signed-off-by: Nithin Raju <nithin@vmware.com> Co-Authored-by: Ben Pfaff <blp@nicira.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>