aboutsummaryrefslogtreecommitdiff
path: root/ofproto/connmgr.h
AgeCommit message (Collapse)Author
2013-10-23connmgr: Fix packet-in reason for OpenFlow1.3 table-miss flow entries.YAMAMOTO Takashi
As per spec, make packet-in reason for OpenFlow1.3 table-miss flow entries no_match rather than action. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-10-22connmgr: Move send_len from ofputil_packet_in to ofproto_packet_in.Ben Pfaff
send_len is not directly part of the OpenFlow packet_in message, at least given that it is partially redundant with packet_len. send_len is, rather, a request to the connmgr that expresses how many bytes the action requested be sent to the controller, but the connmgr cannot always honor it. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-10-22connmgr: Move controller_id from ofputil_packet_in to ofproto_packet_in.Ben Pfaff
controller_id isn't part of the OpenFlow message, so it shouldn't be in ofputil_packet_in. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-10-22ofproto, ofp-util: Begin disentangling packet-in wire format and handling.Ben Pfaff
struct ofputil_packet_in mixes data included in OpenFlow packet_in messages with data that used internally by ofproto and connmgr to queue and route packet_ins. This commit begins disentangling these purposes by adding a new struct ofproto_packet_in that wraps struct ofputil_packet_in. Adding this new level of indirection causes a lot of code churn, so this commit mainly takes care of that to make the remaining changes easier to read. This commit does move the list node used for queuing packet_ins into the new wrapper structure. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-10-11connmgr: Formalize 'ofproto_mutex' as protecting ofconn monitor data.Ben Pfaff
'ofproto_mutex' has effectively protected the monitor-related members of struct ofconn since its introduction, but this was not written down or systematically annotated. This commit makes it more systematic and fixes a few issues found using the annotations. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-09-12ofproto: Add global locking around flow table changes.Ben Pfaff
This makes 'ofproto_mutex' protect the flow table well enough that threads other than the main one can realistically modify flows. I need to look at the interface between ofproto and connmgr: I think that there might need to be some locking there too. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-09-12ofproto: Eliminate 'ofproto_node' member from struct rule.Ben Pfaff
The ofproto_node member is convenient for collecting lists of rules, but it is also challenging for concurrency because only a single thread at a time can put a given rule on a list. This commit eliminates the ofproto_node member and introduces a new 'struct rule_collection' that can be use in a thread-safe manner. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-09-07ofproto: implement OFPT_GET_ASYNC_REQUESTAlexandru Copot
Signed-off-by: Alexandru Copot <alex.mihai.c@gmail.com> Cc: Daniel Baluta <dbaluta@ixiacom.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-27connmgr: Remove connmgr_must_output_local().Ethan Jackson
connmgr_must_output_local() requires a 'struct connmgr' handle, when in principle, it should simply be enough to know whether or not in_band is enabled. Breaking this up will allow ofproto-dpif-xlate to disentangle itself from ofproto-dpif in future patches. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2013-06-20Create specific types for ofp and odp portAlex Wang
Until now, datapath ports and openflow ports were both represented by unsigned integers of various sizes. With implicit conversions, etc., it is easy to mix them up and use one where the other is expected. This commit creates two typedefs, ofp_port_t and odp_port_t. Both of these two types are marked by "__attribute__((bitwise))" so that sparse can be used to detect any misuse. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-17ofproto: Make handle_openflow's msg argument const.Jarno Rajahalme
handle_openflow() must not modify the received message. Make this explicit. Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-29ofproto: Ditch SLOW_IN_BAND slow path reason.Ethan Jackson
Before this patch, when in band control was enabled, every DHCP packet had to be sent to userspace to calculate it's actions. Those DHCP packets intended for the local port would have a special action added to ensure they actually make it there. This unnecessarily complicates the code, so this patch takes a slightly different approach. When in-band is enabled, *all* DHCP packets must be sent to the local port. This guarantees that xlate_actions() returns the same result every time for a given flow. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-02-11ofp-util: Simplify struct ofputil_role_request.Ben Pfaff
It makes more sense to use enum ofp12_controller_role here than to use enum nx_role, because the former is a superset of the latter and we can then get rid of a bool member too. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-01-08ofproto: Fix remaining incorrect users of OVSP_LOCAL.Justin Pettit
In the switch to a single datapath, the simple mapping between OFPP_LOCAL and OVSP_LOCAL was broken. Unfortunately, a couple of translations were missed, so this commit fixes them. Reported-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-12-28Add Openflow 1.2 role request/reply processing, update OF 1.2 tests. Add ↵Jarno Rajahalme
struct ofputil_role_request and encode/decode functions for role request/reply. Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> [blp@nicira.com made ofp-print print any error, renamed a function, added a comment] Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-11-19connmgr: Mark ofconn_get_protocol() parameter const.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-11-12ofproto, connmgr: Parameterise OpenFlow versions for adding controllerSimon Horman
Allow allowed Open Flow versions to be passed rather than relying on hard-coded defaults. This is in preparation for allowing configuration of the allowed OpenFlow versions. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-04Introduce sparse flows and masks, to reduce memory usage and improve speed.Ben Pfaff
A cls_rule is 324 bytes on i386 now. The cost of a flow table lookup is currently proportional to this size, which is going to continue to grow. However, the required cost of a flow table lookup, with the classifier that we currently use, is only proportional to the number of bits that a rule actually matches. This commit implements that optimization by replacing the match inside "struct cls_rule" by a sparse representation. This reduces struct cls_rule to 100 bytes on i386. There is still some headroom for further optimization following this commit: - I suspect that adding an 'n' member to struct miniflow would make miniflow operations faster, since popcount() has some cost. - It's probably possible to replace the "struct minimatch" in cls_rule by just a "struct miniflow", since the cls_rule's cls_table has a copy of the minimask. - Some of the miniflow operations aren't well-optimized. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-04classifier: Break cls_rule 'flow' and 'wc' members into new "struct match".Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-12ofproto: New feature to notify controllers of flow table changes.Ben Pfaff
OpenFlow switching monitoring and controller coordination can be made more efficient if the switch can notify a controller of flow table changes as they occur, rather than periodically polling for changes. This commit implements such a feature. Feature #6633. CC: Natasha Gude <natasha@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-22Add support for tracking and logging daemon memory usage.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02Global replace of Nicira Networks.Raju Subramanian
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-15connmgr: Remove now-unused function connmgr_broadcast().Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-15connmgr: Drop 'flow' parameter from connmgr_send_packet_in().Ben Pfaff
Only 'flow->in_port' was used, which was redundant with pin->fmd.in_port. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-07Abstract everything that uses ofp_phy_port, add OF1.1 support.Ben Pfaff
Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-07Introduce ofputil_protocol, to abstract the protocol in use on a connection.Ben Pfaff
Open vSwitch already handles a few different protocol variations, but it does so in a nonuniform manner: - OpenFlow 1.0 and NXM flow formats are distinguished using the NXFF_* constant values from nicira-ext.h. - The "flow_mod_table_id" feature setting is maintained in ofproto as part of an OpenFlow connection's (ofconn's) state. There's no way to easily communicate this state among components. It's not much of a problem yet, but as more protocol support is added it seems better to have an abstract, uniform way to represent protocol versions and variants. This commit implements that by introducing a new type "enum ofputil_protocol". Each ofputil_protocol value represents a variant of a protocol version. Each value is a separate bit, so a single enum can also represent a set of protocols, which is often useful as well. Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-27Add ability to direct "packet-in"s to particular controllers.Ben Pfaff
Nicira's controllers are somewhat heterogeneous, so that particular "packet-in" messages should be directed to particular controllers. This new Nicira extension action allows designating a controller or controllers to receive the "packet-in" using a 16-bit integer ID. The new NXAST_CONTROLLER action also specifies the "reason" code to include in the "packet-in" message. This is particularly useful for simulating a "no-match" "packet-in" using a rule. Feature #8946. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-09ofproto: Implement OpenFlow extension to allow control over async messages.Ben Pfaff
Until now, the rules that cover the asynchronous messages that Open vSwitch sends to a controller have been ad hoc. The new NXT_SET_ASYNC_CONFIG message provides systematic, precise control. Feature #7086. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-01-13ofproto: New action TTL decrement.Pravin B Shelar
Following patch implements dec_ttl as vendor action with similar semantics as OpenFlow 1.2. If TTL reaches zero while procession actions in current table, the remaining actions in previous tables are processed. A configuration parameter is added to make TTL decrement to zero generate packet in. Feature #8758 Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2012-01-12Better abstract OpenFlow error codes.Ben Pfaff
This commit switches from using the actual protocol values of error codes internally in Open vSwitch, to using abstract values that are translated to and from protocol values at message parsing and serialization time. I believe that this makes the code easier to read and to write. This is also one step along the way toward OpenFlow 1.1 support because OpenFlow 1.1 renumbered a bunch of error codes. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-01-10openflow: New Nicira Extended PACKET_IN format.Ethan Jackson
The new PACKET_IN format implemented in this patch includes flow metadata such as the cookie, table_id, and registers. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-01-10ofproto: Always clone packets in PACKET_IN message.Ethan Jackson
This patch removes an optimization which significantly complicates the code in ways which would get worse in future patches if not removed. Furthermore, future patches will have fewer cases which can take advantage of the optimization further mitigating its justification. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2011-09-30Remove a pair of unnecessary dependencies on datapath-protocol.h.Ben Pfaff
These headers don't really need datapath-protocol.h. connmgr.h indirectly used "struct nlattr" from that header, so add a forward declaration. (The next commit will remove use of struct nlattr entirely from that header, since it is not really appropriate.)
2011-08-15connmgr: Remove unused function ofconn_n_pending_opgroups().Ben Pfaff
2011-07-01connmgr: Free controller info in the same module where it's allocated.Andrew Evans
Make ofproto_free_ofproto_controller_info() just a passthrough to connmgr_free_controller_info() so the allocation and freeing of memory in the controller info structure is done in the same place.
2011-06-14ofproto: Implement asynchronous OFPT_FLOW_MOD commands.Ben Pfaff
Some switching hardware takes a very long time to update its forwarding rules, up to hundreds of milliseconds. It is undesirable for Open vSwitch to block waiting this long for individual OpenFlow flow table modification commands to complete. This commit enables ofproto to queue up any number of independent flow table operations with asynchronous completion. I tested earlier versions of this commit using the "ofproto/clog" and "ofproto/unclog" commands that it implements in the software switch implementation. I have not tested the current version very much at all. CC: Casey Barker <crbarker@google.com> CC: Rajiv Ramanathan <rajivr@google.com>
2011-06-14connmgr: New function ofconn_send_error().Ben Pfaff
An upcoming commit will sometimes make connmgr responsible for sending error replies, so it's reasonable for it to have a function to do that.
2011-06-14openflow: Make stats replies more like other OpenFlow messages.Ben Pfaff
2011-05-12Implement basic multiple table support.Ben Pfaff
This implements basic multiple table support in ofproto and supporting libraries and utilities. The design is the same as the one that has been on the Open vSwitch "wdp" branch for a long time. There is no support for multiple tables in the software switch implementation (ofproto-dpif), only a set of hooks for other switch implementations to use. To allow controllers to add flows in a particular table, Open vSwitch adds an OpenFlow 1.0 extension called NXT_FLOW_MOD_TABLE_ID.
2011-05-11ofproto: Eliminate reference to dpif_upcall from ofproto.Ben Pfaff
The dpif_upcall structure is specific to the ofproto-dpif implementation. The generic ofproto and connmgr interface have no business using it, so this commit switches to using ofputil_packet_in instead.
2011-03-31ofproto: Change string sets in interface from svec to sset.Ben Pfaff
2011-03-29ofproto: Factor OpenFlow connection management into new "connmgr".Ben Pfaff
This removes a lot of code from ofproto.c and makes the ofproto code easier to understand.