summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWilliam Tu <u9012063@gmail.com>2018-02-28 16:32:27 -0800
committerBen Pfaff <blp@ovn.org>2018-03-05 16:16:12 -0800
commitd1ea2cc3de99f0695ca89b2bebe49452b2a1db07 (patch)
tree92d60c81cf185dffca7f11ecc4801bd25b547696 /tests
parent2a72edbb0af95fdd8c45266fdfa5f38c7dd346ff (diff)
downloadopenvswitch-d1ea2cc3de99f0695ca89b2bebe49452b2a1db07.tar.gz
xlate: auto ofproto trace when recursion too deep
Usually ofproto/trace is used to debug the flow translation error. When translation error such as recursion too deep or too many resubmit, the issue might happen momentary; flows causing the recursion expire when users try to debug it. This patch enables the ofproto trace automatically when recursion is too deep or too many resubmit, by invoking the translation again, and log the ofproto trace as warnings. Since the log will be huge, rate limit to one per minute. VMWare-BZ: #2054659 Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/ofproto-dpif.at25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 600afdda8..fd78c5d9b 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -8473,6 +8473,31 @@ AT_CHECK([grep -c 'over max translation depth 64' stdout],
OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
AT_CLEANUP
+dnl Without using ofproto/trace, make sure the
+dnl ofproto trace is still logged
+AT_SETUP([ofproto-dpif - backward resubmit without trace])
+OVS_VSWITCHD_START
+(echo "table=0, actions=resubmit(,66)"
+ for i in `seq 2 66`; do
+ j=`expr $i - 1`
+ echo "table=$i, actions=resubmit(,$j)"
+ done
+ echo "table=1, actions=local") > flows
+AT_CHECK([ovs-ofctl add-flows br0 flows])
+
+AT_CHECK([ovs-appctl netdev-dummy/receive br0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'], [0], [stdout])
+
+OVS_WAIT_UNTIL([grep 'over max translation' ovs-vswitchd.log])
+
+dnl make sure the full ofproto trace dump is present
+AT_CHECK([grep -c "^ *resubmit" ovs-vswitchd.log],
+ [0], [66
+])
+
+OVS_VSWITCHD_STOP(["/over max translation depth/d
+/ofproto_dpif_upcall/d"])
+AT_CLEANUP
+
AT_SETUP([ofproto-dpif - exponential resubmit chain])
OVS_VSWITCHD_START
add_of_ports br0 1