aboutsummaryrefslogtreecommitdiff
path: root/include/openvswitch
AgeCommit message (Collapse)Author
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-10-12datapath-protocol: Rename to <linux/openvswitch.h>.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7559.
2011-10-12datapath-protocol: Use Linux kernel types directly.Ben Pfaff
We want datapath-protocol.h to be acceptable as a Linux kernel header, so it must use Linux kernel types and must not have references to Open vSwitch symbols or header files. This commit primarily makes that change to datapath-protocol.h. At the same time, at least for now we also want datapath-protocol.h to be usable on non-Linux platforms, so we need some kind of compatiblity. Thus, this commit also introduces a <linux/types.h> header file that defines the necessary Linux kernel types on non-Linux platforms. In turn, this requires openvswitch/types.h to use the Linux types directly for ovs_be<N>; otherwise, sparse complains because now __be<N> and ovs_be<N> are incompatible from its perspective, so this commit makes that change too. I don't have a non-Linux kernel platform readily available, so I only tested the non-Linux part of the linux/types.h substitute by forcing that case to be triggered with #if 0. It worked, except for errors in actual Linux kernel headers included explicitly from OVS source files, so I think it's likely to work in practice. Bug #7559. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-10-12datapath-protocol: Rename enums for consistency.Ben Pfaff
Most of the enum tags in this file are lowercased versions of the uppercase enum prefixes (or slightly less abbreviated versions, e.g. "dp" becomes "datapath"). This commit fixes up the others for consistency. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-10-12datapath-protocol: Remove socket header #include.Ben Pfaff
It's not needed. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7559.
2011-10-12datapath-protocol: Remove #include <linux/netlink.h>.Ben Pfaff
Bug #7559. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-10-12datapath: Move Netlink PID for userspace actions from flows to actions.Ben Pfaff
Commit b063d9f06 "datapath: Use unicast Netlink sockets for upcalls" that switched from multicast to unicast Netlink for sending upcalls added a Netlink PID to each kernel flow, used by OVS_ACTION_ATTR_USERSPACE actions within the flow as target. This commit drops this per-flow PID in favor of a per-action PID, because that is more flexible. It does not yet make use of this additional flexibility, so behavior should not change. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7559.
2011-10-05datapath: Strip down vport interface - ifIndex.Pravin B Shelar
Following patch removes ifIndex attribute of vport which is not used in userspace. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7114
2011-09-28sFlow: Genericize/simplify kernel sFlow implementationPravin Shelar
Following patch adds sampling action which takes probability and set of actions as arguments. When probability is hit, actions are executed for given packet. USERSPACE action's userdata (u64) is used to store struct user_action_cookie as cookie. CONTROLLER action is fixed accordingly. Now we can remove sFlow code from kernel and implement sFlow generically as SAMPLE action. sFlow is defined as SAMPLE Action with probability (sFlow sampling rate) and USERSPACE action as argument. USERSPACE action's data is used as cookie. sFlow uses this cookie to store output-port, number of output ports and vlan-id. sample-pool is calculated by using vport stats. Signed-off-by: Pravin Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-09-23datapath: Use unicast Netlink sockets for upcalls.Jesse Gross
Currently we publish several multicast groups for upcalls and let userspace sockets subscribe to them. The benefit of this is mostly that userspace is the one doing the subscription - the actual multicast capability is not currently used and probably wouldn't be even if we moved to a multiprocess model. Despite the convenience, multicast sockets have a number of disadvantages, primarily that we only have a limited number of them so there could be collisions. In addition, unicast sockets give additional flexibility to userspace by allowing every object to potentially have a different socket chosen by userspace for upcalls. Finally, any future optimizations for upcalls to reduce copying will likely not be compatible with multicast anyways so disallowing it potentially simplifies things. We also never unregistered the multicast groups registered for upcalls and leaked them on module unload. As a side effect, this solves that problem. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-09-19datapath-protocol: vport_stats types are unsigned.Jesse Gross
The 'u' in uint64_t apparently got clipped off of the tx_dropped member of struct vport_stats in between review and push, incorrectly making this a signed type. CC: Pravin Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Pravin Shelar <pshelar@nicira.com>
2011-09-16datapath: Hardcode vport multicast group ID on older kernels.Ethan Jackson
Older kernels do not advertise the multicast groups of families when requested by userspace. As a workaround, this patch hardcodes the multicast group ID of the ovs_vport family on these kernels. Userspace will be able to fall back to this hardcoded value if the standard mechanism is unavailable. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-09-15datapath: Always use generic stats for devices (vports)Pravin Shelar
Currently ovs is using device stats for Linux devices and count them itself in other situations. This leads to overlap with hardware stats, inconsistencies, etc. It's much better to just always count the packets flowing through the switch and let userspace do any merging that it wants. Following patch removes vport->get_stats() interface. vport-stat is changed to use new `struct ovs_vport_stat` rather than rtnl_link_stats64. Definitions of rtnl_link_stats64 is removed from OVS. dipf_port->stat is also removed as aggregate stats are only available at netdev layer. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-09-12datapath: Strip down vport interface : OVS_VPORT_ATTR_MTUPravin Shelar
There is no need to have vport attribute MTU (OVS_VPORT_ATTR_MTU) as linux net-dev-ioctl can be used to get/set MTU for linux device. Following patch removes OVS_VPORT_ATTR_MTU from datapath protocol. This patch also adds netdev_set_mtu interface. So that MTU adjustments can be done from OVS userspace. get_mtu() interface is also changed, now get_mtu() returns EOPNOTSUPP rather than returning 0 and setting *pmtu to INT_MAX in case there is no MTU attribute for given device. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-09-09datapath: VLAN actions should use push/pop semanticsPravin Shelar
Currently the kernel vlan actions mirror those used by OpenFlow 1.0. i.e. MODIFY and STRIP. More flexible approach is to have an action to push a tag and pop a tag off, so that it can handle multiple levels of vlan tags. Plus it aligns with newer version of OpenFlow. As this patch replaces MODIFY with PUSH semantic, action mapping done in userpace is fixed accordingly. GSO handling for multiple levels of vlan tags is also added as Jesse suggested before. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-09-08Strip down vport interface : iflinkPravin Shelar
Remove iflink from vport interface. iflink is not used anywhere in OVS. So there is not need to have iflink as vport attribute. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-08-19datapath: Use "OVS_*" as opposed to "ODP_*" for user<->kernel interactions.Justin Pettit
The prefix "ODP_*" is not overly descriptive in the context of the larger Linux tree. This commit changes the prefix to "OVS_*" for the userpace to kernel interactions. The userspace libraries still use "ODP_" in many of their interfaces since it is more descriptive in the OVS oeuvre. Feature #6904 Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-08-18datapath-protocol: Correct a description in odp_flow_attr structure.Justin Pettit
The description referenced "ODPAT_*", but it should be "ODP_ACTION_ATTR_". Signed-off-by: Justin Pettit <jpettit@nicira.com>
2011-08-03ovs-dpctl: Show number of flowsSimon Horman
Expose the number of flows present in a datapath to user-space and to users via ovs-dpctl show. e.g.: ovs-dpctl show br3 system@br3: lookups: frags:0, hit:0, missed:0, lost:0 flows: 0 ... Signed-off-by: Simon Horman <horms@verge.net.au> [Jesse: Add same logic to userspace datapath.] Signed-off-by: Jesse Gross <jesse@nicira.com>
2011-07-28Datapath action should not refer to controllerpravin shelar
ODP_ACTION_ATTR_CONTROLLER in the kernel actually sends packets to userspace, not the controller. To make it generic rename this action to ODP_ACTION_ATTR_USERSPACE. Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2011-06-09Remove NXAST_DROP_SPOOFED_ARP action.Justin Pettit
The NXAST_DROP_SPOOFED_ARP action has been deprecated in favor of defining flows using the NXM_NX_ARP_SHA flow match for a while. This commit removes it. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-05-16Remove unnecessary #include directives.Ben Pfaff
2011-04-29tunneling: Add df_default and df_inherit tunnel options.Andrew Evans
Split existing pmtud tunnel option's functionality into three. Existing pmtud option still exists, but now governs only whether datapath sends ICMP frag needed messages. New df_inherit option controls whether DF bit is copied from packet inner header to outer tunnel header. New df_default option controls whether DF bit is set if inner packet isn't IP or if df_inherit is disabled. Suggested-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Andrew Evans <aevans@nicira.com> Feature #5456.
2011-02-11Remove /proc/net compatibility support.Ben Pfaff
This feature was included only to allow Citrix QA to run some tests that interacted directly with the bridge. This feature hasn't been turned on for some time, so it should not be necessary any longer. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-02-05Add types and accessors for working with half-aligned 64-bit values.Ben Pfaff
Both OpenFlow and Netlink contain 64-bit fields that are only guaranteed to be aligned on 32-bit boundaries. This commit introduces types for representing these fields and functions for working with them. Followup commits will make the OpenFlow and Netlink code use these types and functions.
2011-02-04datapath-protocol: Drop useless/obsolete comments.Jesse Gross
Some of the comments related to compat code that no longer exists, types which are defined elsewhere, or are generally not very helpful. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-04datapath-protocol: Dropped unused __aligned_* types.Jesse Gross
These types are no longer used, are redundantly defined, and were cluttering our interface header. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-04datapath: Consider tunnels to have no MTU, fixing jumbo frame support.Ben Pfaff
Until now, tunnel vports have had a specific MTU, in the same way that ordinary network devices have an MTU, but treating them this way does not always make sense. For example, consider a datapath that has three ports: the local port, a GRE tunnel to another host, and a physical port. If the physical port is configured with a jumbo MTU, it should be possible to send jumbo packets across the tunnel: the tunnel can do fragmentation or the physical port traversed by the tunnel might have a jumbo MTU. However, until now, tunnels always had a 1500-byte MTU by default. It could be adjusted using ODP_VPORT_MTU_SET, but nothing actually did this. One alternative would be to make ovs-vswitchd able to set the vport's MTU. This commit, however, takes a different approach, of dropping the concept of MTU entirely for tunnel vports. This also solves the problem described above, without making any additional work for anyone. I tested that, without this change, I could not send 1600-byte "pings" between two machines whose NICs had 2000-byte MTUs that were connected to vswitches that were in turn connected over GRE tunnels with the default 1500-byte MTU. With this change, it worked OK, regardless of the MTU of the network traversed by the GRE tunnel. This patch also makes "patch" ports MTU-less. It might make sense to remove vport_set_mtu() and the associated callback now, since ordinary network devices are the only vports that support it now. Signed-off-by: Ben Pfaff <blp@nicira.com> Suggested-by: Jesse Gross <jesse@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #3728.
2011-02-02nicira-ext: Support matching IPv6 Neighbor Discovery messages.Justin Pettit
IPv6 uses Neighbor Discovery messages in a similar manner to how IPv4 uses ARP. This commit adds support for matching deeper into the payloads of Neighbor Solicitation (NS) and Neighbor Advertisement (NA) messages. Currently, the matching fields include: - NS and NA Target (nd_target) - NS Source Link Layer Address (nd_sll) - NA Target Link Layer Address (nd_tll) When defining IPv6 Neighbor Discovery rules, the Nicira Extensible Match (NXM) extension to OVS must be used. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-02nicira-ext: Support matching IPv6 traffic.Justin Pettit
Provides ability to match over IPv6 traffic in the same manner as IPv4. Currently, the matching fields include: - IPv6 source and destination addresses (ipv6_src and ipv6_dst) - Traffic Class (nw_tos) - Next Header (nw_proto) - ICMPv6 Type and Code (icmp_type and icmp_code) - TCP and UDP Ports over IPv6 (tp_src and tp_dst) When defining IPv6 rules, the Nicira Extensible Match (NXM) extension to OVS must be used. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-02nicira-ext: Support matching ARP source and target hardware addresses.Justin Pettit
OpenFlow 1.0 doesn't allow matching on the ARP source and target hardware address. This has caused us to introduce hacks such as the Drop Spoofed ARP action. Now that we have extensible match, we can match on more fields within ARP: - Source Hardware Address (arp_sha) - Target Hardware Address (arp_tha) Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-01-28datapath: s/ODPAT_/ODP_ACTION_ATTR_/ to fit new naming scheme.Ben Pfaff
Jesse suggested this naming scheme, so I'm adjusting existing names to fit it. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-28datapath: Change dp_idx to dp_ifindex, the ifindex of the local port.Ben Pfaff
I can't see any real value in maintaining a dp_idx separate from the ifindex of the local port. With the current implementation it also artificially limits the number of datapaths. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-28datapath: Convert ODP_FLOW_* commands to use AF_NETLINK socket layer.Ben Pfaff
This completes the transition to the Generic Netlink interface, and so this commit restores support for Linux 2.6.18 and later. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-28datapath: Convert ODP_VPORT_* to use AF_NETLINK socket layer.Ben Pfaff
This commit calls genl_lock() and thus doesn't support Linux before 2.6.35, which wasn't exported before that version. That problem will be fixed once the whole userspace interface transitions to Generic Netlink a few commits from now. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-28datapath: Convert ODP_DP_* commands to use AF_NETLINK socket layer.Ben Pfaff
This commit calls genl_lock() and thus doesn't support Linux before 2.6.35, which wasn't exported before that version. That problem will be fixed once the whole userspace interface transitions to Generic Netlink a few commits from now. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-28datapath: Convert upcalls and ODP_EXECUTE to use AF_NETLINK socket layer.Ben Pfaff
This commit calls genl_lock() and thus doesn't support Linux before 2.6.35, which wasn't exported before that version. That problem will be fixed once the whole userspace interface transitions to Generic Netlink a few commits from now. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27Eliminate ODPL_* from userspace-facing interface.Ben Pfaff
Reviewed by Justin Pettit.
2011-01-27datapath: Get rid of ODPP_NONE.Ben Pfaff
This definition wasn't actually useful for the kernel--the only place that it was used it didn't really have to be, so this commit removes it from datapath-protocol.h. It is still marginally useful in userspace, at least as a value that converts to and from OpenFlow port number OFPP_NONE, so move it to odp-util.c. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Convert ODP_EXECUTE to use Netlink framing.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Convert datapath operations to use Netlink framing.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Convert ODP_FLOW_* and ODP_EXECUTE to put dp_idx into message.Ben Pfaff
When the datapath moves to the Netlink protocol it won't have a minor number to use, so we have to put the dp_idx in the message. This also changes the kernel implementation of ODP_FLOW_FLUSH to do the datapath locking inside flush_flows() instead of inside openvswitch_ioctl() but doesn't change that command's userspace interface, which still passes a datapath number as the ioctl argument. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Eliminate 'flags' member from odp_flow.Ben Pfaff
Nothing was productively using the 'flags' member of odp_flow, so this commit removes it. ODPFF_ZERO_TCP_FLAGS isn't used at all (as of the previous commit). ODPFF_EOF has been replaced by a special case of the 'key_len' member. This will go away, too, once AF_NETLINK starts being used. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Change ODP_FLOW_GET to retrieve only a single flow at a time.Ben Pfaff
This brings the code closer to what the Netlink interface will need to implement. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Drop port information from odp_stats.Ben Pfaff
As with n_flows, n_ports was used regularly by userspace to determine how much memory to allocate when listing ports, but it is no longer needed for that. max_ports, on the other hand, is necessary but it is also a fixed value for the kernel datapath right now and if we expand it we can also come up with a way to report the expanded value. The remaining members of odp_stats are actually real statistics that I intend to keep. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Drop queue information from odp_stats.Ben Pfaff
This queue information will be available through the kernel socket layer once we move over to Netlink socket as transports, so we might as well get rid of the redundancy. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Drop flow information from odp_stats.Ben Pfaff
Userspace used to use the n_flows information here to decide how much memory needed to be allocated to list flows, but that isn't necessary any longer now that listing flows uses an iterator abstraction. The cur_capacity and max_capacity members are just curiosities and don't provide much information; if the implementation ever changes away from the current hash table implementation then they could become meaningless anyhow. But more than anything, these aren't really the kind of statistics that networking people usually care about. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Change userspace vport interface to use Netlink attributes.Ben Pfaff
One of the goals for Open vSwitch is to decouple kernel and userspace software, so that either one can be upgraded or rolled back independent of the other. To do this in full generality, it must be possible to add new features to the kernel vport layer without changing userspace software. The customary way to do this in the Linux networking stack is to use Netlink and in particular Netlink attributes. This commit adopts that model for the vport layer. It does not yet actually start using the Netlink socket layer, which will come later. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Change vport type from string to integer enumeration.Ben Pfaff
I plan to make the vport type part of the standard header stuck on each Netlink message related to a vport. As such, it is more convenient to use an integer than a string. In addition, by being fundamentally different from strings, using an integer may reduce the confusion we've had in the past over the differences in userspace and kernel names for network device and vport types. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27datapath: Make it possible to query vports by name regardless of datapath.Ben Pfaff
Until now it has only been possible to query a vport if you know what datapath it is on. This doesn't really make sense, so this commit removes that restriction. It is a little bigger than one might naturally expect because locking changes are required. This also allows us to get rid of the ETHTOOL_GDRVINFO kluge that has bothered me for a long time. The next commit does that. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>