IP6-MFIB: replace the radix tree with bihash (VPP-1526)
[vpp.git] / src / vnet / dpo / lookup_dpo.c
index ebdbc12..3bda3b8 100644 (file)
@@ -1305,9 +1305,9 @@ lookup_dpo_ip_dst_mcast_inline (vlib_main_t * vm,
                 ip6_header_t * ip0;
 
                 ip0 = vlib_buffer_get_current (b0);
-                mfei0 = ip6_mfib_table_lookup2(ip6_mfib_get(fib_index0),
-                                               &ip0->src_address,
-                                               &ip0->dst_address);
+                mfei0 = ip6_mfib_table_fwd_lookup(ip6_mfib_get(fib_index0),
+                                                  &ip0->src_address,
+                                                  &ip0->dst_address);
                 if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
                 {
                     lookup_trace_t *tr = vlib_add_trace (vm, node,
@@ -1482,6 +1482,46 @@ const static char* const * const lookup_dst_from_interface_nodes[DPO_PROTO_NUM]
     [DPO_PROTO_MPLS] = lookup_dst_from_interface_mpls_nodes,
 };
 
+static clib_error_t *
+lookup_dpo_show (vlib_main_t * vm,
+                 unformat_input_t * input,
+                 vlib_cli_command_t * cmd)
+{
+    index_t lkdi = INDEX_INVALID;
+
+    while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+        if (unformat (input, "%d", &lkdi))
+            ;
+        else
+            break;
+    }
+
+    if (INDEX_INVALID != lkdi)
+    {
+        vlib_cli_output (vm, "%U", format_lookup_dpo, lkdi);
+    }
+    else
+    {
+        lookup_dpo_t *lkd;
+
+        pool_foreach(lkd, lookup_dpo_pool,
+        ({
+            vlib_cli_output (vm, "[@%d] %U",
+                             lookup_dpo_get_index(lkd),
+                             format_lookup_dpo,
+                             lookup_dpo_get_index(lkd));
+        }));
+    }
+
+    return 0;
+}
+
+VLIB_CLI_COMMAND (replicate_show_command, static) = {
+    .path = "show lookup-dpo",
+    .short_help = "show lookup-dpo [<index>]",
+    .function = lookup_dpo_show,
+};
 
 void
 lookup_dpo_module_init (void)