netdev-dpif: Add metadata to dpif-packet.
[cascardo/ovs.git] / ofproto / ofproto-dpif-xlate.c
index 1d46456..07a1f29 100644 (file)
@@ -3015,7 +3015,6 @@ execute_controller_action(struct xlate_ctx *ctx, int len,
 {
     struct ofproto_packet_in *pin;
     struct dpif_packet *packet;
-    struct pkt_metadata md = PKT_METADATA_INITIALIZER(0);
 
     ctx->xout->slow |= SLOW_CONTROLLER;
     if (!ctx->xin->packet) {
@@ -3029,7 +3028,7 @@ execute_controller_action(struct xlate_ctx *ctx, int len,
                                           &ctx->xout->wc,
                                           ctx->xbridge->masked_set_action);
 
-    odp_execute_actions(NULL, &packet, 1, false, &md,
+    odp_execute_actions(NULL, &packet, 1, false,
                         ofpbuf_data(ctx->xout->odp_actions),
                         ofpbuf_size(ctx->xout->odp_actions), NULL);
 
@@ -3242,24 +3241,23 @@ static bool
 compose_dec_mpls_ttl_action(struct xlate_ctx *ctx)
 {
     struct flow *flow = &ctx->xin->flow;
-    uint8_t ttl = mpls_lse_to_ttl(flow->mpls_lse[0]);
     struct flow_wildcards *wc = &ctx->xout->wc;
 
-    memset(&wc->masks.mpls_lse, 0xff, sizeof wc->masks.mpls_lse);
     if (eth_type_mpls(flow->dl_type)) {
+        uint8_t ttl = mpls_lse_to_ttl(flow->mpls_lse[0]);
+
+        wc->masks.mpls_lse[0] |= htonl(MPLS_TTL_MASK);
         if (ttl > 1) {
             ttl--;
             set_mpls_lse_ttl(&flow->mpls_lse[0], ttl);
             return false;
         } else {
             execute_controller_action(ctx, UINT16_MAX, OFPR_INVALID_TTL, 0);
-
-            /* Stop processing for current table. */
-            return true;
         }
-    } else {
-        return true;
     }
+
+    /* Stop processing for current table. */
+    return true;
 }
 
 static void
@@ -3611,9 +3609,6 @@ ofpact_needs_recirculation_after_mpls(const struct xlate_ctx *ctx,
         return (mf_is_l3_or_higher(ofpact_get_REG_MOVE(a)->dst.field) ||
                 mf_is_l3_or_higher(ofpact_get_REG_MOVE(a)->src.field));
 
-    case OFPACT_REG_LOAD:
-        return mf_is_l3_or_higher(ofpact_get_REG_LOAD(a)->dst.field);
-
     case OFPACT_SET_FIELD:
         return mf_is_l3_or_higher(ofpact_get_SET_FIELD(a)->field);
 
@@ -3798,10 +3793,6 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
             nxm_execute_reg_move(ofpact_get_REG_MOVE(a), flow, wc);
             break;
 
-        case OFPACT_REG_LOAD:
-            nxm_execute_reg_load(ofpact_get_REG_LOAD(a), flow, wc);
-            break;
-
         case OFPACT_SET_FIELD:
             set_field = ofpact_get_SET_FIELD(a);
             mf = set_field->field;
@@ -3820,7 +3811,8 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
             }
 
             mf_mask_field_and_prereqs(mf, &wc->masks);
-            mf_set_flow_value(mf, &set_field->value, flow);
+            mf_set_flow_value_masked(mf, &set_field->value, &set_field->mask,
+                                     flow);
             break;
 
         case OFPACT_STACK_PUSH: