diff mbox

[ovs-dev] Fwd: [PATCH] bfd: Fix signs in ovs-appctl bfd/show Detect Time, Next Tx Time, Last TX Time

Message ID f8083fae-1c83-056c-f3f9-8e510266193b@ericsson.com
State Accepted
Headers show

Commit Message

Gabor Szucs May 18, 2017, 1:39 p.m. UTC
Hi,
This is a fix for ovs-appctl bfd/show printout that looks partly incorrect.

ovs-appctl bfd/show command printout
shows negative time lag from now for upcoming events:
         Detect Time: now -2632ms
         Next TX Time: now -800ms
and positive time lag from now for past event:
         Last TX Time: now +150ms

The fix negates the signs.

Signed-off-by: Gábor Szűcs <gabor.sz.cs@ericsson.com>
Co-authored-by: Csaba Ihllye <csaba.ihllye@ericsson.com>
Signed-off-by: Csaba Ihllye <csaba.ihllye@ericsson.com>
---

Comments

Andy Zhou May 18, 2017, 11:11 p.m. UTC | #1
On Thu, May 18, 2017 at 6:39 AM, Gabor Szucs <gabor.sz.cs@ericsson.com> wrote:
> Hi,
> This is a fix for ovs-appctl bfd/show printout that looks partly incorrect.
>
> ovs-appctl bfd/show command printout
> shows negative time lag from now for upcoming events:
>         Detect Time: now -2632ms
>         Next TX Time: now -800ms
> and positive time lag from now for past event:
>         Last TX Time: now +150ms
>
> The fix negates the signs.
>
> Signed-off-by: Gábor Szűcs <gabor.sz.cs@ericsson.com>
> Co-authored-by: Csaba Ihllye <csaba.ihllye@ericsson.com>
> Signed-off-by: Csaba Ihllye <csaba.ihllye@ericsson.com>

Thanks for sending the patch. Pushed to master.

The patch itself seems to be corrupted, may be it was sent with git send-email?
Since it is simple enough I just fixed it up locally before pushing.
diff mbox

Patch

diff --git a/lib/bfd.c b/lib/bfd.c
index 1fb1cfb..9e79f12 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -1239,11 +1239,11 @@  bfd_put_details(struct ds *ds, const struct bfd *bfd) OVS_REQUIRES(mutex)
      ds_put_format(ds, "\tTX Interval: Approx %lldms\n", bfd_tx_interval(bfd));
      ds_put_format(ds, "\tRX Interval: Approx %lldms\n", bfd_rx_interval(bfd));
      ds_put_format(ds, "\tDetect Time: now %+lldms\n",
-                  time_msec() - bfd->detect_time);
+                  bfd->detect_time - time_msec());
      ds_put_format(ds, "\tNext TX Time: now %+lldms\n",
-                  time_msec() - bfd->next_tx);
+                  bfd->next_tx - time_msec());
      ds_put_format(ds, "\tLast TX Time: now %+lldms\n",
-                  time_msec() - bfd->last_tx);
+                  bfd->last_tx - time_msec());

      ds_put_cstr(ds, "\n");