summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-trace.h
diff options
context:
space:
mode:
authorYi-Hung Wei <yihung.wei@gmail.com>2017-06-27 11:11:33 -0700
committerBen Pfaff <blp@ovn.org>2017-07-12 15:46:21 -0700
commite6bc8e749381071341c5d16385641e968642c242 (patch)
treec533f3a60d8ad780020917e59a1fb2aeac471dfd /ofproto/ofproto-dpif-trace.h
parentef241d1e8675660b698839e624695da4ccf25e1b (diff)
downloadopenvswitch-e6bc8e749381071341c5d16385641e968642c242.tar.gz
ofproto/trace: Add support for tracing conntrack recirculation
Previously, a user need to run ofproto/trace multiple times to derive the final datapath actions if a flow hit conntrack actions that involves recirculation. To improve the usability of ofproto/trace, in this patch, we keep track of the conntrack actions, and automatically run the recirculation process so that a user only need to execute the ofproto/trace command once. Currently, this patch sets the default ct_state as trk and new in the automatic recirculation process. A following patch will provide an option to customize ct_state. Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto-dpif-trace.h')
-rw-r--r--ofproto/ofproto-dpif-trace.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif-trace.h b/ofproto/ofproto-dpif-trace.h
index e3d3b393c..4c120a54d 100644
--- a/ofproto/ofproto-dpif-trace.h
+++ b/ofproto/ofproto-dpif-trace.h
@@ -30,6 +30,7 @@
#include "openvswitch/compiler.h"
#include "openvswitch/list.h"
+#include "flow.h"
/* Type of a node within a trace. */
enum oftrace_node_type {
@@ -45,6 +46,13 @@ enum oftrace_node_type {
OFT_ERROR, /* An erroneous situation, worth logging. */
};
+/* Reason why a flow is in a recirculation queue. */
+enum oftrace_recirc_type {
+ OFT_RECIRC_CONNTRACK,
+ OFT_RECIRC_MPLS,
+ OFT_RECIRC_BOND,
+};
+
/* A node within a trace. */
struct oftrace_node {
struct ovs_list node; /* In parent. */
@@ -54,9 +62,22 @@ struct oftrace_node {
char *text;
};
+/* A node within a recirculation queue. */
+struct oftrace_recirc_node {
+ struct ovs_list node; /* In recirc_queue. */
+
+ enum oftrace_recirc_type type;
+ uint32_t recirc_id;
+ struct flow flow;
+ struct dp_packet *packet;
+};
+
void ofproto_dpif_trace_init(void);
struct oftrace_node *oftrace_report(struct ovs_list *, enum oftrace_node_type,
const char *text);
+bool oftrace_add_recirc_node(struct ovs_list *recirc_queue,
+ enum oftrace_recirc_type, const struct flow *,
+ const struct dp_packet *, uint32_t recirc_id);
#endif /* ofproto-dpif-trace.h */