* instead of having the switch decide which table is most appropriate as
* required by OpenFlow 1.0. By default, the extension is disabled.
*
- * When this feature is enabled, Open vSwitch treats struct ofp_flow_mod's
+ * When this feature is enabled, Open vSwitch treats struct ofp10_flow_mod's
* 16-bit 'command' member as two separate fields. The upper 8 bits are used
* as the table ID, the lower 8 bits specify the command as usual. A table ID
* of 0xff is treated like a wildcarded table ID.
/* NXT_PACKET_IN (analogous to OFPT_PACKET_IN).
*
- * The NXT_PACKET_IN format is intended to model the OpenFlow-1.2 PACKET_IN
- * with some minor tweaks. Most notably NXT_PACKET_IN includes the cookie of
- * the rule which triggered the NXT_PACKET_IN message, and the match fields are
- * in NXM format.
+ * NXT_PACKET_IN is similar to the OpenFlow 1.2 OFPT_PACKET_IN. The
+ * differences are:
*
- * The match fields in the NXT_PACKET_IN are intended to contain flow
- * processing metadata collected at the time the NXT_PACKET_IN message was
- * triggered. It is minimally required to contain the NXM_OF_IN_PORT of the
- * packet, but may include other NXM headers such as flow registers. The match
- * fields are allowed to contain non-metadata (e.g. NXM_OF_ETH_SRC etc).
- * However, this information can typically be found in the packet directly, so
- * it may be redundant.
+ * - NXT_PACKET_IN includes the cookie of the rule that triggered the
+ * message. (OpenFlow 1.3 OFPT_PACKET_IN also includes the cookie.)
+ *
+ * - The metadata fields use NXM (instead of OXM) field numbers.
+ *
+ * Open vSwitch 1.9.0 and later omits metadata fields that are zero (as allowed
+ * by OpenFlow 1.2). Earlier versions included all implemented metadata
+ * fields.
+ *
+ * Open vSwitch does not include non-metadata in the nx_match, because by
+ * definition that information can be found in the packet itself. The format
+ * and the standards allow this, however, so controllers should be prepared to
+ * tolerate future changes.
+ *
+ * The NXM format is convenient for reporting metadata values, but it is
+ * important not to interpret the format as matching against a flow, because it
+ * does not. Nothing is being matched; arbitrary metadata masks would not be
+ * meaningful.
*
* Whereas in most cases a controller can expect to only get back NXM fields
* that it set up itself (e.g. flow dumps will ordinarily report only NXM
* fields from flows that the controller added), NXT_PACKET_IN messages might
* contain fields that the controller does not understand, because the switch
* might support fields (new registers, new protocols, etc.) that the
- * controller does not. The controller must prepared to tolerate these.
+ * controller does not. The controller must prepared to tolerate these.
*
* The 'cookie' and 'table_id' fields have no meaning when 'reason' is
* OFPR_NO_MATCH. In this case they should be set to 0. */
* The padding bytes preceding the Ethernet frame ensure that the IP
* header (if any) following the Ethernet header is 32-bit aligned. */
- /* uint8_t nxm_fields[...]; */ /* Match. */
+ /* uint8_t nxm_fields[...]; */ /* NXM headers. */
/* uint8_t pad[2]; */ /* Align to 64 bit + 16 bit. */
/* uint8_t data[0]; */ /* Ethernet frame. */
};
NXAST_NOTE, /* struct nx_action_note */
NXAST_SET_TUNNEL64, /* struct nx_action_set_tunnel64 */
NXAST_MULTIPATH, /* struct nx_action_multipath */
- NXAST_AUTOPATH, /* struct nx_action_autopath */
+ NXAST_AUTOPATH__DEPRECATED, /* struct nx_action_autopath */
NXAST_BUNDLE, /* struct nx_action_bundle */
NXAST_BUNDLE_LOAD, /* struct nx_action_bundle */
NXAST_RESUBMIT_TABLE, /* struct nx_action_resubmit */
NXAST_DEC_TTL, /* struct nx_action_header */
NXAST_FIN_TIMEOUT, /* struct nx_action_fin_timeout */
NXAST_CONTROLLER, /* struct nx_action_controller */
+ NXAST_DEC_TTL_CNT_IDS, /* struct nx_action_cnt_ids */
};
/* Header for Nicira-defined actions. */
* Uses the 'fields' and 'basis' parameters. */
NX_BD_ALG_HRW /* Highest Random Weight. */
};
+
+\f
+/* Action structure for NXAST_DEC_TTL_CNT_IDS.
+ *
+ * If the packet is not IPv4 or IPv6, does nothing. For IPv4 or IPv6, if the
+ * TTL or hop limit is at least 2, decrements it by 1. Otherwise, if TTL or
+ * hop limit is 0 or 1, sends a packet-in to the controllers with each of the
+ * 'n_controllers' controller IDs specified in 'cnt_ids'.
+ *
+ * (This differs from NXAST_DEC_TTL in that for NXAST_DEC_TTL the packet-in is
+ * sent only to controllers with id 0.)
+ */
+struct nx_action_cnt_ids {
+ ovs_be16 type; /* OFPAT_VENDOR. */
+ ovs_be16 len; /* Length including slaves. */
+ ovs_be32 vendor; /* NX_VENDOR_ID. */
+ ovs_be16 subtype; /* NXAST_DEC_TTL_CNT_IDS. */
+
+ ovs_be16 n_controllers; /* Number of controllers. */
+ uint8_t zeros[4]; /* Must be zero. */
+
+ /* Followed by 1 or more controller ids.
+ *
+ * uint16_t cnt_ids[]; // Controller ids.
+ * uint8_t pad[]; // Must be 0 to 8-byte align cnt_ids[].
+ */
+};
+OFP_ASSERT(sizeof(struct nx_action_cnt_ids) == 16);
+
\f
/* Action structure for NXAST_OUTPUT_REG.
*
OFP_ASSERT(sizeof(struct nx_flow_stats) == 48);
/* Nicira vendor stats request of type NXST_AGGREGATE (analogous to
- * OFPST_AGGREGATE request). */
+ * OFPST_AGGREGATE request).
+ *
+ * The reply format is identical to the reply format for OFPST_AGGREGATE,
+ * except for the header. */
struct nx_aggregate_stats_request {
ovs_be16 out_port; /* Require matching entries to include this
as an output port. A value of OFPP_NONE
*/
};
OFP_ASSERT(sizeof(struct nx_aggregate_stats_request) == 8);
-
-/* Body for nicira_stats_msg reply of type NXST_AGGREGATE (analogous to
- * OFPST_AGGREGATE reply). */
-struct nx_aggregate_stats_reply {
- ovs_be64 packet_count; /* Number of packets, UINT64_MAX if unknown. */
- ovs_be64 byte_count; /* Number of bytes, UINT64_MAX if unknown. */
- ovs_be32 flow_count; /* Number of flows. */
- uint8_t pad[4]; /* Align to 64 bits. */
-};
-OFP_ASSERT(sizeof(struct nx_aggregate_stats_reply) == 24);
\f
/* NXT_SET_CONTROLLER_ID.
*
* change in future versions of Open vSwitch.
*
* OVS will always send the notifications for a given flow table change before
- * the reply to a OFPT_BARRIER_REQUEST request that precedes the flow table
- * change. Thus, if the controller does not receive an abbreviated
- * notification for a flow_mod before the next OFPT_BARRIER_REPLY, it will
- * never receive one. */
+ * the reply to a OFPT_BARRIER_REQUEST request that follows the flow table
+ * change. Thus, if the controller does not receive an abbreviated (or
+ * unabbreviated) notification for a flow_mod before the next
+ * OFPT_BARRIER_REPLY, it will never receive one. */
struct nx_flow_update_abbrev {
ovs_be16 length; /* Length is 8. */
ovs_be16 event; /* NXFME_ABBREV. */