diff options
| author | Hiroki Shirokura <hiroki.shirokura@linecorp.com> | 2021-12-11 03:01:07 +0000 |
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2023-04-17 11:06:08 +0200 |
| commit | 7f8dddf4300911a8d125d53f87eb64598e2bbcf8 (patch) | |
| tree | 02a33cab9c6fad29233bdebf4eb3dfbe06785025 | |
| parent | 1f0d13e92225aaeddd72352d57f1dc26c54f6b53 (diff) | |
isisd: update struct isis_sr_psid_info with algorithm id
The information in prefix-sid has a new property
called algorithm id. This is used to identify
the algorithm that separates it in the same IGP
network. This is used in Flex-Algo.In all other
cases, the algorithm id is basically 0.
Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Eric Kinzie <ekinzie@labn.net>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
| -rw-r--r-- | isisd/isis_route.c | 3 | ||||
| -rw-r--r-- | isisd/isis_spf.c | 10 | ||||
| -rw-r--r-- | isisd/isis_sr.h | 2 | ||||
| -rw-r--r-- | isisd/isis_zebra.c | 8 |
4 files changed, 16 insertions, 7 deletions
diff --git a/isisd/isis_route.c b/isisd/isis_route.c index 3b653194bf..9a12df2fae 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -273,6 +273,9 @@ static bool isis_sr_psid_info_same(struct isis_sr_psid_info *new, || new->sid.value != old->sid.value) return false; + if (new->sid.algorithm != old->sid.algorithm) + return false; + return true; } diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 407a58b76e..4a9f0ed0cd 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -585,6 +585,8 @@ isis_spf_add2tent(struct isis_spftree *spftree, enum vertextype vtype, void *id, vertex->N.ip.sr.sid = *psid; vertex->N.ip.sr.label = sr_prefix_in_label(area, psid, local); + vertex->N.ip.sr.algorithm = psid->algorithm; + if (vertex->N.ip.sr.label != MPLS_INVALID_LABEL) vertex->N.ip.sr.present = true; @@ -965,7 +967,8 @@ lspfragloop: struct isis_prefix_sid *psid = (struct isis_prefix_sid *)i; - if (psid->algorithm != SR_ALGORITHM_SPF) + if (psid->algorithm != + spftree->algorithm) continue; has_valid_psid = true; @@ -1033,7 +1036,8 @@ lspfragloop: struct isis_prefix_sid *psid = (struct isis_prefix_sid *)i; - if (psid->algorithm != SR_ALGORITHM_SPF) + if (psid->algorithm != + spftree->algorithm) continue; has_valid_psid = true; @@ -1157,7 +1161,7 @@ static int isis_spf_preload_tent_ip_reach_cb(const struct prefix *prefix, struct isis_prefix_sid *psid = (struct isis_prefix_sid *)i; - if (psid->algorithm != SR_ALGORITHM_SPF) + if (psid->algorithm != spftree->algorithm) continue; has_valid_psid = true; diff --git a/isisd/isis_sr.h b/isisd/isis_sr.h index ae15025c21..7c02224011 100644 --- a/isisd/isis_sr.h +++ b/isisd/isis_sr.h @@ -61,6 +61,8 @@ struct isis_sr_psid_info { /* Indicates whether the Prefix-SID is present or not. */ bool present; + + uint8_t algorithm; }; /* Segment Routing Local Block allocation */ diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 8cd8f57c47..c1f02361bd 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -333,8 +333,8 @@ void isis_zebra_prefix_sid_install(struct isis_area *area, struct zapi_labels zl; int count = 0; - sr_debug("ISIS-Sr (%s): update label %u for prefix %pFX", - area->area_tag, psid->label, prefix); + sr_debug("ISIS-Sr (%s): update label %u for prefix %pFX algorithm %u", + area->area_tag, psid->label, prefix, psid->algorithm); /* Prepare message. */ memset(&zl, 0, sizeof(zl)); @@ -400,8 +400,8 @@ void isis_zebra_prefix_sid_uninstall(struct isis_area *area, { struct zapi_labels zl; - sr_debug("ISIS-Sr (%s): delete label %u for prefix %pFX", - area->area_tag, psid->label, prefix); + sr_debug("ISIS-Sr (%s): delete label %u for prefix %pFX algorithm %u", + area->area_tag, psid->label, prefix, psid->algorithm); /* Prepare message. */ memset(&zl, 0, sizeof(zl)); |
