summaryrefslogtreecommitdiff
path: root/include/openflow
diff options
context:
space:
mode:
authorYi-Hung Wei <yihung.wei@gmail.com>2017-04-17 14:11:29 -0700
committerBen Pfaff <blp@ovn.org>2017-04-24 09:53:59 -0700
commite19a67692d17301c6ebcd5d634f03a9a46da0a5d (patch)
tree9b52d1d60b041f50134da2f5569a0395ca7fbb19 /include/openflow
parent391097b6106ebdb4466f471d38a04520ee1ab348 (diff)
downloadopenvswitch-e19a67692d17301c6ebcd5d634f03a9a46da0a5d.tar.gz
connmgr: Fix internal packet-in reason code mask.
Starting from OpenFlow 1.4+, OFPR_ACTION is split into four more descriptive reasons, OFPR_APPLY_ACTION, OFPR_ACTION_SET, OFPR_GROUP, and OFPR_PACKET_OUT. OVS maintains the new reason code internally, and it currently supports the first three reason code. If the version of an established OpenFlow connection is less than 1.4, OVS converts the internal reason code back to OFPR_ACTION to be backward compatible. However, the internal packet-in reason code mask is not properly maintained for the older OpenFlow version that may emit the packet-in messages wth the new reason code. It is because OVS does not enable the new reason code internally in the reason code mask for older OpenFlow version. This commit tries to address the aforementioned issue. Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include/openflow')
-rw-r--r--include/openflow/openflow-common.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h
index 530c10528..5936e3f09 100644
--- a/include/openflow/openflow-common.h
+++ b/include/openflow/openflow-common.h
@@ -291,9 +291,14 @@ enum ofp_packet_in_reason {
#define OFPR10_BITS \
((1u << OFPR_NO_MATCH) | (1u << OFPR_ACTION) | (1u << OFPR_INVALID_TTL))
+
+/* From OF1.4+, OFPR_ACTION is split into four more descriptive reasons,
+ * OFPR_APPLY_ACTION, OFPR_ACTION_SET, OFPR_GROUP, and OFPR_PACKET_OUT.
+ * OFPR_APPLY_ACTION shares the same number as OFPR_ACTION. */
+#define OFPR14_ACTION_BITS \
+ ((1u << OFPR_ACTION_SET) | (1u << OFPR_GROUP) | (1u << OFPR_PACKET_OUT))
#define OFPR14_BITS \
- (OFPR10_BITS | \
- (1u << OFPR_ACTION_SET) | (1u << OFPR_GROUP) | (1u << OFPR_PACKET_OUT))
+ (OFPR10_BITS | OFPR14_ACTION_BITS)
/* Nonstandard reason--not exposed via OpenFlow. */
OFPR_EXPLICIT_MISS,