From 70bd3c4369b1b77f680f5a308e73a6663056af2d Mon Sep 17 00:00:00 2001 From: Don Slice Date: Mon, 13 Jun 2016 09:06:45 -0400 Subject: [PATCH] ospfd/ospf6d/zebra: Change interface bandwidth range and auto-cost range to 100G Prior to this change, interface bandwidth could not be defined above 10G. With the use of higher speed interfaces, the ability to effectively define the path links was highly impacted. Additionally, the default auto-cost reference-bandwidth for ospf and ospfv3 was set to 100M, which relects a much earlier time. Changed both the range of interface bandwidth definitions and reference bandwidths to be up to 100G. Set the default interface bandwidth (if not defined) to 10G to make the ratio continue to cause a cost of 10 as before. Manual testing as well as ospf-min and ospf-smoke passed successfully. Ticket: CM-10756 Signed-of-by: Don Slice Reviewed-by: Donald Sharp --- lib/libospf.h | 4 ++-- ospf6d/ospf6_interface.c | 4 ++-- ospf6d/ospf6_interface.h | 4 ++-- ospf6d/ospf6_top.c | 2 +- ospfd/ospf_vty.c | 10 +++++----- zebra/interface.c | 16 ++++++++-------- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/libospf.h b/lib/libospf.h index 270031af63..a1ff9c24a2 100644 --- a/lib/libospf.h +++ b/lib/libospf.h @@ -69,9 +69,9 @@ #define OSPF_ROUTER_PRIORITY_DEFAULT 1 #define OSPF_RETRANSMIT_INTERVAL_DEFAULT 5 #define OSPF_TRANSMIT_DELAY_DEFAULT 1 -#define OSPF_DEFAULT_BANDWIDTH 10000 /* Kbps */ +#define OSPF_DEFAULT_BANDWIDTH 10000 /* Mbps */ -#define OSPF_DEFAULT_REF_BANDWIDTH 100000 /* Kbps */ +#define OSPF_DEFAULT_REF_BANDWIDTH 100000 /* Mbps */ #define OSPF_POLL_INTERVAL_DEFAULT 60 #define OSPF_NEIGHBOR_PRIORITY_DEFAULT 0 diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 39942d7b18..720a3e0e69 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -1339,10 +1339,10 @@ DEFUN (auto_cost_reference_bandwidth, } /* If reference bandwidth is changed. */ - if ((refbw * 1000) == o->ref_bandwidth) + if ((refbw) == o->ref_bandwidth) return CMD_SUCCESS; - o->ref_bandwidth = refbw * 1000; + o->ref_bandwidth = refbw; for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) ospf6_interface_recalculate_cost (oi); diff --git a/ospf6d/ospf6_interface.h b/ospf6d/ospf6_interface.h index 6ef9e37822..5e6b455682 100644 --- a/ospf6d/ospf6_interface.h +++ b/ospf6d/ospf6_interface.h @@ -144,8 +144,8 @@ extern const char *ospf6_interface_state_str[]; #define OSPF6_INTERFACE_PRIORITY 1 #define OSPF6_INTERFACE_TRANSDELAY 1 #define OSPF6_INTERFACE_INSTANCE_ID 0 -#define OSPF6_INTERFACE_BANDWIDTH 10000 /* Kbps */ -#define OSPF6_REFERENCE_BANDWIDTH 100000 /* Kbps */ +#define OSPF6_INTERFACE_BANDWIDTH 10000 /* Mbps */ +#define OSPF6_REFERENCE_BANDWIDTH 100000 /* Mbps */ #define OSPF6_INTERFACE_SSO_RETRY_INT 1 #define OSPF6_INTERFACE_SSO_RETRY_MAX 5 diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index b4e937a63a..7feced007c 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -964,7 +964,7 @@ config_write_ospf6 (struct vty *vty) } if (ospf6->ref_bandwidth != OSPF6_REFERENCE_BANDWIDTH) - vty_out (vty, " auto-cost reference-bandwidth %d%s", ospf6->ref_bandwidth / 1000, + vty_out (vty, " auto-cost reference-bandwidth %d%s", ospf6->ref_bandwidth, VNL); /* LSA timers print. */ diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 03cde1c55d..16fab68c99 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -2912,10 +2912,10 @@ DEFUN (ospf_auto_cost_reference_bandwidth, } /* If reference bandwidth is changed. */ - if ((refbw * 1000) == ospf->ref_bandwidth) + if ((refbw) == ospf->ref_bandwidth) return CMD_SUCCESS; - ospf->ref_bandwidth = refbw * 1000; + ospf->ref_bandwidth = refbw; for (ALL_LIST_ELEMENTS_RO (om->iflist, node, ifp)) ospf_if_recalculate_output_cost (ifp); @@ -3646,14 +3646,14 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface json_object_int_add(json_interface_sub, "ifIndex", ifp->ifindex); json_object_int_add(json_interface_sub, "mtuBytes", ifp->mtu); - json_object_int_add(json_interface_sub, "bandwidthKbit", ifp->bandwidth); + json_object_int_add(json_interface_sub, "bandwidthMbit", ifp->bandwidth); json_object_string_add(json_interface_sub, "ifFlags", if_flag_dump(ifp->flags)); } else { vty_out (vty, "%s is %s%s", ifp->name, ((is_up = if_is_operative(ifp)) ? "up" : "down"), VTY_NEWLINE); - vty_out (vty, " ifindex %u, MTU %u bytes, BW %u Kbit %s%s", + vty_out (vty, " ifindex %u, MTU %u bytes, BW %u Mbit %s%s", ifp->ifindex, ifp->mtu, ifp->bandwidth, if_flag_dump(ifp->flags), VTY_NEWLINE); } @@ -9899,7 +9899,7 @@ ospf_config_write (struct vty *vty) vty_out (vty, "! Important: ensure reference bandwidth " "is consistent across all routers%s", VTY_NEWLINE); vty_out (vty, " auto-cost reference-bandwidth %d%s", - ospf->ref_bandwidth / 1000, VTY_NEWLINE); + ospf->ref_bandwidth, VTY_NEWLINE); } /* SPF timers print. */ diff --git a/zebra/interface.c b/zebra/interface.c index cac3f2d69f..4a2adbf01d 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1070,10 +1070,10 @@ if_dump_vty (struct vty *vty, struct interface *ifp) } #endif /* HAVE_STRUCT_SOCKADDR_DL */ - /* Bandwidth in kbps */ + /* Bandwidth in Mbps */ if (ifp->bandwidth != 0) { - vty_out(vty, " bandwidth %u kbps", ifp->bandwidth); + vty_out(vty, " bandwidth %u Mbps", ifp->bandwidth); vty_out(vty, "%s", VTY_NEWLINE); } @@ -1645,9 +1645,9 @@ DEFUN (no_shutdown_if, DEFUN (bandwidth_if, bandwidth_if_cmd, - "bandwidth <1-10000000>", + "bandwidth <1-100000>", "Set bandwidth informational parameter\n" - "Bandwidth in kilobits\n") + "Bandwidth in megabits\n") { struct interface *ifp; unsigned int bandwidth; @@ -1655,8 +1655,8 @@ DEFUN (bandwidth_if, ifp = (struct interface *) vty->index; bandwidth = strtol(argv[0], NULL, 10); - /* bandwidth range is <1-10000000> */ - if (bandwidth < 1 || bandwidth > 10000000) + /* bandwidth range is <1-100000> */ + if (bandwidth < 1 || bandwidth > 100000) { vty_out (vty, "Bandwidth is invalid%s", VTY_NEWLINE); return CMD_WARNING; @@ -1692,10 +1692,10 @@ DEFUN (no_bandwidth_if, ALIAS (no_bandwidth_if, no_bandwidth_if_val_cmd, - "no bandwidth <1-10000000>", + "no bandwidth <1-100000>", NO_STR "Set bandwidth informational parameter\n" - "Bandwidth in kilobits\n") + "Bandwidth in megabits\n") static int ip_address_install (struct vty *vty, struct interface *ifp, -- 2.39.5