summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-08-10 13:05:17 -0700
committerEthan Jackson <ethan@nicira.com>2011-08-12 15:06:53 -0700
commitf694937d4ec5342b218b760cabbf7a48d19110e8 (patch)
treec71bb913743019f99a69a80d76c8574963e036f5 /ofproto
parente7ba48c87d5b6441e2a3f07f3bc1a1f3633616c7 (diff)
downloadopenvswitch-f694937d4ec5342b218b760cabbf7a48d19110e8.tar.gz
nicra-ext: New action NXAST_OUTPUT_REG.
The NXAST_OUTPUT_REG action outputs to the OpenFlow port contained in a supplied NXM field.
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 010d98b42..fdef4afa5 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -3020,6 +3020,19 @@ xlate_output_action__(struct action_xlate_ctx *ctx,
}
static void
+xlate_output_reg_action(struct action_xlate_ctx *ctx,
+ const struct nx_action_output_reg *naor)
+{
+ uint64_t ofp_port;
+
+ ofp_port = nxm_read_field_bits(naor->src, naor->ofs_nbits, &ctx->flow);
+
+ if (ofp_port <= UINT16_MAX) {
+ xlate_output_action__(ctx, ofp_port, ntohs(naor->max_len));
+ }
+}
+
+static void
xlate_output_action(struct action_xlate_ctx *ctx,
const struct ofp_action_output *oao)
{
@@ -3154,6 +3167,7 @@ do_xlate_actions(const union ofp_action *in, size_t n_in,
const struct nx_action_multipath *nam;
const struct nx_action_autopath *naa;
const struct nx_action_bundle *nab;
+ const struct nx_action_output_reg *naor;
enum ofputil_action_code code;
ovs_be64 tun_id;
@@ -3279,6 +3293,11 @@ do_xlate_actions(const union ofp_action *in, size_t n_in,
bundle_execute_load(nab, &ctx->flow, slave_enabled_cb,
ctx->ofproto);
break;
+
+ case OFPUTIL_NXAST_OUTPUT_REG:
+ naor = (const struct nx_action_output_reg *) ia;
+ xlate_output_reg_action(ctx, naor);
+ break;
}
}
}