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

datapath: Move Netlink PID for userspace actions from flows to actions.

Commit b063d9f06 "datapath: Use unicast Netlink sockets for upcalls" that
switched from multicast to unicast Netlink for sending upcalls added a
Netlink PID to each kernel flow, used by OVS_ACTION_ATTR_USERSPACE actions
within the flow as target.

This commit drops this per-flow PID in favor of a per-action PID, because
that is more flexible.  It does not yet make use of this additional
flexibility, so behavior should not change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #7559.
This commit is contained in:
Ben Pfaff
2011-10-12 16:24:54 -07:00
parent 69ebca1e35
commit 98403001ec
12 changed files with 280 additions and 197 deletions

View File

@@ -1244,6 +1244,19 @@ dp_netdev_sample(struct dp_netdev *dp,
nl_attr_get_size(subactions));
}
static void
dp_netdev_action_userspace(struct dp_netdev *dp,
struct ofpbuf *packet, struct flow *key,
const struct nlattr *a)
{
const struct nlattr *userdata_attr;
uint64_t userdata;
userdata_attr = nl_attr_find_nested(a, OVS_USERSPACE_ATTR_USERDATA);
userdata = userdata_attr ? nl_attr_get_u64(userdata_attr) : 0;
dp_netdev_output_userspace(dp, packet, DPIF_UC_ACTION, key, userdata);
}
static int
dp_netdev_execute_actions(struct dp_netdev *dp,
struct ofpbuf *packet, struct flow *key,
@@ -1262,8 +1275,7 @@ dp_netdev_execute_actions(struct dp_netdev *dp,
break;
case OVS_ACTION_ATTR_USERSPACE:
dp_netdev_output_userspace(dp, packet, DPIF_UC_ACTION,
key, nl_attr_get_u64(a));
dp_netdev_action_userspace(dp, packet, key, a);
break;
case OVS_ACTION_ATTR_PUSH_VLAN:
@@ -1330,6 +1342,7 @@ const struct dpif_class dpif_netdev_class = {
dpif_netdev_port_query_by_number,
dpif_netdev_port_query_by_name,
dpif_netdev_get_max_ports,
NULL, /* port_get_pid */
dpif_netdev_port_dump_start,
dpif_netdev_port_dump_next,
dpif_netdev_port_dump_done,