bs->timers.required_min_rx / 1000);
vty_out(vty, "\t\t\tTransmission interval: %ums\n",
bs->timers.desired_min_tx / 1000);
- vty_out(vty, "\t\t\tEcho transmission interval: %ums\n",
- bs->timers.required_min_echo / 1000);
+ if (bs->timers.required_min_echo_rx != 0)
+ vty_out(vty, "\t\t\tEcho receive interval: %ums\n",
+ bs->timers.required_min_echo_rx / 1000);
+ else
+ vty_out(vty, "\t\t\tEcho receive interval: disabled\n");
+ if (CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO))
+ vty_out(vty, "\t\t\tEcho transmission interval: %ums\n",
+ bs->timers.desired_min_echo_tx / 1000);
+ else
+ vty_out(vty, "\t\t\tEcho transmission interval: disabled\n");
vty_out(vty, "\t\tRemote timers:\n");
vty_out(vty, "\t\t\tDetect-multiplier: %u\n",
bs->remote_timers.required_min_rx / 1000);
vty_out(vty, "\t\t\tTransmission interval: %ums\n",
bs->remote_timers.desired_min_tx / 1000);
- vty_out(vty, "\t\t\tEcho transmission interval: %ums\n",
- bs->remote_timers.required_min_echo / 1000);
+ if (bs->remote_timers.required_min_echo != 0)
+ vty_out(vty, "\t\t\tEcho receive interval: %ums\n",
+ bs->remote_timers.required_min_echo / 1000);
+ else
+ vty_out(vty, "\t\t\tEcho receive interval: disabled\n");
vty_out(vty, "\n");
}
bs->timers.required_min_rx / 1000);
json_object_int_add(jo, "transmit-interval",
bs->timers.desired_min_tx / 1000);
+ json_object_int_add(jo, "echo-receive-interval",
+ bs->timers.required_min_echo_rx / 1000);
if (CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO))
- json_object_int_add(jo, "echo-interval",
- bs->timers.required_min_echo / 1000);
+ json_object_int_add(jo, "echo-transmit-interval",
+ bs->timers.desired_min_echo_tx / 1000);
else
- json_object_int_add(jo, "echo-interval", 0);
+ json_object_int_add(jo, "echo-transmit-interval", 0);
json_object_int_add(jo, "detect-multiplier", bs->detect_mult);
bs->remote_timers.required_min_rx / 1000);
json_object_int_add(jo, "remote-transmit-interval",
bs->remote_timers.desired_min_tx / 1000);
- json_object_int_add(jo, "remote-echo-interval",
+ json_object_int_add(jo, "remote-echo-receive-interval",
bs->remote_timers.required_min_echo / 1000);
json_object_int_add(jo, "remote-detect-multiplier",
bs->remote_detect_mult);
{
_display_peer_header(vty, bs);
+ /* Ask data plane for updated counters. */
+ if (bfd_dplane_update_session_counters(bs) == -1)
+ zlog_debug("%s: failed to update BFD session counters (%s)",
+ __func__, bs_to_string(bs));
+
vty_out(vty, "\t\tControl packet input: %" PRIu64 " packets\n",
bs->stats.rx_ctrl_pkt);
vty_out(vty, "\t\tControl packet output: %" PRIu64 " packets\n",
{
struct json_object *jo = _peer_json_header(bs);
+ /* Ask data plane for updated counters. */
+ if (bfd_dplane_update_session_counters(bs) == -1)
+ zlog_debug("%s: failed to update BFD session counters (%s)",
+ __func__, bs_to_string(bs));
+
json_object_int_add(jo, "control-packet-input", bs->stats.rx_ctrl_pkt);
json_object_int_add(jo, "control-packet-output", bs->stats.tx_ctrl_pkt);
json_object_int_add(jo, "echo-packet-input", bs->stats.rx_echo_pkt);
jo = json_object_new_array();
bvt.jo = jo;
- bfd_id_iterate(_display_peer_counter_json_iter, jo);
+ bfd_id_iterate(_display_peer_counter_json_iter, &bvt);
vty_out(vty, "%s\n", json_object_to_json_string_ext(jo, 0));
json_object_free(jo);
return CMD_SUCCESS;
}
+DEFPY(show_bfd_distributed, show_bfd_distributed_cmd,
+ "show bfd distributed",
+ SHOW_STR
+ "Bidirection Forwarding Detection\n"
+ "Show BFD data plane (distributed BFD) statistics\n")
+{
+ bfd_dplane_show_counters(vty);
+ return CMD_SUCCESS;
+}
+
+DEFPY(
+ bfd_debug_distributed, bfd_debug_distributed_cmd,
+ "[no] debug bfd distributed",
+ NO_STR
+ DEBUG_STR
+ "Bidirection Forwarding Detection\n"
+ "BFD data plane (distributed BFD) debugging\n")
+{
+ bglobal.debug_dplane = !no;
+ return CMD_SUCCESS;
+}
+
DEFPY(
bfd_debug_peer, bfd_debug_peer_cmd,
"[no] debug bfd peer",
memset(bpc, 0, sizeof(*bpc));
/* Defaults */
- bpc->bpc_shutdown = true;
+ bpc->bpc_shutdown = false;
bpc->bpc_detectmultiplier = BPC_DEF_DETECTMULTIPLIER;
bpc->bpc_recvinterval = BPC_DEF_RECEIVEINTERVAL;
bpc->bpc_txinterval = BPC_DEF_TRANSMITINTERVAL;
- bpc->bpc_echointerval = BPC_DEF_ECHOINTERVAL;
+ bpc->bpc_echorecvinterval = BPC_DEF_ECHORECEIVEINTERVAL;
+ bpc->bpc_echotxinterval = BPC_DEF_ECHOTRANSMITINTERVAL;
bpc->bpc_lastevent = monotime(NULL);
/* Safety check: when no error buf is provided len must be zero. */
"BFD daemon\n")
{
vty_out(vty, "BFD debugging status:\n");
+ if (bglobal.debug_dplane)
+ vty_out(vty, " Distributed BFD debugging is on.\n");
if (bglobal.debug_peer_event)
vty_out(vty, " Peer events debugging is on.\n");
if (bglobal.debug_zebra)
struct lyd_node *dnode;
int written = 0;
+ if (bglobal.debug_dplane) {
+ vty_out(vty, "debug bfd distributed\n");
+ written = 1;
+ }
+
if (bglobal.debug_peer_event) {
vty_out(vty, "debug bfd peer\n");
written = 1;
install_element(ENABLE_NODE, &bfd_show_peers_cmd);
install_element(ENABLE_NODE, &bfd_show_peer_cmd);
install_element(ENABLE_NODE, &bfd_show_peers_brief_cmd);
+ install_element(ENABLE_NODE, &show_bfd_distributed_cmd);
install_element(ENABLE_NODE, &show_debugging_bfd_cmd);
+ install_element(ENABLE_NODE, &bfd_debug_distributed_cmd);
install_element(ENABLE_NODE, &bfd_debug_peer_cmd);
install_element(ENABLE_NODE, &bfd_debug_zebra_cmd);
install_element(ENABLE_NODE, &bfd_debug_network_cmd);
+ install_element(CONFIG_NODE, &bfd_debug_distributed_cmd);
install_element(CONFIG_NODE, &bfd_debug_peer_cmd);
install_element(CONFIG_NODE, &bfd_debug_zebra_cmd);
install_element(CONFIG_NODE, &bfd_debug_network_cmd);