+ * Asynchronous Operation Support
+ * ==============================
+ *
+ * The life-cycle operations on rules can operate asynchronously, meaning
+ * that ->rule_construct() and ->rule_destruct() only need to initiate
+ * their respective operations and do not need to wait for them to complete
+ * before they return. ->rule_modify_actions() also operates
+ * asynchronously.
+ *
+ * An ofproto implementation reports the success or failure of an
+ * asynchronous operation on a rule using the rule's 'pending' member,
+ * which points to a opaque "struct ofoperation" that represents the
+ * ongoing opreation. When the operation completes, the ofproto
+ * implementation calls ofoperation_complete(), passing the ofoperation and
+ * an error indication.
+ *
+ * Only the following contexts may call ofoperation_complete():
+ *
+ * - The function called to initiate the operation,
+ * e.g. ->rule_construct() or ->rule_destruct(). This is the best
+ * choice if the operation completes quickly.
+ *
+ * - The implementation's ->run() function.
+ *
+ * - The implementation's ->destruct() function.
+ *
+ * The ofproto base code updates the flow table optimistically, assuming
+ * that the operation will probably succeed:
+ *
+ * - ofproto adds or replaces the rule in the flow table before calling
+ * ->rule_construct().
+ *
+ * - ofproto updates the rule's actions before calling
+ * ->rule_modify_actions().
+ *
+ * - ofproto removes the rule before calling ->rule_destruct().
+ *
+ * With one exception, when an asynchronous operation completes with an
+ * error, ofoperation_complete() backs out the already applied changes:
+ *
+ * - If adding or replacing a rule in the flow table fails, ofproto
+ * removes the new rule or restores the original rule.
+ *
+ * - If modifying a rule's actions fails, ofproto restores the original
+ * actions.
+ *
+ * - Removing a rule is not allowed to fail. It must always succeed.
+ *
+ * The ofproto base code serializes operations: if any operation is in
+ * progress on a given rule, ofproto postpones initiating any new operation
+ * on that rule until the pending operation completes. Therefore, every
+ * operation must eventually complete through a call to
+ * ofoperation_complete() to avoid delaying new operations indefinitely
+ * (including any OpenFlow request that affects the rule in question, even
+ * just to query its statistics).
+ *
+ *
+ * Construction
+ * ============
+ *
+ * When ->rule_construct() is called, the caller has already inserted
+ * 'rule' into 'rule->ofproto''s flow table numbered 'rule->table_id'.
+ * There are two cases: