Merge pull request #12730 from louis-6wind/fix-ext-te-metrics

Fix for Extended TE metrics
This commit is contained in:
Olivier Dugeon 2023-02-09 15:12:41 +01:00 committed by GitHub
commit ad1327b3d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -1541,7 +1541,7 @@ static void show_ext_sub(struct vty *vty, char *name,
sbuf_push(&buf, 4,
"%s Average Link Delay: %u (micro-sec)\n",
IS_ANORMAL(ext->delay) ? "Anomalous" : "Normal",
ext->delay);
ext->delay & TE_EXT_MASK);
if (IS_SUBTLV(ext, EXT_MM_DELAY)) {
sbuf_push(&buf, 4, "%s Min/Max Link Delay: %u / %u (micro-sec)\n",
IS_ANORMAL(ext->min_delay) ? "Anomalous" : "Normal",

View File

@ -401,7 +401,7 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
"%s Average Link Delay: %u (micro-sec)\n",
IS_ANORMAL(exts->delay) ? "Anomalous"
: "Normal",
exts->delay);
exts->delay & TE_EXT_MASK);
}
if (IS_SUBTLV(exts, EXT_MM_DELAY)) {
if (json) {

View File

@ -484,7 +484,7 @@ enum ext_subtlv_size {
* For Delay and packet Loss, upper bit (A) indicates if the value is
* normal (0) or anomalous (1).
*/
#define IS_ANORMAL(v) (v & 0x80000000)
#define IS_ANORMAL(v) (v & TE_EXT_ANORMAL)
struct isis_ext_subtlvs {

View File

@ -140,7 +140,7 @@ struct if_stats {
#endif /* HAVE_PROC_NET_DEV */
/* Here are "non-official" architectural constants. */
#define TE_EXT_MASK 0x0FFFFFFF
#define TE_EXT_MASK 0x00FFFFFF
#define TE_EXT_ANORMAL 0x80000000
#define LOSS_PRECISION 0.000003
/* TE_MEGA_BIT and TE_BYTE are utilized to convert TE bandwidth */