[ovs-dev] [PATCHv3 1/2] xlate: auto ofproto trace when recursion too deep

Ben Pfaff blp at ovn.org
Tue Mar 6 00:20:17 UTC 2018


On Wed, Feb 28, 2018 at 04:32:27PM -0800, William Tu wrote:
> 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 at gmail.com>

Thank you!

I had to fold in the following because of recently added GCC warnings
that caused a diagnostic for 'rl' having the same name as a different
variable in an outer scope.  I also changed the burst size from 5 to 1
because I am super nervous about this change using a lot of space in
lots (after all, we *know* that this is going to produce at least 64
levels of output).

I applied this to master.  Thanks again!

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 9bba16873d2d..9d8818095add 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1168,10 +1168,10 @@ upcall_xlate(struct udpif *udpif, struct upcall *upcall,
      * these two error types. */
     if (xerr == XLATE_RECURSION_TOO_DEEP ||
         xerr == XLATE_TOO_MANY_RESUBMITS) {
-        static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
+        static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 1);
 
         /* This is a huge log, so be conservative. */
-        if (!VLOG_DROP_WARN(&rl)) {
+        if (!VLOG_DROP_WARN(&rll)) {
             ds_init(&output);
             ofproto_trace(upcall->ofproto, upcall->flow,
                           upcall->packet, NULL, 0, NULL, &output);


More information about the dev mailing list