aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_attached_export.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-04-05 08:11:14 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2017-04-06 15:18:44 +0000
commit88fc83eb716bf07f4634de6de5b569f795a56418 (patch)
tree4c8037b62cb6a57209aef4e28ae273d0ba4e40e7 /src/vnet/fib/fib_attached_export.c
parent5ee51f8ed616f14f3b32ae8857d383fefa02d861 (diff)
BFD-FIB interactions
- single-hop BFD: attach a delegate to the appropriate adjacency - multi-hop BFD [not supported yet]: attach a delegate to the FIB entry. adjacency/fib_entry state tracks the BFD session state. when the state is down the object does not contribute forwarding hence and hence dependent objects will not use it. For example, if a route is ECMP via two adjacencies and one of them is BFD down, then only the other is used to forward (i.e. we don't drop half the traffic). Change-Id: I0ef53e20e73b067001a132cd0a3045408811a822 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/fib_attached_export.c')
-rw-r--r--src/vnet/fib/fib_attached_export.c75
1 files changed, 30 insertions, 45 deletions
diff --git a/src/vnet/fib/fib_attached_export.c b/src/vnet/fib/fib_attached_export.c
index 715e63e7246..cc8ebc8653e 100644
--- a/src/vnet/fib/fib_attached_export.c
+++ b/src/vnet/fib/fib_attached_export.c
@@ -514,67 +514,52 @@ fib_attached_export_cover_update (fib_entry_t *fib_entry)
}
u8*
-fib_ae_import_format (fib_entry_t *fib_entry,
+fib_ae_import_format (fib_node_index_t impi,
u8* s)
{
- fib_entry_delegate_t *fed;
-
- fed = fib_entry_delegate_get(fib_entry,
- FIB_ENTRY_DELEGATE_ATTACHED_IMPORT);
-
- if (NULL != fed)
- {
- fib_node_index_t *index;
- fib_ae_import_t *import;
-
- import = pool_elt_at_index(fib_ae_import_pool, fed->fd_index);
+ fib_node_index_t *index;
+ fib_ae_import_t *import;
- s = format(s, "\n Attached-Import:%d:[", (import - fib_ae_import_pool));
- s = format(s, "export-prefix:%U ", format_fib_prefix, &import->faei_prefix);
- s = format(s, "export-entry:%d ", import->faei_export_entry);
- s = format(s, "export-sibling:%d ", import->faei_export_sibling);
- s = format(s, "exporter:%d ", import->faei_exporter);
- s = format(s, "export-fib:%d ", import->faei_export_fib);
+ import = pool_elt_at_index(fib_ae_import_pool, impi);
- s = format(s, "import-entry:%d ", import->faei_import_entry);
- s = format(s, "import-fib:%d ", import->faei_import_fib);
+ s = format(s, "\n Attached-Import:%d:[", (import - fib_ae_import_pool));
+ s = format(s, "export-prefix:%U ", format_fib_prefix, &import->faei_prefix);
+ s = format(s, "export-entry:%d ", import->faei_export_entry);
+ s = format(s, "export-sibling:%d ", import->faei_export_sibling);
+ s = format(s, "exporter:%d ", import->faei_exporter);
+ s = format(s, "export-fib:%d ", import->faei_export_fib);
+
+ s = format(s, "import-entry:%d ", import->faei_import_entry);
+ s = format(s, "import-fib:%d ", import->faei_import_fib);
- s = format(s, "importeds:[");
- vec_foreach(index, import->faei_importeds)
- {
- s = format(s, "%d, ", *index);
- }
- s = format(s, "]]");
+ s = format(s, "importeds:[");
+ vec_foreach(index, import->faei_importeds)
+ {
+ s = format(s, "%d, ", *index);
}
+ s = format(s, "]]");
return (s);
}
u8*
-fib_ae_export_format (fib_entry_t *fib_entry,
+fib_ae_export_format (fib_node_index_t expi,
u8* s)
{
- fib_entry_delegate_t *fed;
-
- fed = fib_entry_delegate_get(fib_entry,
- FIB_ENTRY_DELEGATE_ATTACHED_EXPORT);
-
- if (NULL != fed)
- {
- fib_node_index_t *index;
- fib_ae_export_t *export;
+ fib_node_index_t *index;
+ fib_ae_export_t *export;
- export = pool_elt_at_index(fib_ae_export_pool, fed->fd_list);
+ export = pool_elt_at_index(fib_ae_export_pool, expi);
- s = format(s, "\n Attached-Export:%d:[", (export - fib_ae_export_pool));
- s = format(s, "export-entry:%d ", export->faee_ei);
+ s = format(s, "\n Attached-Export:%d:[", (export - fib_ae_export_pool));
+ s = format(s, "export-entry:%d ", export->faee_ei);
- s = format(s, "importers:[");
- vec_foreach(index, export->faee_importers)
- {
- s = format(s, "%d, ", *index);
- }
- s = format(s, "]]");
+ s = format(s, "importers:[");
+ vec_foreach(index, export->faee_importers)
+ {
+ s = format(s, "%d, ", *index);
}
+ s = format(s, "]]");
+
return (s);
}