summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Remove netdev_find_dev_by_in4Simon Horman2011-09-226-98/+1
| | | | | | | | | | | netdev_find_dev_by_in4() appears to no longer be used and thus can be removed. This also allows netdev_enumerate(), the enumerate member of struct netdev_class and netdev_linux_enumerate() to be removed. I noticed this as netdev_linux_enumerate() makes use of if_nameindex() and if_freenameindex() which are not available when compiling using the Android NDK r6b (Android API level 13).
* Do not include net/ethernet.h and linux/if_tunnel.hSimon Horman2011-09-221-2/+0
| | | | | | | | net/ethernet.h and linux/if_tunnel.h do not appear to be needed on lib/netdev-linux.c. I noticed this while trying to build on the Android NDK r6b (Android API level 13) as these headers are not present there.
* Add fallback definition of SIG_ATOMIC_MAXSimon Horman2011-09-221-0/+6
| | | | | | | | | Android appears to lack SIG_ATOMIC_MAX which is only used in fatal-signal.c. Observed when compiling using the Android NDK r6b (Android API level 13). Patch based on a suggestion by Ben Pfaff
* Include <sys/time.h> in socket-util.hSimon Horman2011-09-221-0/+1
| | | | | | sys/time.h appears to be required for a definition of timespec on Android. Observed when compiling using the Android NDK r6b (Android API level 13).
* Include <sys/socket.h> in socket-util.hSimon Horman2011-09-221-0/+1
| | | | | This appears to be necessary to get a definition of socket_t when compiling using the Android NDK r6b (Android API level 13).
* netlink-socket: Fix typo in comment.Ben Pfaff2011-09-211-1/+1
|
* dpif-linux: Handle nl_lookup_genl_mcgroup() failures.Ethan Jackson2011-09-163-5/+19
| | | | | | | | | The nl_lookup_genl_mcgroup() function can fail on older kernels which do not support the required netlink interface. Before this patch, dpif-linux would refuse to create a datapath when this happened. With this patch, it attempts to use a workaround. If the workaround fails it simply disables the affected features without completely disabling the dpif.
* dpif-linux: Open dpif despite notifier failures.Ethan Jackson2011-09-161-13/+5
| | | | | | | Before this patch, if dpif-linux failed to register a notifier it would give up opening the datapath entirely. This seems draconian as a dpif can still perform the majority of its intended functionality without vport notifications.
* notifiers: Create and destroy nln_notifiers.Ethan Jackson2011-09-167-58/+78
| | | | | | | | This patch changes the interface of netlink-notifier and rtnetlink-link. Now nln_notifiers are allocated and destroyed by the module instead of passed in by callers. This allows the definition of nln_notifier to be hidden, and generally cleans up the code.
* notifiers: Rename run and wait functions.Ethan Jackson2011-09-167-19/+19
| | | | | | | | It makes more sense to call nln_notifier_run() and nln_notifier_wait() simply nln_run() and nln_wait() since they don't operate on notifiers but the entire nln object. This patch changes the nln and the rtnetlink-link modules to the new convention.
* datapath: Always use generic stats for devices (vports)Pravin Shelar2011-09-157-114/+189
| | | | | | | | | | | | | | | 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>
* cfm: Delete spurious blank line.Ben Pfaff2011-09-151-1/+0
|
* ofp-util: Remove obsolete build assertion.Ben Pfaff2011-09-151-3/+0
| | | | | | | Commit d1e9b9bf3 "nicira-ext: Renumber NXT_FLOW_MOD_TABLE_ID" eliminated the need for the NXT_SET_FLOW_FORMAT and NXT_FLOW_MOD_TABLE_ID commands to have different sizes, so asserting that they are different isn't useful anymore (although it is still correct and always will be).
* odp-util: Drop pointless "if" statement.Ben Pfaff2011-09-151-4/+0
|
* netdev: Allow get_mtu and set_mtu provider functions to be null.Ben Pfaff2011-09-153-24/+21
| | | | | | | | | Most netdev provider functions are allowed to be null if the implementation does not support this feature. This commit adds this feature for get_mtu and set_mtu, and changes netdev-vport to take advantage of it. Also, changes netdev_get_mtu() to report an MTU of 0 on error, instead of leaving the MTU indeterminate.
* lib: TYPE_IS_SIGNED macro generates compiler warnings.Ethan Jackson2011-09-131-1/+1
| | | | | | | | The TYPE_IS_SIGNED macro does a less than zero comparision with an unsigned type which can cause compiler warnings like the following: lib/tag.c:100:9: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
* socket-util: inet_parse_passive() had incorrect argument type.Ethan Jackson2011-09-132-2/+2
| | | | | | | This patch fixes the following compiler warning: lib/socket-util.c:621:5: error: comparison is always false due to limited range of data type [-Werror=type-limits]
* lib: Suppress comparison warnings in ovsdb libraries.Ethan Jackson2011-09-132-2/+2
| | | | | | | This patch fixes compiler warnings like the following: ./lib/ovsdb-types.h:171:5: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
* ofproto-dpif: Optimize flow revalidation for MAC learning.Ben Pfaff2011-09-131-0/+12
| | | | | | | Without this commit, every NXAST_LEARN action that adds a flow causes every facet to be revalidated. With this commit, as long as the "Usage Advice" in the large comment on struct nx_action_learn in nicira-ext.h is followed, this no longer happens.
* flow: New function flow_wildcards_is_catchall().Ben Pfaff2011-09-132-0/+31
| | | | This will be used in an upcoming commit.
* classifier: Move zero_wildcards() to flow.c as public flow_zero_wildcards().Ben Pfaff2011-09-133-61/+64
| | | | | This function will soon be used elsewhere. As it doesn't inherently have anything to with the classifier, move it to flow.c.
* Implement new "learn" action.Ben Pfaff2011-09-1310-40/+766
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are a few loose ends here. First, learning actions cause too much flow revalidation. Upcoming commits will fix that problem. The following additional issues have not yet been addressed: * Resource limits: nothing yet limits the maximum number of flows that can be learned. It is possible to exhaust all system memory. * Age reporting: there is no way to find out how soon a learned table entry is due to be evicted. To try this action out, here's a recipe for a very simple-minded MAC learning switch. It uses a 10-second MAC expiration time to make it easier to see what's going on: ovs-vsctl del-controller br0 ovs-ofctl del-flows br0 ovs-ofctl add-flow br0 "table=0 actions=learn(table=1, hard_timeout=10, \ NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \ output:NXM_OF_IN_PORT[]), resubmit(,1)" ovs-ofctl add-flow br0 "table=1 priority=0 actions=flood" You can then dump the MAC learning table with: ovs-ofctl dump-flows br0 table=1
* test-openflowd: Allow specifying port type on --ports option.Ben Pfaff2011-09-132-0/+21
| | | | | | | | This allows a command like "test-openflowd --enable-dummy dummy@br0 --ports=dummy@eth0,dummy@eth1,dummy@eth2" to create a dummy datapath with a number of dummy ports. This is more useful for testing than a dummy datapath with just an internal port, since output to "flood" and "normal" has less pathological results.
* dpif-netdev: Also allow "dummy" netdevs in a dpif-netdev.Ben Pfaff2011-09-131-1/+1
| | | | | | | I've always intended this to work, but either I never tested it or the support rotted. This will soon be used in some tests that I will add.
* ofproto-dpif: Add -generate option to ofproto/trace command.Ben Pfaff2011-09-132-0/+73
|
* meta-flow: New library for working with fields by id.Ben Pfaff2011-09-137-773/+1974
| | | | | | | | | | OVS already has a fairly good set of functions for working with fields that are known at compile time, but support for working with fields that are known only at runtime is fairly limited (and fairly unneeded). However, with NXM identifiers becoming more and more widely used throughout Nicira extensions, it's becoming corresponding more and more common to need to refer to fields at runtime. This new library represents a first attempt at a systematic approach for doing so.
* ofp-util: New function for parsing key-value pairs.Ben Pfaff2011-09-133-57/+78
| | | | This will soon have a new user, but it's a worthwhile cleanup on its own.
* ofp-util: Add type-safe functions for serializing actions.Ben Pfaff2011-09-137-114/+122
|
* ofp-parse: Refactor action parsing to improve compiler warnings.Ben Pfaff2011-09-131-139/+212
| | | | | | When a new action is added, compiler warnings show most of the places that need new code to handle that action. The action parsing code in ofp-parse.c was the one remaining missing case. This commit fixes that.
* ofp-util: Further abstract definitions of action properties.Ben Pfaff2011-09-134-67/+123
| | | | | | | | | This commit primarily moves the OFPAT_ACTION and NXAST_ACTION invocations into a new file ofp-util.def. This allows multiple places in the source to use them. This commit also adds a new function ofputil_action_code_from_name(). The following commit will add the first user.
* ofp-util: New functions for parsing and formatting OpenFlow port numbers.Ben Pfaff2011-09-134-83/+79
| | | | | These functions were previously used only in ofp-parse.c and ofp-print.c, but they are more generally useful and future commits will add more users.
* packets: Add more utility functions for IPv4 and IPv6 addresses.Ben Pfaff2011-09-136-39/+94
| | | | | | | We had these functions scattered around the source tree anyway. packets.h is a good place to centralize them. I do plan to introduce some additional callers.
* classifier: Change cls_rule_set_nd_target() to take a pointer.Ben Pfaff2011-09-133-4/+4
| | | | | | | The other cls_rule_*() functions that take IPv6 addresses take a pointer to an in6_addr, so cls_rule_set_nd_target() should as well for consistency. Possibly this is more efficient also, although I guess it doesn't really make much of a difference either way.
* datapath: Strip down vport interface : OVS_VPORT_ATTR_MTUPravin Shelar2011-09-129-37/+85
| | | | | | | | | | | | | | 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>
* datapath: add key support to CAPWAP tunnelValient Gough2011-09-091-7/+5
| | | | | | | | | | | | | 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: VLAN actions should use push/pop semanticsPravin Shelar2011-09-095-35/+29
| | | | | | | | | | | | | | 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>
* netlink-socket: Avoid use-after-free in nl_lookup_genl_mcgroup().Ben Pfaff2011-09-091-30/+41
| | | | | | | | | | | | | Commit e408762f "netlink-socket: New function nl_lookup_genl_mcgroup()" modified do_lookup_genl_family() to return the Netlink attributes to the caller, but it still freed the Netlink message itself, which meant that the attributes pointed into freed memory. This commit fixes the problem. This commit is not a minimal fix. It refactors do_lookup_genl_family(), changing the return value from "negative errno value or positive genl family id" to the more common "zero or positive errno value". Found by valgrind.
* cfm: Write remote MPIDs to the database.Ethan Jackson2011-09-092-0/+26
| | | | | | | | A controller may want to know which MPIDs are reachable from an interface configured with CFM. This patch regularly writes this information to the database. Bug #7014.
* cfm: Eight byte MPIDs in extended mode.Ethan Jackson2011-09-092-23/+36
| | | | | | | | | 802.1ag only allows for MPIDs in the range [1, 8191]. This is restrictive enough to make assignment of MPIDs to instances of OVS awkward. This patch allows eight byte MPIDs when running in extended mode. Bug #7014.
* cfm: Allow accurate transmission intervals in extended mode.Ethan Jackson2011-09-091-10/+31
| | | | | | | | | | | | | | The standard CFM protocol only allows a handful of transmission rates. This is particularly problematic if you want to support a transmission rate slower than 100 ms and faster than 1000 ms. This patch allows arbitrary transmission rates (between 1 ms and 65535 ms). It does this by commandeering parts of a reserved "zero" field in the ccm message. This breaks wire compatibility with standard 802.1ag implementations, and thus is only supported in extended mode. Bug #7014.
* cfm: New cfm extended mode.Ethan Jackson2011-09-092-6/+17
| | | | | | | | The new extended mode introduced in this patch will be used for features which break wire compatibility with 802.1ag compliant implementations. Bug #7014.
* cfm: Remove cfm_remote_mpid configuration.Ethan Jackson2011-09-092-69/+45
| | | | | | | | | | | | | | | | | | | According to the 802.1ag specification, users should be able to configure the CFM module with a list of remote endpoints with which the local endpoint should have connectivity. Commit 93b8df3853 "cfm: Remove Maintenance_Point and Monitor tables." changed the behavior so that only one remote endpoint could be specified. This commit takes it further, by disallowing specification of any remote endpoints. Due to this change, the semantics of the fault flag are slightly different. Before, a fault was triggered if any of the configured remote endpoints were unreachable (or with RDI), or if any unconfigured remote endpoints were reachable. Now a fault is triggered if no remote endpoints are reachable at all, or if reachable endpoints have set their RDI. Bug #7014.
* cfm: Trigger fault on unexpected CCM reception.Ethan Jackson2011-09-091-2/+8
|
* lacp: Clean up LACP module interface.Ethan Jackson2011-09-082-64/+69
| | | | | | | | There's no particular reason to force users of the LACP module to be aware of the lacp_pdu structure. This patch hides that information in the LACP module implementation. This results in slightly cleaner code which is more consistent with the CFM module.
* datapath: Allow a packet with no input port to omit OVS_KEY_ATTR_IN_PORT.Ben Pfaff2011-09-082-5/+18
| | | | | | | | | | | | | | | | | | When ovs-vswitchd executes actions on a synthesized packet, that is, on a packet that is not being forwarded from any particular port but is being generated by ovs-vswitchd itself or by an OpenFlow controller (using a OFPT_PACKET_OUT message with an in_port of OFPP_NONE), there is no good choice for the in_port to pass to the kernel in the flow in the OVS_PACKET_CMD_EXECUTE message. This commit allows ovs-vswitchd to omit the in_port entirely in this case. This fixes a bug in OFPT_PACKET_OUT: using an in_port of OFPP_NONE would cause the packet to be dropped by the kernel, since that's an invalid input port. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Reported-by: Aaron Rosen <arosen@clemson.edu>
* Strip down vport interface : iflinkPravin Shelar2011-09-082-9/+0
| | | | | | | | 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>
* netlink-protocol: Move CTRL_ATTR_MCAST definitions for consistency.Ben Pfaff2011-09-061-18/+18
| | | | | | | | | | | | | | | | One of the current goals of netlink-protocol.h, for better or for worse, is to ensure that the same definitions are available whether a Linux kernel is in use or not. One of the ways it accomplishes this is by putting the conditional definitions that test for features missing in old kernels at the very end, after the dummy definitions used on non-Linux platforms. However, commit b0025c8389f "netlink-protocol: Define missing symbols" added new conditional definitions only in the Linux platform case, which means that those definitions won't be available on non-Linux platforms. This commit moves them to the end, instead. The symbols that are moved are only used from netlink-socket.c, which is only built on Linux platforms, so this does not change an actual bug. It only makes the location of the definitions consistent with prior practice.
* netlink-protocol: Define missing symbols.Ethan Jackson2011-09-021-0/+19
| | | | | OVS fails to build with xenddk-56100build3926 because it has an outdated genetlink header.
* dpif-linux: Stop listening for RTNL notifications.Ethan Jackson2011-09-011-18/+44
| | | | | | | | Currently dpif-linux listens for vport change events using rtnetlink notifications. This patch switches to the ovs genl notification system. Feature #6809.
* netlink-socket: New function nl_lookup_genl_mcgroup().Ethan Jackson2011-09-012-3/+53
|