]> git.proxmox.com Git - mirror_frr.git/commitdiff
bfdd: echo-mode doesn't need poll to start/stop
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Wed, 30 Jan 2019 17:49:11 +0000 (15:49 -0200)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Thu, 14 Feb 2019 16:17:29 +0000 (14:17 -0200)
Remove all polling negotiation when starting/stopping `echo-mode` as it
is not necessary.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
bfdd/bfd.c
bfdd/bfd.h
bfdd/bfdd_vty.c

index 18c56196e8a8fea29306757cf72f708313ae1d4c..4662d16976c0eb38aa736104aaf9d2e6fff24c65 100644 (file)
@@ -137,7 +137,7 @@ void ptm_bfd_xmt_TO(struct bfd_session *bfd, int fbit)
        ptm_bfd_start_xmt_timer(bfd, false);
 }
 
-void ptm_bfd_echo_stop(struct bfd_session *bfd, int polling)
+void ptm_bfd_echo_stop(struct bfd_session *bfd)
 {
        bfd->echo_xmt_TO = 0;
        bfd->echo_detect_TO = 0;
@@ -145,13 +145,6 @@ void ptm_bfd_echo_stop(struct bfd_session *bfd, int polling)
 
        bfd_echo_xmttimer_delete(bfd);
        bfd_echo_recvtimer_delete(bfd);
-
-       if (polling) {
-               bfd->polling = polling;
-               bfd->new_timers.desired_min_tx = bfd->up_min_tx;
-               bfd->new_timers.required_min_rx = bfd->timers.required_min_rx;
-               ptm_bfd_snd(bfd, 0);
-       }
 }
 
 void ptm_bfd_echo_start(struct bfd_session *bfd)
@@ -159,11 +152,6 @@ void ptm_bfd_echo_start(struct bfd_session *bfd)
        bfd->echo_detect_TO = (bfd->remote_detect_mult * bfd->echo_xmt_TO);
        if (bfd->echo_detect_TO > 0)
                ptm_bfd_echo_xmt_TO(bfd);
-
-       bfd->polling = 1;
-       bfd->new_timers.desired_min_tx = bfd->up_min_tx;
-       bfd->new_timers.required_min_rx = bfd->timers.required_min_rx;
-       ptm_bfd_snd(bfd, 0);
 }
 
 void ptm_bfd_ses_up(struct bfd_session *bfd)
@@ -209,7 +197,7 @@ void ptm_bfd_ses_dn(struct bfd_session *bfd, uint8_t diag)
 
        /* Stop echo packet transmission if they are active */
        if (BFD_CHECK_FLAG(bfd->flags, BFD_SESS_FLAG_ECHO_ACTIVE))
-               ptm_bfd_echo_stop(bfd, 0);
+               ptm_bfd_echo_stop(bfd);
 
        if (old_state != bfd->ses_state) {
                bfd->stats.session_down++;
@@ -440,7 +428,7 @@ static void _bfd_session_update(struct bfd_session *bs,
                        goto skip_echo;
 
                BFD_UNSET_FLAG(bs->flags, BFD_SESS_FLAG_ECHO);
-               ptm_bfd_echo_stop(bs, 0);
+               ptm_bfd_echo_stop(bs);
        }
 
 skip_echo:
@@ -845,7 +833,7 @@ void bs_echo_timer_handler(struct bfd_session *bs)
        /* Remote peer asked to stop echo. */
        if (bs->remote_timers.required_min_echo == 0) {
                if (BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO_ACTIVE))
-                       ptm_bfd_echo_stop(bs, 0);
+                       ptm_bfd_echo_stop(bs);
 
                return;
        }
index 098db11f26ecc89f644066e6d828a5ff35b389f5..66af6c79d81c1b7de10f1b2d73588f292f5e2b64 100644 (file)
@@ -513,7 +513,7 @@ struct bfd_session *ptm_bfd_sess_new(struct bfd_peer_cfg *bpc);
 int ptm_bfd_ses_del(struct bfd_peer_cfg *bpc);
 void ptm_bfd_ses_dn(struct bfd_session *bfd, uint8_t diag);
 void ptm_bfd_ses_up(struct bfd_session *bfd);
-void ptm_bfd_echo_stop(struct bfd_session *bfd, int polling);
+void ptm_bfd_echo_stop(struct bfd_session *bfd);
 void ptm_bfd_echo_start(struct bfd_session *bfd);
 void ptm_bfd_xmt_TO(struct bfd_session *bfd, int fbit);
 void ptm_bfd_start_xmt_timer(struct bfd_session *bfd, bool is_echo);
index 3476e16210b8534f73544d03bad62ef5b820f5ac..032bccaf1bb214f7ed241227e66ddef84becae08 100644 (file)
@@ -283,7 +283,7 @@ DEFPY(bfd_peer_echo, bfd_peer_echo_cmd, "[no] echo-mode",
                        return CMD_SUCCESS;
 
                BFD_UNSET_FLAG(bs->flags, BFD_SESS_FLAG_ECHO);
-               ptm_bfd_echo_stop(bs, 0);
+               ptm_bfd_echo_stop(bs);
        } else {
                if (BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO))
                        return CMD_SUCCESS;