summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-xlate.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2016-02-19 16:10:06 -0800
committerBen Pfaff <blp@ovn.org>2016-02-19 16:15:45 -0800
commit77ab5fd2a95ba2fef5bbe25aaa429776b9e29ea3 (patch)
tree66279d96396631e8c92f55a4b589bfbe0dfc1090 /ofproto/ofproto-dpif-xlate.h
parent5d10476a12dd3df756e15c9bcae0061bef787379 (diff)
downloadopenvswitch-77ab5fd2a95ba2fef5bbe25aaa429776b9e29ea3.tar.gz
Implement serializing the state of packet traversal in "continuations".
One purpose of OpenFlow packet-in messages is to allow a controller to interpose on the path of a packet through the flow tables. If, for example, the controller needs to modify a packet in some way that the switch doesn't directly support, the controller should be able to program the switch to send it the packet, then modify the packet and send it back to the switch to continue through the flow table. That's the theory. In practice, this doesn't work with any but the simplest flow tables. Packet-in messages simply don't include enough context to allow the flow table traversal to continue. For example: * Via "resubmit" actions, an Open vSwitch packet can have an effective "call stack", but a packet-in can't describe it, and so it would be lost. * A packet-in can't preserve the stack used by NXAST_PUSH and NXAST_POP actions. * A packet-in can't preserve the OpenFlow 1.1+ action set. * A packet-in can't preserve the state of Open vSwitch mirroring or connection tracking. This commit introduces a solution called "continuations". A continuation is the state of a packet's traversal through OpenFlow flow tables. A "controller" action with the "pause" flag, which is newly implemented in this commit, generates a continuation and sends it to the OpenFlow controller in a packet-in asynchronous message (only NXT_PACKET_IN2 supports continuations, so the controller must configure them with NXT_SET_PACKET_IN_FORMAT). The controller processes the packet-in, possibly modifying some of its data, and sends it back to the switch with an NXT_RESUME request, which causes flow table traversal to continue. In principle, a single packet can be paused and resumed multiple times. Another way to look at it is: - "pause" is an extension of the existing OFPAT_CONTROLLER action. It sends the packet to the controller, with full pipeline context (some of which is switch implementation dependent, and may thus vary from switch to switch). - A continuation is an extension of OFPT_PACKET_IN, allowing for implementation dependent metadata. - NXT_RESUME is an extension of OFPT_PACKET_OUT, with the semantics that the pipeline processing is continued with the original translation context from where it was left at the time it was paused. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Diffstat (limited to 'ofproto/ofproto-dpif-xlate.h')
-rw-r--r--ofproto/ofproto-dpif-xlate.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif-xlate.h b/ofproto/ofproto-dpif-xlate.h
index 227a16173..640ed4b53 100644
--- a/ofproto/ofproto-dpif-xlate.h
+++ b/ofproto/ofproto-dpif-xlate.h
@@ -201,6 +201,10 @@ void xlate_in_init(struct xlate_in *, struct ofproto_dpif *,
void xlate_out_uninit(struct xlate_out *);
void xlate_actions_for_side_effects(struct xlate_in *);
+enum ofperr xlate_resume(struct ofproto_dpif *,
+ const struct ofputil_packet_in_private *,
+ struct ofpbuf *odp_actions, enum slow_path_reason *);
+
int xlate_send_packet(const struct ofport_dpif *, struct dp_packet *);
struct xlate_cache *xlate_cache_new(void);