FIB table add/delete API
part 2;
- this adds the code to create an IP and MPLS table via the API.
- but the enforcement that the table must be created before it is used is still missing, this is so that CSIT can pass.
Change-Id: Id124d884ade6cb7da947225200e3bb193454c555
Signed-off-by: Neale Ranns <nranns@cisco.com>
diff --git a/src/vnet/fib/mpls_fib.c b/src/vnet/fib/mpls_fib.c
index ca6271f..4eeef7a 100644
--- a/src/vnet/fib/mpls_fib.c
+++ b/src/vnet/fib/mpls_fib.c
@@ -83,7 +83,8 @@
}
static u32
-mpls_fib_create_with_table_id (u32 table_id)
+mpls_fib_create_with_table_id (u32 table_id,
+ fib_source_t src)
{
dpo_id_t dpo = DPO_INVALID;
fib_table_t *fib_table;
@@ -107,7 +108,7 @@
fib_table->ft_table_id = table_id;
fib_table->ft_flow_hash_config = MPLS_FLOW_HASH_DEFAULT;
- fib_table_lock(fib_table->ft_index, FIB_PROTOCOL_MPLS);
+ fib_table_lock(fib_table->ft_index, FIB_PROTOCOL_MPLS, src);
if (INDEX_INVALID == mpls_fib_drop_dpo_index)
{
@@ -220,22 +221,23 @@
}
u32
-mpls_fib_table_find_or_create_and_lock (u32 table_id)
+mpls_fib_table_find_or_create_and_lock (u32 table_id,
+ fib_source_t src)
{
u32 index;
index = mpls_fib_index_from_table_id(table_id);
if (~0 == index)
- return mpls_fib_create_with_table_id(table_id);
+ return mpls_fib_create_with_table_id(table_id, src);
- fib_table_lock(index, FIB_PROTOCOL_MPLS);
+ fib_table_lock(index, FIB_PROTOCOL_MPLS, src);
return (index);
}
u32
-mpls_fib_table_create_and_lock (void)
+mpls_fib_table_create_and_lock (fib_source_t src)
{
- return (mpls_fib_create_with_table_id(~0));
+ return (mpls_fib_create_with_table_id(~0, src));
}
void