+static void
+xlate_set_dl_tci(struct action_xlate_ctx *ctx)
+{
+ ovs_be16 dl_vlan = ctx->flow.dl_vlan;
+ uint8_t dl_vlan_pcp = ctx->flow.dl_vlan_pcp;
+
+ if (dl_vlan == htons(OFP_VLAN_NONE)) {
+ odp_actions_add(ctx->out, ODPAT_STRIP_VLAN);
+ } else {
+ union odp_action *oa = odp_actions_add(ctx->out, ODPAT_SET_DL_TCI);
+ oa->dl_tci.tci = htons(ntohs(dl_vlan & htons(VLAN_VID_MASK))
+ | (dl_vlan_pcp << VLAN_PCP_SHIFT)
+ | VLAN_CFI);
+ }
+}
+
+static void
+xlate_reg_move_action(struct action_xlate_ctx *ctx,
+ const struct nx_action_reg_move *narm)
+{
+ ovs_be16 old_vlan = ctx->flow.dl_vlan;
+ uint8_t old_pcp = ctx->flow.dl_vlan_pcp;
+
+ nxm_execute_reg_move(narm, &ctx->flow);
+
+ if (ctx->flow.dl_vlan != old_vlan || ctx->flow.dl_vlan_pcp != old_pcp) {
+ xlate_set_dl_tci(ctx);
+ }
+}
+