summaryrefslogtreecommitdiffstats
path: root/src/vnet/mfib/mfib_table.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-02-02 02:18:18 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2017-02-02 14:27:13 +0000
commita9374df5f351d25e968f5f90a827796203cbafdd (patch)
tree7876e45e388ebc739722777c1cadcf666dda6439 /src/vnet/mfib/mfib_table.c
parented0e49c51841e84c72a5bb2c6d538ee779b734d4 (diff)
Fix SR multicast post mfib commit
1 - use the SR policy to construct the replicate DPO. Each bucket therein is a SR tunnel. 2 - install a special mfib entry that links via this replicate 3 - forwarding is now mfib-lookup -> replicate -> sr_rewrite (per-tunnel) no need for a separate sr_replicate node. 4 - Stack the sr tunnel on the forwarding DPO of the first-hop FIB entry. no need for a second lookup post SR encap. 5 - fix some path-list lock leaks in the MFIB entry. Change-Id: I20de96ea4c4be4fae252625bde159d9c435c8315 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/mfib/mfib_table.c')
-rw-r--r--src/vnet/mfib/mfib_table.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/vnet/mfib/mfib_table.c b/src/vnet/mfib/mfib_table.c
index e4c0936d6c9..b4e855ff071 100644
--- a/src/vnet/mfib/mfib_table.c
+++ b/src/vnet/mfib/mfib_table.c
@@ -195,7 +195,10 @@ mfib_table_entry_update (u32 fib_index,
{
mfib_entry_lock(mfib_entry_index);
- if (mfib_entry_update(mfib_entry_index, source, entry_flags))
+ if (mfib_entry_update(mfib_entry_index,
+ source,
+ entry_flags,
+ INDEX_INVALID))
{
/*
* this update means we can now remove the entry.
@@ -283,6 +286,36 @@ mfib_table_entry_path_remove (u32 fib_index,
}
}
+fib_node_index_t
+mfib_table_entry_special_add (u32 fib_index,
+ const mfib_prefix_t *prefix,
+ mfib_source_t source,
+ mfib_entry_flags_t entry_flags,
+ index_t rep_dpo)
+{
+ fib_node_index_t mfib_entry_index;
+ mfib_table_t *mfib_table;
+
+ mfib_table = mfib_table_get(fib_index, prefix->fp_proto);
+ mfib_entry_index = mfib_table_lookup_exact_match_i(mfib_table, prefix);
+
+ if (FIB_NODE_INDEX_INVALID == mfib_entry_index)
+ {
+ mfib_entry_index = mfib_entry_create(fib_index,
+ source,
+ prefix,
+ MFIB_ENTRY_FLAG_NONE);
+
+ mfib_table_entry_insert(mfib_table, prefix, mfib_entry_index);
+ }
+
+ mfib_entry_update(mfib_entry_index, source,
+ (MFIB_ENTRY_FLAG_EXCLUSIVE | entry_flags),
+ rep_dpo);
+
+ return (mfib_entry_index);
+}
+
static void
mfib_table_entry_delete_i (u32 fib_index,
fib_node_index_t mfib_entry_index,