[ovs-dev] [patch_ports (rebased) 3/4] ofproto-dpif: Implement patch ports in userspace.

Ethan Jackson ethan at nicira.com
Thu Jan 24 19:45:21 UTC 2013


Ben pointed out off list that controllers will expect the flow metadata to be
cleared when traversing a patch port.

---
 ofproto/ofproto-dpif.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index d5bd0b4..d75a63c 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -5508,6 +5508,10 @@ compose_output_action__(struct action_xlate_ctx *ctx, uint16_t ofp_port,
     struct priority_to_dscp *pdscp;
     uint32_t out_port, odp_port;
 
+    /* If 'struct flow' gets additional metadata, we'll need to zero it out
+     * before traversing a patch port. */
+    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 18);
+
     if (!ofport) {
         xlate_report(ctx, "Nonexistent output port");
         return;
@@ -5537,6 +5541,9 @@ compose_output_action__(struct action_xlate_ctx *ctx, uint16_t ofp_port,
 
         ctx->ofproto = ofproto_dpif_cast(peer->up.ofproto);
         ctx->flow.in_port = peer->up.ofp_port;
+        ctx->flow.metadata = htonll(0);
+        memset(&ctx->flow.tunnel, 0, sizeof ctx->flow.tunnel);
+        memset(ctx->flow.regs, 0, sizeof ctx->flow.regs);
         xlate_table_action(ctx, ctx->flow.in_port, 0, true);
         ctx->flow = old_flow;
         ctx->ofproto = ofproto_dpif_cast(ofport->up.ofproto);
-- 
1.7.9.5




More information about the dev mailing list