summaryrefslogtreecommitdiff
path: root/lib/odp-util.h
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@ovn.org>2017-07-05 15:17:52 -0700
committerJustin Pettit <jpettit@ovn.org>2018-01-10 16:42:00 -0800
commitd39ec23de38464ee35b3098b9f6c5f06d5191015 (patch)
tree2f9d5eb33373d01dcd6d8c84107a7a588bd9e8b9 /lib/odp-util.h
parentfcb9579be3c7717744e63a343a86a0dbcf0d3d78 (diff)
downloadopenvswitch-d39ec23de38464ee35b3098b9f6c5f06d5191015.tar.gz
ofproto-dpif: Don't slow-path controller actions.
Controller actions have become more commonly used for purposes other than just making forwarding decisions (e.g., packet logging). A packet that needs to be copied to the controller and forwarded would always be sent to ovs-vswitchd to be handled, which could negatively affect performance and cause heavier CPU utilization in ovs-vswitchd. This commit changes the behavior so that OpenFlow controller actions become userspace datapath actions while continuing to let packet forwarding and manipulation continue to be handled by the datapath directly. This patch still slow-paths controller actions with the "pause" flag set. A future patch will stop slow-pathing these pause actions as well. Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/odp-util.h')
-rw-r--r--lib/odp-util.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/odp-util.h b/lib/odp-util.h
index 2a4b3d138..981dcd8f2 100644
--- a/lib/odp-util.h
+++ b/lib/odp-util.h
@@ -42,9 +42,8 @@ struct pkt_metadata;
SPR(SLOW_BFD, "bfd", "Consists of BFD packets") \
SPR(SLOW_LACP, "lacp", "Consists of LACP packets") \
SPR(SLOW_STP, "stp", "Consists of STP packets") \
- SPR(SLOW_LLDP, "lldp", "Consists of LLDP packets") \
- SPR(SLOW_CONTROLLER, "controller", \
- "Sends \"packet-in\" messages to the OpenFlow controller") \
+ SPR(SLOW_LLDP, "lldp", "Consists of LLDP packets") \
+ SPR(SLOW_PAUSE, "pause", "Controller action with pause") \
SPR(SLOW_ACTION, "action", \
"Uses action(s) not supported by datapath")
@@ -298,6 +297,7 @@ enum user_action_cookie_type {
USER_ACTION_COOKIE_SLOW_PATH, /* Userspace must process this flow. */
USER_ACTION_COOKIE_FLOW_SAMPLE, /* Packet for per-flow sampling. */
USER_ACTION_COOKIE_IPFIX, /* Packet for per-bridge IPFIX sampling. */
+ USER_ACTION_COOKIE_CONTROLLER, /* Forward packet to controller. */
};
/* user_action_cookie is passed as argument to OVS_ACTION_ATTR_USERSPACE. */
@@ -333,6 +333,16 @@ struct user_action_cookie {
/* USER_ACTION_COOKIE_IPFIX. */
odp_port_t output_odp_port; /* The output odp port. */
} ipfix;
+
+ struct {
+ /* USER_ACTION_COOKIE_CONTROLLER. */
+ bool dont_send; /* Don't send the packet to controller. */
+ uint16_t reason;
+ uint32_t recirc_id;
+ ovs_32aligned_be64 rule_cookie;
+ uint16_t controller_id;
+ uint16_t max_len;
+ } controller;
};
};
BUILD_ASSERT_DECL(sizeof(struct user_action_cookie) == 48);