aboutsummaryrefslogtreecommitdiff
path: root/datapath
AgeCommit message (Collapse)Author
2011-11-22datapath: Scope global symbols with ovs_ prefix.Jesse Gross
OVS has quite a few global symbols that should be scoped with a prefix to prevent collisions with other modules in the kernel. Suggested-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-21datapath: Remove unused variable in dp_notify.c.Jesse Gross
Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-21datapath: Always notify in initial namespace for port deletions.Jesse Gross
We currently notify for port deletions in the namespace of the device that was deleted. In general this should be initial namespace because that's the only place where we look but it's possible that the device was moved after being attached. However, it's not semantically correct because we really care about the namespace of the userspace process, not that of the device. This switches to genlmsg_multicast() which always uses the initial namespace and seems more appropriate anyways. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-21datapath: Directly use methods for protecting RCU/RTNL data.Jesse Gross
We currently have a wrapper to protect the datapath ports array. However, this can lead to confusion over exactly what lock is protecting the access (either RTNL or RCU). This removes the wrapper in favor of directly accessing the data, which also has the benefit of being less permissive about what lock we allow so it can be restricted to the one that we expect. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-21datapath: Add genl_dereference() and use it.Jesse Gross
We currently use a specialized version of what amounts to genl_dereference() to protect the flow table. This prepares to propose genl_dereference() upstream and uses it instead of our version. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-21datapath: Use u64_stats_sync for datapath and vport stats.Jesse Gross
We currently use a seqcount to prevent reading partial 64-bit stats on 32-bit CPUs. u64_stats_sync uses the same logic but elides it on 64-bit and uniprocessor machines. This improves performance (primarily on non-x86 architectures) at the cost of not guaranteeing that packet and byte counts were necessarily read together. Suggested-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-18datapath: Better handle vlan packets sent to userspace.Jesse Gross
We no longer clone packets that are sent via the userspace action because placing them in Netlink attributes makes a copy so we generally don't touch the original. The one exception to this is accelerated vlan tags, which are currently inserted into the original packet as long as it isn't cloned. Although the clone check prevents us from causing problems for past packets it has issues for future processing: * It turns accelerated tags into non-accelerated tags. This isn't inherently a problem but some cards may not properly support offloads with in-band tags. * It doesn't update CHECKSUM_COMPLETE if there is one. * If the operation fails, it will free the packet resulting in a later use-after-free. This patch fixes the above issues with a conservative approach. It's possible to do it more efficiently but it probably doesn't matter in most cases. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-18datapath: Fix unaligned access when storing stats.Jesse Gross
Both datapath and vport stats contain 64-bit members in a struct but we write them directly in Netlink attributes which only guarantee 32-bit alignment. This causes problems on RISC architectures that care about alignment so this computes the stats on the stack and then memcpy's them. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-18datapath: Fix pop_vlan().Pravin B Shelar
Following patch fixes bug in pop_vlan code by updating ethernet header len. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-17datapath: Update startup banner.Jesse Gross
The (to be) upstream version prints out "Open vSwitch switching datapath" on module load. This updates the OVS tree to keep them in sync. Signed-off-by: Jesse Gross <jesse@nicira.com>
2011-11-17datapath: Fix whitespace error.Jesse Gross
Signed-off-by: Jesse Gross <jesse@nicira.com>
2011-11-16datapath: Dont export get_dp().Pravin B Shelar
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@jessegross.com>
2011-11-16datapath: Fix flow table sparse RCU annotations.Jesse Gross
Some overzealous marking of pointers as __rcu caused sparse to flag errors. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-16datapath: Reformat copyright messages.Jesse Gross
Many of our kernel copyright messages make reference to code being copied from the Linux kernel, which is a bit odd for code in the kernel. This changes them to use the standard GNU GPL boilerplate instead. It does not change the actual license, which continues to be GPLv2. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-15datapath: Properly validate length of OVS_KEY_ATTR_ENCAP attributes.Ben Pfaff
Without this, every VLAN packet goes to userspace because VLAN flows cannot be set up. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-14datapath: Don't drop packets with partial vlan tags.Ben Pfaff
In the future it is likely that our vlan support will expand to include multiply tagged packets. When this happens, we would ideally like for it to be consistent with our current tagging. Currently, if we receive a packet with a partial VLAN tag we will automatically drop it in the kernel, which is unique among the protocols we support. The only other reason to drop a packet is a memory allocation error. For a doubly tagged packet, we will parse the first tag and indicate that another tag was present but do not drop if the second tag is incorrect as we do not parse it. This changes the behavior of the vlan parser to match other protocols and also deeper tags by indicating the presence of a broken tag with the 802.1Q EtherType but no vlan information. This shifts the policy decision to userspace on whether to drop broken tags and allows us to uniformly add new levels of tag parsing. Although additional levels of control are provided to userspace, this maintains the current behavior of dropping packets with a broken tag when using the NORMAL action because that is the correct behavior for an 802.1Q-aware switch. The userspace flow parser actually already had the new behavior so this corrects an inconsistency. Reported-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-14datapath: Describe policy for extending flow key, implement needed changes.Ben Pfaff
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>
2011-11-14datapath: Allow flow key Netlink attributes to appear in any order.Ben Pfaff
This is more conventional use of Netlink. For upstreaming, 'u64 attrs' can be changed to u32 and the uses of 1ULL can be changed to 1. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-12datapath: Rearrange ovs_key_lens.Ben Pfaff
This seems clearer to me. It should not cause any behavioral change. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-11datapath: Use correct ethernet addr len.Pravin B Shelar
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-10datapath: remove actions.hPravin B Shelar
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>
2011-11-10datapath: Don't use Nicira's OUI for generating mac-address.Pravin B Shelar
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-10datapath: Remove unnecessary definition of is_internal_vport()Pravin B Shelar
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-10datapath: Use skb_copy_and_csum_dev() to csum upcall packet.Pravin B Shelar
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-10datapath: Kernel flow metadata parsing should be less restrictiveAnsis Atteka
The function flow_metadata_from_nlattrs() is very restrictive about the ordering and type of metadata attributes that it receives. This patch will change flow_metadata_from_nlattrs() behavior by ignoring attributes that it does not understand and allowing them to be passed in arbitrary order. Issue #8167 Signed-off-by: Ansis Atteka <aatteka@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-09datapath: Fix compiler warning on older kernel.Pravin B Shelar
commit 6455100f38e9312346f4d58511595f695d813537 (datapath: Fix coding style issues) introduced this issue. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-09datapath: Fix comment formatting.Jesse Gross
A few of the recently added fields in struct sw_flow_key had comments that weren't properly aligned. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-09datapath: Rename ipv6_tos to ipv6_tclass.Justin Pettit
IPv6 uses the term "traffic class" for what IPv4 calls "type-of-service". This commit renames the the "ipv6_tos" field to "ipv6_tclass" in the "ovs-key_ipv6" struct to be more consistent with the IPv6 terminology. Suggested-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-09Support matching and modifying IP TTL.Justin Pettit
Add support matching the IPv4 TTL and IPv6 hop limit fields. This commit also adds support for modifying the IPv4 TTL. Modifying the IPv6 hop limit isn't currently supported, since we don't support modifying IPv6 headers. We will likely want to change the user-space interface, since basic matching and setting the TTL are not generally useful. We will probably want the ability to match on extraordinary events (such as TTL of 0 or 1) and a decrement action. Feature #8024 Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-09Support matching and modifying IP ECN bits.Justin Pettit
Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-09Don't overload IP TOS with the frag matching bits.Justin Pettit
This will be useful later when we add support for matching the ECN bits within the TOS field. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-09Support matching IPv6 flow label.Justin Pettit
Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-08datapath: Properly calculate checksum when updating TOS field.Justin Pettit
When updating the IP TOS field, the checksum was not properly calculated on little endian systems. This commit fixes the issue. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-08datapath: Update kernel support to 3.2.Pravin B Shelar
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7772
2011-11-08datapath: Fix vport tx_packets count.Pravin B Shelar
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-07tunneling: Separate out multicast port pools.Jesse Gross
Currently multicast and unicast tunnel ports share port pools but there's no overlap between the two in the lookup, which means that we can do a lookup that has no chance of ever finding a port. This separates them out. Suggested-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-07tunneling: Reduce priority of multicast tunnels.Jesse Gross
It's possible to have an incoming packet that matches both a unicast and multicast tunnel if the source address corresponds to the remote_ip of a unicast tunnel and the destination is multicast. Currently this will match the multicast tunnel but in reality the unicast tunnel should probably be considered more specific. This is actually a common situation in protocols that use a combination of multicast for flooding and unicast for responses. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-07datapath: Renumber non-upstreamable interfaces.Jesse Gross
The interfaces related to tunneling aren't finalized enough to be sent upstream but we also still want to retain them in the OVS repository. Since userspace should be compatible with both versions of the kernel, this renumbers the tunnel interfaces to high numbers so that we can continue to add new interfaces without conflict. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-07datapath: Slim down the vport interface.Jesse Gross
Many of the function in vport.c are simply pass throughs to their underlying vport implementation and, of these, many are used only for bridge compatibility code. This allows users of these functions to directly call through the ops structure, reducing boilerplate code and keeping more of the compatibility code together. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-07datapath: Remove vport from OVS_CB.Jesse Gross
Now that most fix function logic (like sFlow) has been moved to userspace, the vport member of OVS_CB is no longer used by anything, so drop it. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-07datapath: Fix coding style issues.Pravin B Shelar
Most of issues are reported by checkpatch.pl Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7771
2011-11-04datapath: Define net_device_ops->ndo_get_stats64() for internal_dev.Pravin B Shelar
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7772
2011-11-04datapath: Convert internal_dev to ndo_fix_features.Pravin B Shelar
From 2.6.39 kernel netdev features are set using set_features and fix_features APIs. Since internal-dev does not need any special checks on setting feature, there is no need to define set_features or fix_features. Only hw_features needs to be set to features that are supported by internal-dev. Following patch does same and drops discrete offload setting ops for newer kernel. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7772
2011-11-04datapath: Don't set flags on internal vports.Jesse Gross
We currently set netdev->flags to IFF_BROADCAST | IFF_MULTICAST but this is unnecessary because it's already done by ether_setup(). Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-03datapath: Fix indentation in pop_vlan().Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-02datapath: Drop useless WARN_ON_ONCE during flow conversion.Jesse Gross
This checks whether key_len is not zero but we set the key length at the beginning of the function, so I don't see this as a useful check. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-02datapath: Add IPv6 to list of parsed EtherTypes.Jesse Gross
The kernel can parse IPv6, so if it receives a flow with an IPv6 EtherType then it expects to get IPv6 information as well. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-01datapath: Convert kernel priority actions into match/set.Pravin B Shelar
Following patch adds skb-priority to flow key. So userspace will know what was priority when packet arrived and we can remove the pop/reset priority action. It's no longer necessary to have a special action for pop that is based on the kernel remembering original skb->priority. Userspace can just emit a set priority action with the original value. Since the priority field is a match field with just a normal set action, we can convert it into the new model for actions that are based on matches. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7715
2011-10-24datapath: Fully parenthesize ACTION macro.Ben Pfaff
This doesn't matter for any of the current users of ACTION, nor do I expect it to matter, but it seems like a good idea nonetheless. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-10-24datapath: Fix wrong indentation.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>