summaryrefslogtreecommitdiff
path: root/datapath/Modules.mk
Commit message (Collapse)AuthorAgeFilesLines
* datapath: Add meter infrastructureAndy Zhou2018-02-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Upstream commit: commit 96fbc13d7e770b542d2d1fcf700d0baadc6e8063 Author: Andy Zhou <azhou@ovn.org> Date: Fri Nov 10 12:09:42 2017 -0800 openvswitch: Add meter infrastructure OVS kernel datapath so far does not support Openflow meter action. This is the first stab at adding kernel datapath meter support. This implementation supports only drop band type. Signed-off-by: Andy Zhou <azhou@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net> Added a compat layer fixup for nla_parse. Added another compat fixup for ktime_get_ns. Cc: Andy Zhou <azhou@ovn.org> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* datapath: nsh: add GSO supportYi Yang2018-02-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | Upstream commit: commit c411ed854584a71b0e86ac3019b60e4789d88086 Author: Jiri Benc <jbenc@redhat.com> Date: Mon Aug 28 21:43:24 2017 +0200 nsh: add GSO support Add a new nsh/ directory. It currently holds only GSO functions but more will come: in particular, code shared by openvswitch and tc to manipulate NSH headers. For now, assume there's no hardware support for NSH segmentation. We can always introduce netdev->nsh_features later. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Yi Yang <yi.y.yang@intel.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Greg Rose <gvrose8192@gmail.com>
* doc: Populate 'topics' sectionStephen Finucane2016-12-121-3/+0
| | | | | | | | | | | There are many docs that don't need to kept at the top level, along with many more hidden in random folders. Move them all. This also allows us to add the '-W' flag to Sphinx, ensuring unindexed docs result in build failures. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Ben Pfaff <blp@ovn.org>
* doc: Convert datapath/README to rSTStephen Finucane2016-11-031-1/+1
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
* datapath: Fix build failure related to missing vlan.hPravin B Shelar2016-03-141-1/+0
| | | | | | | | | | | | ---8<--- make[1]: Entering directory `/home/travis/build/openvswitch/ovs/datapath' make[1]: *** No rule to make target `vlan.h', needed by `distdir'. Stop. make[1]: Leaving directory `/home/travis/build/openvswitch/ovs/datapath' make: *** [distdir] Error 1 cat: */_build/tests/testsuite.log: No such file or directory Signed-off-by: Pravin B Shelar <pshelar@ovn.org> Acked-by: Jesse Gross <jesse@kernel.org>
* datapath: Add conntrack actionJoe Stringer2015-12-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expose the kernel connection tracker via OVS. Userspace components can make use of the CT action to populate the connection state (ct_state) field for a flow. This state can be subsequently matched. Exposed connection states are OVS_CS_F_*: - NEW (0x01) - Beginning of a new connection. - ESTABLISHED (0x02) - Part of an existing connection. - RELATED (0x04) - Related to an established connection. - INVALID (0x20) - Could not track the connection for this packet. - REPLY_DIR (0x40) - This packet is in the reply direction for the flow. - TRACKED (0x80) - This packet has been sent through conntrack. When the CT action is executed by itself, it will send the packet through the connection tracker and populate the ct_state field with one or more of the connection state flags above. The CT action will always set the TRACKED bit. When the COMMIT flag is passed to the conntrack action, this specifies that information about the connection should be stored. This allows subsequent packets for the same (or related) connections to be correlated with this connection. Sending subsequent packets for the connection through conntrack allows the connection tracker to consider the packets as ESTABLISHED, RELATED, and/or REPLY_DIR. The CT action may optionally take a zone to track the flow within. This allows connections with the same 5-tuple to be kept logically separate from connections in other zones. If the zone is specified, then the "ct_zone" match field will be subsequently populated with the zone id. IP fragments are handled by transparently assembling them as part of the CT action. The maximum received unit (MRU) size is tracked so that refragmentation can occur during output. IP frag handling contributed by Andy Zhou. Based on original design by Justin Pettit. Upstream: 7f8a436 "openvswitch: Add conntrack action" Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Justin Pettit <jpettit@nicira.com> Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* datapath: Add support for lwtunnelPravin B Shelar2015-12-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Following patch adds support for lwtunnel to OVS datapath. With this change OVS datapath detect lwtunnel support and make use of new APIs if available. On older kernel where the support is not there the backported tunnel modules are used. These backported tunnel devices acts as lwtunnel devices. I tried to keep backported module same as upstream for easier bug-fix backport. Since STT and LISP are not upstream OVS always needs to use respective modules from tunnel compat layer. To make it work on kernel 4.3 I have converted STT and LISP modules to lwtunnel API model. lwtunnel make use of skb-dst to pass tunnel information to the tunnel module. On older kernel this is not possible. So the in case of old kernel metadata ref is stored in OVS_CB and direct call to tunnel transmit function is made by respective tunnel vport modules. Similarly on receive side tunnel recv directly call netdev-vport-receive to pass the skb to OVS. Major backported components include: Geneve, GRE, VXLAN, ip_tunnel, udp-tunnels GRO. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Joe Stringer <joe@ovn.org> Acked-by: Jesse Gross <jesse@kernel.org>
* datapath: Add Stateless TCP Tunneling protocol.Pravin B Shelar2015-04-291-0/+2
| | | | | | | | | | | | | | | | | The Stateless TCP Tunnel (STT) protocol encapsulates traffic in IPv4/TCP packets. STT uses TCP segmentation offload available in most of NIC. On packet xmit STT driver appends STT header along with TCP header to the packet. For GSO packet GSO parameters are set according to tunnel configuration and packet is handed over to networking stack. This allows use of segmentation offload available in NICs The protocol is documented at http://www.ietf.org/archive/id/draft-davie-stt-06.txt Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* dkms.conf.in: Install all kernel modules.Alex Wang2015-04-181-0/+2
| | | | | | | | | With the latest change of separating vports into their own modules, we need to update the dkms.conf.in and make dkms install all vport modules. So, this commit modifies the debian/rules to read all kernel module names and sets the dkms.conf correctly. Signed-off-by: Alex Wang <alexw@nicira.com>
* datapath: Turn vports with dependencies into separate modulesThomas Graf2015-04-041-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit: The internal and netdev vport remain part of openvswitch.ko. Encap vports including vxlan, gre, and geneve can be built as separate modules and are loaded on demand. Modules can be unloaded after use. Datapath ports keep a reference to the vport module during their lifetime. Allows to remove the error prone maintenance of the global list vport_ops_list. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net> Also folds in the follow-up commits 9ba559d9ca3 to turned the non-GPL symbol exports to GPL exports, and fa2d8ff4e35 which fixes a module reference release bug. Exports various backwards compat functions linked into the main openvswitch module as GPL symbols to ensure vport modules can use them. Some fiddling with the Makefile was needed to work around the fact that Makefile variables can't contain '-' characters needed to define 'vport-xxx' module sources. Also, Kbuild complains heavily if a $(module)-y = $(module).o is defined which is actually backed with a .c file of the same name. Therefore, a new $(build_multi_modules) variable is defined which lists all module which consist of more than one source file. Upstream: 62b9c8d0372 ("ovs: Turn vports with dependencies into separate modules") Upstream: 9ba559d9ca3 ("openvswitch: Export symbols as GPL symbols.") Upstream: fa2d8ff4e35 ("openvswitch: Return vport module ref before destruction") Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* datapath: Support VXLAN Group Policy extensionThomas Graf2015-02-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit: openvswitch: Support VXLAN Group Policy extension Introduces support for the group policy extension to the VXLAN virtual port. The extension is disabled by default and only enabled if the user has provided the respective configuration. ovs-vsctl add-port br0 vxlan0 -- \ set Interface vxlan0 type=vxlan options:exts=gbp The configuration interface to enable the extension is based on a new attribute OVS_VXLAN_EXT_GBP nested inside OVS_TUNNEL_ATTR_EXTENSION which can carry additional extensions as needed in the future. The group policy metadata is stored as binary blob (struct ovs_vxlan_opts) internally just like Geneve options but transported as nested Netlink attributes to user space. Renames the existing TUNNEL_OPTIONS_PRESENT to TUNNEL_GENEVE_OPT with the binary value kept intact, a new flag TUNNEL_VXLAN_OPT is introduced. The attributes OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS and existing OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS are implemented mutually exclusive. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net> Upstream: 1dd144 ("openvswitch: Support VXLAN Group Policy extension") Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* datapath: Fix few mpls issues.Pravin B Shelar2014-11-091-1/+0
| | | | | | | Found during MPLS upstreaming. Also sync-up MPLS header files with upstream code. Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
* doc: Convert docs to Markdown languageThomas Graf2014-10-281-1/+1
| | | | | | | | | | | Converts the majority of docs over to use the Markdown language for pretty printing on GitHub. It's a rough first convertion without exploiting the full potential of Markdown at this point. Section titles and indentation are fixed as needed. Minimal docs interlinking is added. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* datapath: Add basic MPLS support to kernelSimon Horman2014-06-241-0/+1
| | | | | | | | | | | | | | Allow datapath to recognize and extract MPLS labels into flow keys and execute actions which push, pop, and set labels on packets. Based heavily on work by Leo Alterman, Ravi K, Isaku Yamahata and Joe Stringer. Cc: Ravi K <rkerur@gmail.com> Cc: Leo Alterman <lalterman@nicira.com> Cc: Isaku Yamahata <yamahata@valinux.co.jp> Cc: Joe Stringer <joe@wand.net.nz> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Jesse Gross <jesse@nicira.com>
* datapath: Add support for Geneve tunneling.Jesse Gross2014-06-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | This adds support for Geneve - Generic Network Virtualization Encapsulation. The protocol is documented at http://tools.ietf.org/html/draft-gross-geneve-00 The kernel implementation is completely agnostic to the options that are in use and can handle newly defined options without further work. It does this by simply matching on a byte array of options and allowing userspace to setup flows on this array. Userspace currently implements only support for basic version of Geneve. It can work with the base header (including the VNI) and is capable of parsing options but does not currently support any particular option definitions. Over time, the intention is to allow options to be matched through OpenFlow without requiring explicit support in OVS userspace. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Thomas Graf <tgraf@suug.ch> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* datapath: Restructure datapath.c and flow.cPravin B Shelar2013-10-011-0/+4
| | | | | | | | | | | | | | | | Over the time datapath.c and flow.c has became pretty large files. Following patch restructures functionality of component into three different components: flow.c: contains flow extract. flow_netlink.c: netlink flow api. flow_table.c: flow table api. Diffstat is showing wrong count. This patch mostly restructures code without changing logic. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Remove vlan compat supportPravin B Shelar2013-09-061-1/+0
| | | | | Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Remove checksum compat supportPravin B Shelar2013-09-061-2/+0
| | | | | Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Move generic tunnel functions to lisp module.Pravin B Shelar2013-08-131-2/+0
| | | | | | | | | | Generic tunnel rcv and send function are only used by lisp tunneling module, so It make sense to move them to lisp module. CC: Lori Jakab <lojakab@cisco.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Lorand Jakab <lojakab@cisco.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Simplify datapath locking.Pravin B Shelar2013-04-121-2/+0
| | | | | | | | | | | | Currently OVS uses combination of genl and rtnl lock to protect datapath state. This was done due to networking stack locking. But this has complicated locking and there are few lock ordering issues with new tunneling protocols. Following patch simplifies locking by introducing new ovs mutex and now this lock is used to protect entire ovs state. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* Add support for LISP tunnelingLorand Jakab2013-02-251-0/+1
| | | | | | | | | | | | | | | | LISP is an experimental layer 3 tunneling protocol, described in RFC 6830. This patch adds support for LISP tunneling. Since LISP encapsulated packets do not carry an Ethernet header, it is removed before encapsulation, and added with hardcoded source and destination MAC addresses after decapsulation. The harcoded MAC chosen for this purpose is the locally administered address 02:00:00:00:00:00. Flow actions can be used to rewrite this MAC for correct reception. As such, this patch is intended to be used for static network configurations, or with a LISP capable controller. Signed-off-by: Lorand Jakab <lojakab@cisco.com> Signed-off-by: Kyle Mestery <kmestery@cisco.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
* datapath: Remove CAPWAP tunneling support.Pravin B Shelar2013-02-191-4/+1
| | | | | | | | | | | | The CAPWAP implementation is just the encapsulation format and therefore really not the full protocol. While there were some uses of it (primarily hardware support and UDP transport). But these are most likely better provided by VXLAN. Following patch removes CAPWAP tunneling support. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Remove kernel patch ports.Jesse Gross2013-01-281-1/+0
| | | | | | | | Now that userspace implements patch ports completely internally, it's possible to remove the kernel implementation of them. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Kyle Mestery <kmestery@cisco.com>
* openvswitch: Remove Linux bridge compatibility.Pravin B Shelar2012-12-271-8/+0
| | | | | | | | | Currently brcompat does not work on master due to recent datapath changes. We have decided to remove it as it is not used very widely. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Add support for VXLAN tunnels to Open vSwitchKyle Mestery2012-12-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for VXLAN tunnels to Open vSwitch. Add support for setting the destination UDP port on a per-port basis. This is done by adding a "dst_port" parameter to the port configuration. This is only applicable currently to VXLAN tunnels. Please note this currently does not implement any sort of multicast learning. With this patch, VXLAN tunnels must be configured similar to GRE tunnels (e.g. point to point). A subsequent patch will implement a VXLAN control plane in userspace to handle multicast learning. This patch set is based on one posted by Ben Pfaff on Oct. 12, 2011 to the ovs-dev mailing list: http://openvswitch.org/pipermail/dev/2011-October/012051.html The patch has been maintained, updated, and freshened by me and a version of it is available at the following github repository: https://github.com/mestery/ovs-vxlan/tree/vxlan I've tested this patch with multiple VXLAN tunnels between hosts using different UDP port numbers. Performance is on par (though slightly faster) than comparable GRE tunnels. See the following IETF draft for additional information about VXLAN: http://tools.ietf.org/html/draft-mahalingam-dutt-dcops-vxlan-02 Signed-off-by: Kyle Mestery <kmestery@cisco.com> [jesse: simplify error path in vxlan_tunnel_setup, don't print default VXLAN port, and remove dead code] Signed-off-by: Jesse Gross <jesse@nicira.com>
* configure: add configure option to disable building brcompatChris Wright2012-03-131-1/+1
| | | | | | | | | | | | | | | | | | This adds ability to do: ./configure --disable-brcompat to disable building userspace and kernel module associated with providing linux bridge compatibility. Sources should still be distributed w/ make dist. While there, update comment referring to long removed veth driver which is now relevant for brcompat module. Cc: Jesse Gross <jesse@nicira.com> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Acked-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
* datapath: Add support for namespace.Pravin B Shelar2012-01-301-0/+1
| | | | | | | | | | | | Following patch adds support for Linux net-namespace. Now we can have independent OVS instance in each net-ns. Namespace support requires 2.6.32 or newer kernel as per-net-ns genl-sock is not available in earlier kernel. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7821
* datapath: Add genl_exec().Pravin B Shelar2012-01-041-0/+2
| | | | | | | | | genl_lock is not exported from older kernel. Following patch add genl_exec() which can run any function (passed as arg) with genl_lock held. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Describe policy for extending flow key, implement needed changes.Ben Pfaff2011-11-141-0/+1
| | | | | | | | | | | | | | | | | | | | When the datapath was converted to use Netlink attributes for describing flow keys, I had a vague idea of how it could be smoothly extensible, but I didn't actually implement extensibility or carefully think it through. This commit adds a document that describes how flow keys can be extended in a compatible fashion and adapts the existing interface to match what it says. This commit doesn't actually implement extensibility. I already have a separate patch series out for that. This patch series borrows from that one heavily, but the extensibility series will need to be reworked somewhat once this one is in. This commit is only lightly tested because I don't have a good test setup for VLANs. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: remove actions.hPravin B Shelar2011-11-101-1/+0
| | | | | | | | | There are only two symbols in actions.h. Compatibility function is moved to compat.h and execute_actions() declaration is moved to datapath.h Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Remove RT kernel support.Pravin B Shelar2011-10-061-2/+0
| | | | | | | | | | | | | Following patch removes RT kernel support. This allows us to cleanup the loop detection. Along with this BH is now disabled while running execute_actions() for packet from user-space. As a result we can simplify the stats code as entire send and receive path runs in BH context on all supported platforms. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7621
* datapath: add key support to CAPWAP tunnelValient Gough2011-09-091-0/+4
| | | | | | | | | | | | | Add tunnel key support to CAPWAP vport. Uses the optional WSI field in a CAPWAP header to store a 64bit key. It can also be used without keys, in which case it is backward compatible with the old code. Documentation about the WSI field format is in CAPWAP.txt. Signed-off-by: Valient Gough <vgough@pobox.com> [horms@verge.net.au: Various minor fixes (v4.1)] Signed-off-by: Simon Horman <horms@verge.net.au> [jesse: Additional parsing fixes] Signed-off-by: Jesse Gross <jesse@nicira.com>
* datapath: Improve kernel hash tablePravin Shelar2011-09-091-2/+0
| | | | | | | | | | | | Currently OVS uses its own hashing implmentation for hash tables which has some problems, e.g. error case on deletion code. Following patch replaces that with hlist based hash table which is consistent with other kernel hash tables. As Jesse suggested, flex-array is used for allocating hash buckets, So that we can have large hash-table without large contiguous kernel memory. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Use compat directory only for backported code.Jesse Gross2011-03-141-0/+1
| | | | | | | | | | | | | | | | Most necessary compatibility code is simply backported versions of kernel functions from newer kernels. These belong in the compat directory, where they can be transparently picked up when necessary. However, in some situations there is code that is different depending on the kernel version but is always needed in some form. Here it is desirable to segregate the code but it does not really belong in the compat directory because it does not exist in upstream kernels. This moves those functions to a compat file, which makes the meaning clear and prevents problems when Open vSwitch is integrated into other projects. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* datapath: Add vlan acceleration field for older kernels.Jesse Gross2011-02-071-0/+2
| | | | | | | | | | | | Kernels prior to 2.6.27 did not have a vlan_tci field in struct sk_buff for vlan acceleration. It's very convenient to use this field for manipulating vlan tags, so we would like to use it as the primary mechanism. To enable this, this commit adds similar infrastructure to the OVS_CB on the kernels that need it and a set of functions to use the correct location. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* datapath: Convert ODP_EXECUTE to use Netlink framing.Ben Pfaff2011-01-271-1/+0
| | | | | Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Get rid of compat.h, compat26.h in favor of modern approach.Ben Pfaff2011-01-131-1/+0
| | | | | | | | | I had completely forgotten that we had a top-level compat.h and compat26.h. It's better to distribute their contents to individual compat headers, so this commit does so and deletes them. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* datapath: Consolidate checksum compatibility code.Jesse Gross2010-12-031-0/+2
| | | | | | | | | | | | | Checksum offloading has changed quite a bit across different kernel and Xen versions. Since it is part of the skb data structure it is unfortunately difficult to separate out into compatibility code. This consolidates all of the checksum code in one place which makes it easier read and remove as we prepare for upstreaming. On newer kernels it also puts everything in inline functions, eliminating the need to run through the compat code or make extra function calls. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* datapath: Add loop detection for RT kernels.Jesse Gross2010-10-251-0/+2
| | | | | | | | | | | | | | Our normal loop detection requires disabling preemption while packet processing takes place. On RT kernels this isn't acceptable and interacts badly with spinlocks, so we can't use it. This takes advantage of some extra space that is added to struct task_struct on RT kernels (and the knowledge that we will always have a valid task_struct) to store the loop counter for a given thread. Since we can't make these assumptions on non-RT kernels, we continue to use the previous method of loop detection there. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* datapath: Add support for CAPWAP UDP transport.Jesse Gross2010-08-241-0/+1
| | | | | | | | | | | | | Add support for the transport portion of the CAPWAP protocol as an alternative to GRE for L2 over L3 tunneling. This is not full support for the CAPWAP protocol. CAPWAP covers management of wireless access points and describes a control protocol for setting those devices up. It also describes a data plane protocol that allows packets to be tunneled to a controller for inspection. This data plane protocol is the only component covered by this commit. Signed-off-by: Jesse Gross <jesse@nicira.com>
* datapath: Abstract tunneling implementation from GRE.Jesse Gross2010-08-241-0/+2
| | | | | | | | | Much of the code in the GRE implementation is not specific to the GRE protocol but is actually common to all types of tunnels. In order to support future types of tunnels, move this code into a common library. Signed-off-by: Jesse Gross <jesse@nicira.com>
* datapath: Add 'patch' vport.Jesse Gross2010-05-181-1/+2
| | | | | Adds a new 'patch' vport that acts like a virtual patch cable to connect together two datapaths.
* vport: Extract common functions for virtual devices.Jesse Gross2010-05-181-0/+2
| | | | | | | | Pull some generic implementations of vport functions out of the GRE vport so they can be used by others. Also move the code to set the MTUs of internal devices to the minimum of attached devices to the generic vport_set_mtu layer.
* datapath: Add 32-bit compatibility ioctls.Ben Pfaff2010-05-131-0/+1
| | | | | | | | | | | | When a 32-bit userspace program runs on a 64-bit kernel, data structures that contain members whose sizes or alignments change from 32- to 64-bit must be translated when they are passed to ioctls. This commit adds such support for openvswitch_mod. We should really reconsider some parts of the Open vSwitch ioctl interface to avoid needing as much translation as we do. Lightly tested with 32-bit userspace on sparc64.
* tunneling: Add datapath GRE support.Jesse Gross2010-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add a new vport type that implements GRE support inside of the datapath instead of relying on Linux devices. This provides greater scalability, performance, and control. The new GRE implementation supports nearly all features of the Linux implementation. It does not currently support multicast, NBMA tunnels, or non-Ethernet devices. This implementation of GRE has several important benefits over the existing Linux implementation. The first is simply that is not a Linux device. Linux devices are fairly heavy weight both in terms of memory consumption and interactions with the rest of the system (notifications, processes polling, etc.). There are many pieces of code that make assumptions about the maximum reasonable number of ports. Simply maintaining the state of several thousand devices is enough to full occupy the CPU. A tighter coupling between the GRE implementation and datapath also allows more flexibility. The key can be set and retrieved from the flow table, which allows even greater scalability. There will probably be additional use cases in the future.
* datapath: Genericize hash table.Jesse Gross2010-04-191-0/+1
| | | | | | | Currently the flow hash table assumes that it is storing flows. However, we will need additional types of hash tables in the future so remove assumptions about flows and convert the datapath to use the new table.
* datapath: Add generic virtual port layer.Jesse Gross2010-04-191-4/+8
| | | | | | | | | | | | | Currently the datapath directly accesses devices through their Linux functions. Obviously this doesn't work for virtual devices that are not backed by an actual Linux device. This creates a new virtual port layer which handles all interaction with devices. The existing support for Linux devices was then implemented on top of this layer as two device types. It splits out and renames dp_dev to internal_dev. There were several places where datapath devices had to handled in a special manner and this cleans that up by putting all the special casing in a single location.
* datapath: Rename brc_sysfs_* to dp_sysfs_*.Ben Pfaff2009-08-061-3/+3
| | | | | These files and names are now part of the datapath, not brcompat, so name them appropriately so as not to confuse anyone.
* datapath: Move sysfs support from brcompat_mod into openvswitch_mod.Ben Pfaff2009-08-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the past problems have arisen due to the different ways that datapaths are created and destroyed in the three different cases: 1. sysfs supported, brcompat_mod loaded. 2. sysfs supported, brcompat_mod not loaded. 3. sysfs not supported. The brcompat_mod loaded versus not loaded distinction is the stickiest because we have to do all the calls into brcompat_mod through hook functions, which in turn causes pressure to keep the number of hook functions small and well-defined, which makes it really difficult to put the hook call points at exactly the right place. Witness, for example, this piece of code in datapath.c: int dp_del_port(struct net_bridge_port *p) { ASSERT_RTNL(); #ifdef SUPPORT_SYSFS if (p->port_no != ODPP_LOCAL && dp_del_if_hook) sysfs_remove_link(&p->dp->ifobj, p->dev->name); #endif The code inside the #ifdef is logically part of the brcompat_mod sysfs support, but the author of this code (quite reasonably) didn't want to add a hook function call there. After all, what would you call the hook function? There's no obvious name from the dp_del_port() caller's perspective. All this argues that sysfs support should be in openvswitch_mod itself, since it has to be tightly integrated, not bolted on. So this commit moves it there. Now, this is not to say that openvswitch_mod should actually be implementing bridge-compatible sysfs. In the future, it probably should not be; rather, it should implement something appropriate for Open vSwitch datapaths instead. But right now we have bridge-compatible sysfs, and so that's what this commit moves.
* Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.v0.90.0Ben Pfaff2009-07-081-0/+32