diff options
author | Ben Pfaff <blp@ovn.org> | 2016-01-20 09:57:16 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-01-20 09:57:16 -0800 |
commit | 9bfe933472a784cd6b3f946afc3eed73d74f6a7d (patch) | |
tree | 0f9ade568c83b24cf3ec18c2932cb4950fdf4c6f /include/openflow/openflow-common.h | |
parent | 730b985b03f79b5bd9c46edb8f1dc77a7db92547 (diff) | |
download | openvswitch-9bfe933472a784cd6b3f946afc3eed73d74f6a7d.tar.gz |
openflow: Better abstract handling of packet-in messages.
Packet-in messages have been a bit of a mess. First, their abstraction
in the form of struct ofputil_packet_in has some fields that are used
in a clear way for incoming and outgoing packet-ins, and others
(packet_len, total_len, buffer_id) have have confusing meanings or
usage pattern depending on their direction.
Second, it's very confusing how a packet-in has both a reason (OFPR_*)
and a miss type (OFPROTO_PACKET_IN_*) and how those add up to the
actual reason that is used "on the wire" for each OpenFlow version (and
even whether the packet-in is sent at all!).
Finally, there's all kind of low-level detail randomly scattered between
connmgr, ofproto-dpif-xlate, and ofp-util.
This commit attempts to clear up some of the confusion. It simplifies
the struct ofputil_packet_in abstraction by removing the members that
didn't have a clear and consistent meaning between incoming and outgoing
packet-ins. It gets rid of OFPROTO_PACKET_IN_*, instead adding a couple
of nonstandard OFPR_* reasons that add up to what OFPROTO_PACKET_IN_*
was meant to say (in what I hope is a clearer way). And it consolidates
the tricky parts into ofp-util, where I hope it will be easier to
understand all in one place.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Diffstat (limited to 'include/openflow/openflow-common.h')
-rw-r--r-- | include/openflow/openflow-common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h index 39857052c..da2b7a501 100644 --- a/include/openflow/openflow-common.h +++ b/include/openflow/openflow-common.h @@ -274,6 +274,7 @@ enum ofp_capabilities { /* Why is this packet being sent to the controller? */ enum ofp_packet_in_reason { + /* Standard reasons. */ OFPR_NO_MATCH, /* No matching flow. */ OFPR_ACTION, /* Action explicitly output to controller. */ OFPR_INVALID_TTL, /* Packet has invalid TTL. */ @@ -287,6 +288,10 @@ enum ofp_packet_in_reason { (OFPR10_BITS | \ (1u << OFPR_ACTION_SET) | (1u << OFPR_GROUP) | (1u << OFPR_PACKET_OUT)) + /* Nonstandard reason--not exposed via OpenFlow. */ + OFPR_EXPLICIT_MISS, + OFPR_IMPLICIT_MISS, + OFPR_N_REASONS }; |