aboutsummaryrefslogtreecommitdiff
path: root/lib/odp-execute.c
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2013-06-05 14:28:49 +0900
committerBen Pfaff <blp@nicira.com>2013-06-05 14:28:57 -0700
commit6c13071b37b1b4b8115d0b0fbe2058f8f76e016d (patch)
tree9fe2ccbc7e6ff004cbdda83baf4e082fb69681ca /lib/odp-execute.c
parent617e10e71ca1719a8f0070354489858e3cceba32 (diff)
odp-execute: Add set skb_mark, set_priority, tunnel support.
The motivation for this is to allow such actions to be honoured if they are encountered; by the user-space datapath before recirculation; or by internal processing of actions by ovs-vswitchd before recirculation. Recirculation will be added by a subsequent patch. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/odp-execute.c')
-rw-r--r--lib/odp-execute.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/odp-execute.c b/lib/odp-execute.c
index b4a99a60..42ab4b3b 100644
--- a/lib/odp-execute.c
+++ b/lib/odp-execute.c
@@ -23,6 +23,7 @@
#include "netlink.h"
#include "ofpbuf.h"
+#include "odp-util.h"
#include "packets.h"
#include "util.h"
@@ -36,7 +37,17 @@ odp_eth_set_addrs(struct ofpbuf *packet, const struct ovs_key_ethernet *eth_key)
}
static void
-odp_execute_set_action(struct ofpbuf *packet, const struct nlattr *a)
+odp_set_tunnel_action(const struct nlattr *a, struct flow_tnl *tun_key)
+{
+ enum odp_key_fitness fitness;
+
+ fitness = odp_tun_key_from_attr(a, tun_key);
+ ovs_assert(fitness != ODP_FIT_ERROR);
+}
+
+static void
+odp_execute_set_action(struct ofpbuf *packet, const struct nlattr *a,
+ struct flow *flow)
{
enum ovs_key_attr type = nl_attr_type(a);
const struct ovs_key_ipv4 *ipv4_key;
@@ -46,9 +57,15 @@ odp_execute_set_action(struct ofpbuf *packet, const struct nlattr *a)
switch (type) {
case OVS_KEY_ATTR_PRIORITY:
+ flow->skb_priority = nl_attr_get_u32(a);
+ break;
+
case OVS_KEY_ATTR_TUNNEL:
+ odp_set_tunnel_action(a, &flow->tunnel);
+ break;
+
case OVS_KEY_ATTR_SKB_MARK:
- /* not implemented */
+ flow->skb_mark = nl_attr_get_u32(a);
break;
case OVS_KEY_ATTR_ETHERNET:
@@ -185,7 +202,7 @@ odp_execute_actions(void *dp, struct ofpbuf *packet, struct flow *key,
break;
case OVS_ACTION_ATTR_SET:
- odp_execute_set_action(packet, nl_attr_get(a));
+ odp_execute_set_action(packet, nl_attr_get(a), key);
break;
case OVS_ACTION_ATTR_SAMPLE: