command can be used when the neighbor state get stuck at some state and
this can be used to recover it from that state.
+.. index:: maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM)
+.. clicmd:: maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM)
+
+.. index:: maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM)
+.. clicmd:: no maximum-paths
+
+ CLI to control maximum number of equal cost paths to reach a specific
+ destination.(ECMP)
+ Reset CLI, resets the maximum supported multi path to the default value.
+
.. _ospf-area:
Areas
thread_add_timer_msec(master, ospf_spf_calculate_schedule_worker, ospf,
delay, &ospf->t_spf_calc);
}
+
+/* Restart OSPF SPF algorithm*/
+void ospf_restart_spf(struct ospf *ospf)
+{
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug("%s: Restart SPF.", __PRETTY_FUNCTION__);
+
+ /* Handling inter area and intra area routes*/
+ if (ospf->new_table) {
+ ospf_route_delete(ospf, ospf->new_table);
+ ospf_route_table_free(ospf->new_table);
+ ospf->new_table = route_table_init();
+ }
+
+ /* Handling of TYPE-5 lsa(external routes) */
+ if (ospf->old_external_route) {
+ ospf_route_delete(ospf, ospf->old_external_route);
+ ospf_route_table_free(ospf->old_external_route);
+ ospf->old_external_route = route_table_init();
+ }
+
+ /* Trigger SPF */
+ ospf_spf_calculate_schedule(ospf, SPF_FLAG_CONFIG_CHANGE);
+}
return CMD_SUCCESS;
}
+static void ospf_maxpath_set(struct vty *vty, struct ospf *ospf, uint16_t paths)
+{
+ if (ospf->max_multipath == paths)
+ return;
+
+ ospf->max_multipath = paths;
+
+ /* Send deletion notification to zebra to delete all
+ * ospf specific routes and reinitiat SPF to reflect
+ * the new max multipath.
+ */
+ ospf_restart_spf(ospf);
+}
+
+/* Ospf Maximum multiple paths config support */
+DEFUN (ospf_max_multipath,
+ ospf_max_multipath_cmd,
+ "maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM),
+ "Max no of multiple paths for ECMP support\n"
+ "Number of paths\n")
+{
+ VTY_DECLVAR_INSTANCE_CONTEXT(ospf, ospf);
+ int idx_number = 1;
+ uint16_t maxpaths;
+
+ maxpaths = strtol(argv[idx_number]->arg, NULL, 10);
+
+ ospf_maxpath_set(vty, ospf, maxpaths);
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_ospf_max_multipath,
+ no_ospf_max_multipath_cmd,
+ "no maximum-paths",
+ NO_STR
+ "Max no of multiple paths for ECMP support\n")
+{
+ VTY_DECLVAR_INSTANCE_CONTEXT(ospf, ospf);
+ uint16_t maxpaths = MULTIPATH_NUM;
+
+ ospf_maxpath_set(vty, ospf, maxpaths);
+ return CMD_SUCCESS;
+}
+
static const char *const ospf_abr_type_descr_str[] = {
"Unknown", "Standard (RFC2328)", "Alternative IBM",
"Alternative Cisco", "Alternative Shortcut"
/* Show refresh parameters. */
vty_out(vty, " Refresh timer %d secs\n",
ospf->lsa_refresh_interval);
+
+ /* show max multipath */
+ vty_out(vty, " Maximum multiple paths(ECMP) supported %d\n",
+ ospf->max_multipath);
}
/* Show ABR/ASBR flags. */
vty_out(vty, " ospf write-multiplier %d\n",
ospf->write_oi_count);
+ if (ospf->max_multipath != MULTIPATH_NUM)
+ vty_out(vty, " maximum-paths %d\n", ospf->max_multipath);
+
/* Max-metric router-lsa print */
config_write_stub_router(vty, ospf);
install_element(OSPF_NODE, &ospf_ti_lfa_cmd);
install_element(OSPF_NODE, &no_ospf_ti_lfa_cmd);
+ /* Max path configurations */
+ install_element(OSPF_NODE, &ospf_max_multipath_cmd);
+ install_element(OSPF_NODE, &no_ospf_max_multipath_cmd);
+
/* Init interface related vty commands. */
ospf_vty_if_init();