<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello David,</p>
    <p>It is not the correct way to activate / deactivate Link-Params.<br>
    </p>
    <p>I'm currently out of my office all this week. I'll look to the
      problem and try to reproduce it if I found an access to my lab and
      propose a patch. What is the deadline ? Is next Monday is
      acceptable for you ?</p>
    <p>Regards</p>
    <p>Olivier<br>
    </p>
    <br>
    <div class="moz-cite-prefix">Le 05/12/2016 à 16:16, David Lamparter
      a écrit :<br>
    </div>
    <blockquote cite="mid:20161205151634.GA896935@eidolon" type="cite">
      <pre wrap="">Applied this version of the patch.

Olivier - the previous and current situation was/is that doing "no
metric" makes the entire "link-params" block go away in show
running-config.  Is that intended?  Wouldn't it make more sense to
control the LP_TE flag by the "link-params" / "no link-params" statement
itself?

(If you want to change things around, please send a patch :)


-David

On Thu, Dec 01, 2016 at 10:49:22AM -0500, Donald Sharp wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">When link-params is configured it auto starts displaying
6000-02# conf t
dell-s6000-02(config)# int swp1
dell-s6000-02(config-if)# link-params
dell-s6000-02(config-link-params)# admin-grp 0x12345678
dell-s6000-02(config-link-params)# end
dell-s6000-02# show run

interface swp1
 link-params
  enable
  metric 0              <----Remove the bw lines
  max-bw 1.25e+06
  max-rsv-bw 1.25e+06
  unrsv-bw 0 1.25e+06
  unrsv-bw 1 1.25e+06
  unrsv-bw 2 1.25e+06
  unrsv-bw 3 1.25e+06
  unrsv-bw 4 1.25e+06
  unrsv-bw 5 1.25e+06
  unrsv-bw 6 1.25e+06
  unrsv-bw 7 1.25e+06
  admin-grp 305419896
  exit-link-params
!

I'd like to reduce this to:

interface enp0s3
 ip igmp
 ip pim sm
 link-params
  enable
  admin-grp 0x12345678    <----- Fix this to be what we entered
  exit-link-params
!

Signed-off-by: Donald Sharp <a class="moz-txt-link-rfc2396E" href="mailto:sharpd@cumulusnetworks.com"><sharpd@cumulusnetworks.com></a>
---
 lib/if.c          | 10 +++++-----
 lib/if.h          |  2 ++
 zebra/interface.c | 17 +++++++++--------
 3 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/lib/if.c b/lib/if.c
index 6ae8500..1987c05 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -1391,14 +1391,14 @@ if_link_params_get (struct interface *ifp)
   iflp->te_metric = ifp->metric;
 
   /* Compute default bandwidth based on interface */
-  int bw = (float)((ifp->bandwidth ? ifp->bandwidth : DEFAULT_BANDWIDTH)
-                   * TE_KILO_BIT / TE_BYTE);
+  iflp->default_bw = ((ifp->bandwidth ? ifp->bandwidth : DEFAULT_BANDWIDTH)
+                     * TE_KILO_BIT / TE_BYTE);
 
   /* Set Max, Reservable and Unreserved Bandwidth */
-  iflp->max_bw = bw;
-  iflp->max_rsv_bw = bw;
+  iflp->max_bw = iflp->default_bw;
+  iflp->max_rsv_bw = iflp->default_bw;
   for (i = 0; i < MAX_CLASS_TYPE; i++)
-    iflp->unrsv_bw[i] = bw;
+    iflp->unrsv_bw[i] = iflp->default_bw;
 
   /* Update Link parameters status */
   iflp->lp_status = LP_TE | LP_MAX_BW | LP_MAX_RSV_BW | LP_UNRSV_BW;
diff --git a/lib/if.h b/lib/if.h
index 57062cd..f41a064 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -161,6 +161,7 @@ struct if_stats
 #define LP_RES_BW               0x0400
 #define LP_AVA_BW               0x0800
 #define LP_USE_BW               0x1000
+#define LP_TE_METRIC            0x2000
 
 #define IS_PARAM_UNSET(lp, st) !(lp->lp_status & st)
 #define IS_PARAM_SET(lp, st) (lp->lp_status & st)
@@ -174,6 +175,7 @@ struct if_stats
 struct if_link_params {
   u_int32_t lp_status;   /* Status of Link Parameters: */
   u_int32_t te_metric;   /* Traffic Engineering metric */
+  float default_bw;
   float max_bw;          /* Maximum Bandwidth */
   float max_rsv_bw;      /* Maximum Reservable Bandwidth */
   float unrsv_bw[MAX_CLASS_TYPE];     /* Unreserved Bandwidth per Class Type (8) */
diff --git a/zebra/interface.c b/zebra/interface.c
index 6ffc0a6..f5eca4a 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1931,7 +1931,7 @@ DEFUN (link_params_metric,
   VTY_GET_ULONG("metric", metric, argv[0]);
 
   /* Update TE metric if needed */
-  link_param_cmd_set_uint32 (ifp, &iflp->te_metric, LP_TE, metric);
+  link_param_cmd_set_uint32 (ifp, &iflp->te_metric, LP_TE | LP_TE_METRIC, metric);
 
   return CMD_SUCCESS;
 }
@@ -1945,7 +1945,7 @@ DEFUN (no_link_params_metric,
   VTY_DECLVAR_CONTEXT (interface, ifp);
 
   /* Unset TE Metric */
-  link_param_cmd_unset(ifp, LP_TE);
+  link_param_cmd_unset(ifp, LP_TE | LP_TE_METRIC);
 
   return CMD_SUCCESS;
 }
@@ -2873,20 +2873,21 @@ link_params_config_write (struct vty *vty, struct interface *ifp)
 
   vty_out (vty, " link-params%s", VTY_NEWLINE);
   vty_out(vty, "  enable%s", VTY_NEWLINE);
-  if (IS_PARAM_SET(iflp, LP_TE))
+  if (IS_PARAM_SET(iflp, LP_TE) && IS_PARAM_SET(iflp, LP_TE_METRIC))
     vty_out(vty, "  metric %u%s",iflp->te_metric, VTY_NEWLINE);
-  if (IS_PARAM_SET(iflp, LP_MAX_BW))
+  if (IS_PARAM_SET(iflp, LP_MAX_BW) && iflp->max_bw != iflp->default_bw)
     vty_out(vty, "  max-bw %g%s", iflp->max_bw, VTY_NEWLINE);
-  if (IS_PARAM_SET(iflp, LP_MAX_RSV_BW))
+  if (IS_PARAM_SET(iflp, LP_MAX_RSV_BW) && iflp->max_rsv_bw != iflp->default_bw)
     vty_out(vty, "  max-rsv-bw %g%s", iflp->max_rsv_bw, VTY_NEWLINE);
   if (IS_PARAM_SET(iflp, LP_UNRSV_BW))
     {
       for (i = 0; i < 8; i++)
-        vty_out(vty, "  unrsv-bw %d %g%s",
-            i, iflp->unrsv_bw[i], VTY_NEWLINE);
+       if (iflp->unrsv_bw[i] != iflp->default_bw)
+         vty_out(vty, "  unrsv-bw %d %g%s",
+                 i, iflp->unrsv_bw[i], VTY_NEWLINE);
     }
   if (IS_PARAM_SET(iflp, LP_ADM_GRP))
-    vty_out(vty, "  admin-grp %u%s", iflp->admin_grp, VTY_NEWLINE);
+    vty_out(vty, "  admin-grp 0x%x%s", iflp->admin_grp, VTY_NEWLINE);
   if (IS_PARAM_SET(iflp, LP_DELAY))
     {
       vty_out(vty, "  delay %u", iflp->av_delay);
-- 
2.5.5


_______________________________________________
cmaster-next mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cmaster-next@lists.nox.tf">cmaster-next@lists.nox.tf</a>
<a class="moz-txt-link-freetext" href="https://lists.nox.tf/listinfo/cmaster-next">https://lists.nox.tf/listinfo/cmaster-next</a>
</pre>
      </blockquote>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <a style="text-decoration:none;" href="http://www.orange.com"> <img
          style="border:none" alt="logo Orange"
          src="cid:part1.9580B411.3C67893B@orange.com"> </a>
      <p style="line-height:20px;margin:0px"> </p>
      <span style="font-weight:bold;font-family:Arial,
        sans-serif;font-size:10pt;color:#000000;"> Olivier Dugeon </span>
      <br>
      <span style="font-family:Arial,
        sans-serif;font-size:10pt;color:#000000;"> Senior research
        engineer in QoS and network control<br>
        Open Source Referent</span> <br>
      <span style="font-family:Arial,
        sans-serif;font-size:10pt;color:#000000;">
        Orange/IMT/OLN/WTC/IEE/OPEN </span>
      <p style="line-height:20px;margin:0px"> </p>
      <span style="font-family:Arial,
        sans-serif;font-size:10pt;color:#000000"> fixe : +33 2 96 07 28
        80 </span> <br>
      <span style="font-family:Arial,
        sans-serif;font-size:10pt;color:#000000;text-decoration:none">
        mobile : +33 6 82 90 37 85 </span> <br>
      <span style="margin:0px 0 20px 0;"> <a style="margin:0px 0 20px
          0;font-family:Arial,
          sans-serif;font-size:10pt;color:#FF6600;text-decoration:none;"
          href="mailto:olivier.dugeon@orange.com">olivier.dugeon@orange.com</a>
      </span>
      <p style="line-height:20px;margin:0px"> </p>
    </div>
  </body>
</html>