2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00

odp-execute: Refine signatures for odp_execute_actions() callbacks.

Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2013-09-20 12:47:33 -07:00
parent 39d007ab3d
commit 4fc6592603
3 changed files with 19 additions and 15 deletions

View File

@@ -1226,10 +1226,11 @@ dpif_netdev_wait(struct dpif *dpif)
}
static void
dp_netdev_output_port(void *dp_, struct ofpbuf *packet, uint32_t out_port)
dp_netdev_output_port(void *dp_, struct ofpbuf *packet,
const struct flow *flow OVS_UNUSED, odp_port_t out_port)
{
struct dp_netdev *dp = dp_;
struct dp_netdev_port *p = dp->ports[out_port];
struct dp_netdev_port *p = dp->ports[odp_to_u32(out_port)];
if (p) {
netdev_send(p->netdev, packet);
}
@@ -1289,8 +1290,11 @@ dp_netdev_output_userspace(struct dp_netdev *dp, const struct ofpbuf *packet,
static void
dp_netdev_action_userspace(void *dp, struct ofpbuf *packet,
const struct flow *key,
const struct nlattr *userdata)
const struct nlattr *a)
{
const struct nlattr *userdata;
userdata = nl_attr_find_nested(a, OVS_USERSPACE_ATTR_USERDATA);
dp_netdev_output_userspace(dp, packet, DPIF_UC_ACTION, key, userdata);
}

View File

@@ -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;
}

View File

@@ -20,6 +20,7 @@
#include <stddef.h>
#include <stdint.h>
#include "openvswitch/types.h"
struct flow;
struct nlattr;
@@ -29,8 +30,9 @@ 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));
#endif