[ovs-dev] [PATCH v3 10/12] ofproto-dpif: teach do_xlate_action() goto-table instruction

Isaku Yamahata yamahata at valinux.co.jp
Mon Jul 23 08:08:49 UTC 2012


Signed-off-by: Isaku Yamahata <yamahata at valinux.co.jp>
---
v3
- manual rebase

v2
- changed for ofp_instruction

Conflicts:

	ofproto/ofproto-dpif.c
---
 lib/ofp-actions.c      |    3 +--
 ofproto/ofproto-dpif.c |   11 +++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index 165b131..2a027dc 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -907,8 +907,7 @@ ofpacts_pull_openflow11_instructions(struct ofpbuf *openflow,
         ogt->table_id = oigt->table_id;
     }
 
-    if (insts[OVSINST_OFPIT11_GOTO_TABLE] ||
-        insts[OVSINST_OFPIT11_WRITE_METADATA] ||
+    if (insts[OVSINST_OFPIT11_WRITE_METADATA] ||
         insts[OVSINST_OFPIT11_WRITE_ACTIONS] ||
         insts[OVSINST_OFPIT11_CLEAR_ACTIONS]) {
         error = OFPERR_OFPBIC_UNSUP_INST;
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 8b857f3..c73b2e4 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -5505,7 +5505,6 @@ do_xlate_action(const struct ofpact *a, struct action_xlate_ctx *ctx)
 
     case OFPACT_RESUBMIT:
         xlate_ofpact_resubmit(ctx, ofpact_get_RESUBMIT(a));
-        break;
 
     case OFPACT_SET_TUNNEL:
         ctx->flow.tun_id = htonll(ofpact_get_SET_TUNNEL(a)->tun_id);
@@ -5578,9 +5577,13 @@ do_xlate_action(const struct ofpact *a, struct action_xlate_ctx *ctx)
         NOT_REACHED();  /* TODO:XXX */
         break;
 
-    case OFPACT_GOTO_TABLE:
-        NOT_REACHED();  /* TODO:XXX */
-        break;
+    case OFPACT_GOTO_TABLE: {
+        struct ofpact_goto_table *ogt = ofpact_get_GOTO_TABLE(a);
+        xlate_table_action(ctx, ctx->flow.in_port,
+                           ogt->table_id == 255? ctx->table_id: ogt->table_id);
+                           /* TODO:XXX remove 255 */
+        return false;
+    }
     }
 
     return true;
-- 
1.7.1.1




More information about the dev mailing list