2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-05 00:35:33 +00:00

datapath: Convert kernel priority actions into match/set.

Following patch adds skb-priority to flow key. So userspace will know
what was priority when packet arrived and we can remove the pop/reset
priority action. It's no longer necessary to have a special action for
pop that is based on the kernel remembering original skb->priority.
Userspace can just emit a set priority action with the original value.

Since the priority field is a match field with just a normal set action,
we can convert it into the new model for actions that are based on
matches.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>

Bug #7715
This commit is contained in:
Pravin B Shelar
2011-11-01 10:13:16 -07:00
parent 7f4ae491b0
commit abff858b5a
22 changed files with 159 additions and 114 deletions

View File

@@ -881,7 +881,7 @@ dpif_netdev_execute(struct dpif *dpif,
ofpbuf_reserve(&copy, DP_NETDEV_HEADROOM);
ofpbuf_put(&copy, packet->data, packet->size);
flow_extract(&copy, 0, -1, &key);
flow_extract(&copy, 0, 0, -1, &key);
error = dpif_netdev_flow_from_nlattrs(key_attrs, key_len, &key);
if (!error) {
dp_netdev_execute_actions(dp, &copy, &key,
@@ -981,7 +981,7 @@ dp_netdev_port_input(struct dp_netdev *dp, struct dp_netdev_port *port,
if (packet->size < ETH_HEADER_LEN) {
return;
}
flow_extract(packet, 0, port->port_no, &key);
flow_extract(packet, 0, 0, port->port_no, &key);
flow = dp_netdev_lookup_flow(dp, &key);
if (flow) {
dp_netdev_flow_used(flow, &key, packet);
@@ -1239,6 +1239,8 @@ execute_set_action(struct ofpbuf *packet, const struct nlattr *a)
enum ovs_key_attr type = nl_attr_type(a);
switch (type) {
case OVS_KEY_ATTR_TUN_ID:
case OVS_KEY_ATTR_PRIORITY:
/* not implemented */
break;
case OVS_KEY_ATTR_ETHERNET:
@@ -1319,11 +1321,6 @@ dp_netdev_execute_actions(struct dp_netdev *dp,
dp_netdev_sample(dp, packet, key, a);
break;
case OVS_ACTION_ATTR_SET_PRIORITY:
case OVS_ACTION_ATTR_POP_PRIORITY:
/* not implemented */
break;
case OVS_ACTION_ATTR_UNSPEC:
case __OVS_ACTION_ATTR_MAX:
NOT_REACHED();