output OFPP_TABLE should send the packet to the first table whose
table id is 0.
Nicira extension case, output-reg and bundle action, the behavior
is kept.

>From the spec,
> Submit the packet to the first flow table NB: This destination port
> can only be used in packet-out messages.  Submit the packet to the
> first flow table NB: This destination port can only be used in
> packet-out messages.

Signed-off-by: Isaku Yamahata <yamah...@valinux.co.jp>
---
 ofproto/ofproto-dpif.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 4783b7f..559a9d1 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -5151,7 +5151,8 @@ compose_dec_ttl(struct action_xlate_ctx *ctx)
 
 static void
 xlate_output_action(struct action_xlate_ctx *ctx,
-                    uint16_t port, uint16_t max_len)
+                    uint16_t port, uint16_t max_len,
+                    bool first_table)
 {
     uint16_t prev_nf_output_iface = ctx->nf_output_iface;
 
@@ -5162,7 +5163,8 @@ xlate_output_action(struct action_xlate_ctx *ctx,
         compose_output_action(ctx, ctx->flow.in_port);
         break;
     case OFPP_TABLE:
-        xlate_table_action(ctx, ctx->flow.in_port, ctx->table_id);
+        xlate_table_action(ctx, ctx->flow.in_port,
+                           first_table? 0: ctx->table_id);
         break;
     case OFPP_NORMAL:
         xlate_normal(ctx);
@@ -5202,7 +5204,7 @@ xlate_output_reg_action(struct action_xlate_ctx *ctx,
 {
     uint64_t port = mf_get_subfield(&or->src, &ctx->flow);
     if (port <= UINT16_MAX) {
-        xlate_output_action(ctx, port, or->max_len);
+        xlate_output_action(ctx, port, or->max_len, false);
     }
 }
 
@@ -5219,7 +5221,7 @@ xlate_enqueue_action(struct action_xlate_ctx *ctx,
     error = dpif_queue_to_priority(ctx->ofproto->dpif, queue_id, &priority);
     if (error) {
         /* Fall back to ordinary output action. */
-        xlate_output_action(ctx, enqueue->port, 0);
+        xlate_output_action(ctx, enqueue->port, 0, true);
         return;
     }
 
@@ -5314,7 +5316,7 @@ xlate_bundle_action(struct action_xlate_ctx *ctx,
     if (bundle->dst.field) {
         nxm_reg_load(&bundle->dst, port, &ctx->flow);
     } else {
-        xlate_output_action(ctx, port, 0);
+        xlate_output_action(ctx, port, 0, false);
     }
 }
 
@@ -5438,7 +5440,7 @@ do_xlate_action(const struct ofpact *a, struct 
action_xlate_ctx *ctx)
     switch (a->type) {
     case OFPACT_OUTPUT:
         xlate_output_action(ctx, ofpact_get_OUTPUT(a)->port,
-                            ofpact_get_OUTPUT(a)->max_len);
+                            ofpact_get_OUTPUT(a)->max_len, true);
         break;
 
     case OFPACT_CONTROLLER:
-- 
1.7.1.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to