aboutsummaryrefslogtreecommitdiff
path: root/lib/odp-execute.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-09-20 12:47:33 -0700
committerBen Pfaff <blp@nicira.com>2013-10-09 17:14:40 -0700
commit4fc65926033eb4a020d1f63db540fe551eae9f82 (patch)
tree8808c738bf157617e081b7d6e52712d6a39f0fc8 /lib/odp-execute.c
parent39d007ab3dbad6dbc92c71bc7797a728d3995afb (diff)
odp-execute: Refine signatures for odp_execute_actions() callbacks.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/odp-execute.c')
-rw-r--r--lib/odp-execute.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/odp-execute.c b/lib/odp-execute.c
index c91cc4a2..3914c3b7 100644
--- a/lib/odp-execute.c
+++ b/lib/odp-execute.c
@@ -125,10 +125,11 @@ static void
odp_execute_sample(void *dp, struct ofpbuf *packet, struct flow *key,
const struct nlattr *action,
void (*output)(void *dp, struct ofpbuf *packet,
- uint32_t out_port),
+ const struct flow *key,
+ odp_port_t out_port),
void (*userspace)(void *dp, struct ofpbuf *packet,
const struct flow *key,
- const struct nlattr *a))
+ const struct nlattr *action))
{
const struct nlattr *subactions = NULL;
const struct nlattr *a;
@@ -163,10 +164,11 @@ void
odp_execute_actions(void *dp, struct ofpbuf *packet, struct flow *key,
const struct nlattr *actions, size_t actions_len,
void (*output)(void *dp, struct ofpbuf *packet,
- uint32_t out_port),
+ const struct flow *key,
+ odp_port_t out_port),
void (*userspace)(void *dp, struct ofpbuf *packet,
const struct flow *key,
- const struct nlattr *a))
+ const struct nlattr *action))
{
const struct nlattr *a;
unsigned int left;
@@ -177,16 +179,12 @@ odp_execute_actions(void *dp, struct ofpbuf *packet, struct flow *key,
switch ((enum ovs_action_attr) type) {
case OVS_ACTION_ATTR_OUTPUT:
if (output) {
- output(dp, packet, nl_attr_get_u32(a));
+ output(dp, packet, key, u32_to_odp(nl_attr_get_u32(a)));
}
break;
case OVS_ACTION_ATTR_USERSPACE: {
- if (userspace) {
- const struct nlattr *userdata;
- userdata = nl_attr_find_nested(a, OVS_USERSPACE_ATTR_USERDATA);
- userspace(dp, packet, key, userdata);
- }
+ userspace(dp, packet, key, a);
break;
}