]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd/ospf6d/zebra: Change interface bandwidth range and auto-cost range to 100G
authorDon Slice <dslice@cumulusnetworks.com>
Mon, 13 Jun 2016 13:06:45 +0000 (09:06 -0400)
committerDon Slice <dslice@cumulusnetworks.com>
Mon, 13 Jun 2016 13:06:45 +0000 (09:06 -0400)
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
ospf6d/ospf6_interface.c
ospf6d/ospf6_interface.h
ospf6d/ospf6_top.c
ospfd/ospf_vty.c
zebra/interface.c

index 270031af6334e919120dfb0cd1416ee0b56cdec4..a1ff9c24a236c03f34ea33a208faf3c1bdce171d 100644 (file)
@@ -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
index 39942d7b1812733403a335fea420302cc92313e1..720a3e0e697d2a02fbdd9022843f25b9906bdf39 100644 (file)
@@ -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);
index 6ef9e37822b5657114883e2888c10ba09fc2146b..5e6b45568295d16a10de361548d91b99260fd6c9 100644 (file)
@@ -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
 
index b4e937a63aece1ae23539a4706ef15641ab65e92..7feced007ca99d1b54aab28f44538e09a4700f59 100644 (file)
@@ -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. */
index 03cde1c55d26d5620afa4f4445ffd371fef7d422..16fab68c99436731966898668819d11d58ce3a5d 100644 (file)
@@ -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. */
index cac3f2d69f18f23a79d96567a24ea83748033fe4..4a2adbf01dc999a782a655f48e6efa74ad768dc4 100644 (file)
@@ -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,