@@ -976,9 +976,7 @@ struct ofpact_unroll_xlate {
/* OFPACT_ENCAP.
*
- * Used for OFPAT_ENCAP. */
-
-#define OFPACT_ENCAP_MAX_PROP_SIZE 256
+ * Used for NXAST_ENCAP. */
struct ofpact_encap {
struct ofpact ofpact;
@@ -990,14 +988,16 @@ struct ofpact_encap {
/* OFPACT_DECAP.
*
- * Used for OFPAT_DECAP. */
+ * Used for NXAST_DECAP. */
struct ofpact_decap {
struct ofpact ofpact;
- ovs_be32 new_pkt_type; /* New packet type. The special value
- (0,0xFFFE) "Use next proto" is used to
- request OvS to automatically set the
- new packet type based on the decap'ed
- header's next protocol.*/
+
+ /* New packet type.
+ *
+ * The special value (0,0xFFFE) "Use next proto" is used to request OVS to
+ * automatically set the new packet type based on the decap'ed header's
+ * next protocol. */
+ ovs_be32 new_pkt_type;
};
/* Converting OpenFlow to ofpacts. */
@@ -23,21 +23,21 @@
enum ofp_ed_prop_class {
OFPPPC_BASIC = 0, /* ONF Basic class. */
- OFPPPC_MPLS = 1, /* MPLS property class. */
- OFPPPC_GRE = 2, /* GRE property class. */
- OFPPPC_GTP = 3, /* GTP property class. */
- /* new values go here */
- OFPPPC_EXPERIMENTER=0xffff, /* Experimenter property class.
- * First 32 bits of property data is exp
- * id after that is the experimenter
- * property data. */
+ OFPPPC_MPLS = 1, /* MPLS property class. */
+ OFPPPC_GRE = 2, /* GRE property class. */
+ OFPPPC_GTP = 3, /* GTP property class. */
+
+ /* Experimenter property class.
+ *
+ * First 32 bits of property data is experimenter ID, after that is the
+ * experimenter property data. */
+ OFPPPC_EXPERIMENTER = 0xffff,
};
/*
* External representation of encap/decap properties.
* These must be padded to a multiple of 4 bytes.
*/
-
struct ofp_ed_prop_header {
ovs_be16 prop_class;
uint8_t type;
@@ -47,7 +47,6 @@ struct ofp_ed_prop_header {
/*
* Internal representation of encap/decap properties
*/
-
struct ofpact_ed_prop {
uint16_t prop_class;
uint8_t type;
@@ -6339,8 +6339,7 @@ commit_packet_type_change(const struct flow *flow,
switch (ntohl(flow->packet_type)) {
case PT_ETH: {
/* push_eth */
- odp_put_push_eth_action(odp_actions, &flow->dl_src,
- &flow->dl_dst);
+ odp_put_push_eth_action(odp_actions, &flow->dl_src,
+ &flow->dl_dst);
base_flow->packet_type = flow->packet_type;
base_flow->dl_src = flow->dl_src;
base_flow->dl_dst = flow->dl_dst; diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index e3e84100e0f2..94f2d0ba760b 100644
@@ -4028,9 +4028,9 @@ format_FIN_TIMEOUT(const struct ofpact_fin_timeout *a,
ds_put_format(s, "%s)%s", colors.paren, colors.end); }
-/* Action structure for OFPAT_ENCAP */
+/* Action structure for NXAST_ENCAP */
struct nx_action_encap {
- ovs_be16 type; /* OFPAT_ENCAP */
+ ovs_be16 type; /* OFPAT_VENDOR. */
ovs_be16 len; /* Total size including any property TLVs. */
ovs_be32 vendor; /* NX_VENDOR_ID. */
ovs_be16 subtype; /* NXAST_ENCAP. */
@@ -4235,9 +4235,9 @@ format_ENCAP(const struct ofpact_encap *a,
ds_put_format(s, "%s)%s", colors.paren, colors.end); }
-/* Action structure for OFPAT_DECAP */
+/* Action structure for NXAST_DECAP */
struct nx_action_decap {
- ovs_be16 type; /* OFPAT_DECAP */
+ ovs_be16 type; /* OFPAT_VENDOR */
ovs_be16 len; /* Total size including any property TLVs. */
ovs_be32 vendor; /* NX_VENDOR_ID. */
ovs_be16 subtype; /* NXAST_DECAP. */
@@ -39,8 +39,8 @@ decode_ed_prop(const struct ofp_ed_prop_header **ofp_prop,
}
*remaining -= pad_len;
- *ofp_prop = (const struct ofp_ed_prop_header *)
- ((char *)(*ofp_prop) + pad_len);
+ *ofp_prop = ALIGNED_CAST(const struct ofp_ed_prop_header *,
+ (char *) *ofp_prop + pad_len);
return 0;
}
@@ -55,7 +55,8 @@ encode_ed_prop(const struct ofpact_ed_prop **prop,
return OFPERR_OFPBAC_BAD_ARGUMENT;
}
- *prop = (const struct ofpact_ed_prop *) ((char *)(*prop) + prop_len);
+ *prop = ALIGNED_CAST(const struct ofpact_ed_prop *,
+ (char *) *prop + prop_len);
return 0;
}