X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fsvs%2Fsvs.c;h=555283397ffceb4da880db9047d275d11df4f358;hb=625a1f1824e4b21e8343e1dc50c4f5400080d0ed;hp=2ee15cffac346ef485465fad4daa427ee051556f;hpb=738b299a8ed633b59e34f0709a8e164c9edc8852;p=vpp.git diff --git a/src/plugins/svs/svs.c b/src/plugins/svs/svs.c index 2ee15cffac3..555283397ff 100644 --- a/src/plugins/svs/svs.c +++ b/src/plugins/svs/svs.c @@ -26,10 +26,12 @@ u32 *svs_itf_db[FIB_PROTOCOL_IP_MAX]; +static fib_source_t svs_fib_src; + int svs_table_add (fib_protocol_t fproto, u32 table_id) { - fib_table_find_or_create_and_lock (fproto, table_id, FIB_SOURCE_PLUGIN_LOW); + fib_table_find_or_create_and_lock (fproto, table_id, svs_fib_src); return (0); } @@ -50,7 +52,7 @@ svs_table_delete (fib_protocol_t fproto, u32 table_id) if (~0 == fib_index) return VNET_API_ERROR_NO_SUCH_FIB; - fib_table_unlock (fib_index, fproto, FIB_SOURCE_PLUGIN_LOW); + fib_table_unlock (fib_index, fproto, svs_fib_src); return (0); } @@ -68,7 +70,7 @@ svs_route_add_i (u32 fib_index, const fib_prefix_t * pfx, u32 src_fib_index) LOOKUP_TABLE_FROM_CONFIG, &dpo); fib_table_entry_special_dpo_add (fib_index, pfx, - FIB_SOURCE_PLUGIN_LOW, + svs_fib_src, FIB_ENTRY_FLAG_EXCLUSIVE, &dpo); dpo_unlock (&dpo); @@ -107,7 +109,7 @@ svs_route_delete (u32 table_id, const fib_prefix_t * pfx) if (~0 == fib_index) return VNET_API_ERROR_NO_SUCH_FIB; - fib_table_entry_special_remove (fib_index, pfx, FIB_SOURCE_PLUGIN_LOW); + fib_table_entry_special_remove (fib_index, pfx, svs_fib_src); return (0); } @@ -214,7 +216,7 @@ svs_disable (fib_protocol_t fproto, u32 table_id, u32 sw_if_index) "svs-ip4" : "svs-ip6"), sw_if_index, 0, NULL, 0); - fib_table_entry_special_remove (fib_index, &pfx, FIB_SOURCE_PLUGIN_LOW); + fib_table_entry_special_remove (fib_index, &pfx, svs_fib_src); return (0); } @@ -304,8 +306,7 @@ svs_input_inline (vlib_main_t * vm, ip6_header_t *ip0; ip0 = vlib_buffer_get_current (b0); - lbi0 = ip6_fib_table_fwding_lookup (&ip6_main, - svs_itf_db[fproto] + lbi0 = ip6_fib_table_fwding_lookup (svs_itf_db[fproto] [sw_if_index0], &ip0->src_address); } @@ -608,6 +609,10 @@ svs_init (vlib_main_t * vm) }; vec_add1 (ip4_main.table_bind_callbacks, cbt4); + svs_fib_src = fib_source_allocate ("svs", + FIB_SOURCE_PRIORITY_LOW, + FIB_SOURCE_BH_SIMPLE); + return (NULL); }