crypto: Add prefetching for src and dst
[vpp.git] / src / plugins / l3xc / l3xc.c
index 77c062f..427c38e 100644 (file)
@@ -67,11 +67,11 @@ l3xc_stack (l3xc_t * l3xc)
    */
   dpo_id_t via_dpo = DPO_INVALID;
 
-  fib_path_list_contribute_forwarding (l3xc->l3xc_pl,
-                                      (FIB_PROTOCOL_IP4 == l3xc->l3xc_proto ?
-                                       FIB_FORW_CHAIN_TYPE_UNICAST_IP4 :
-                                       FIB_FORW_CHAIN_TYPE_UNICAST_IP6),
-                                      FIB_PATH_LIST_FWD_FLAG_NONE, &via_dpo);
+  fib_path_list_contribute_forwarding (
+    l3xc->l3xc_pl,
+    (FIB_PROTOCOL_IP4 == l3xc->l3xc_proto ? FIB_FORW_CHAIN_TYPE_UNICAST_IP4 :
+                                           FIB_FORW_CHAIN_TYPE_UNICAST_IP6),
+    FIB_PATH_LIST_FWD_FLAG_COLLAPSE, &via_dpo);
 
   dpo_stack_from_node ((FIB_PROTOCOL_IP4 == l3xc->l3xc_proto ?
                        l3xc_ip4_node.index :
@@ -184,6 +184,7 @@ l3xc_delete (u32 sw_if_index, u8 is_ip6)
                                   0, &l3xci, sizeof (l3xci));
 
       fib_path_list_child_remove (l3xc->l3xc_pl, l3xc->l3xc_sibling);
+      dpo_reset (&l3xc->l3xc_dpo);
 
       l3xc_db_remove (l3xc->l3xc_sw_if_index, fproto);
       pool_put (l3xc_pool, l3xc);
@@ -199,6 +200,7 @@ l3xc_cmd (vlib_main_t * vm,
   unformat_input_t _line_input, *line_input = &_line_input;
   fib_route_path_t *rpaths = NULL, rpath;
   u32 sw_if_index, is_del, is_ip6;
+  dpo_proto_t payload_proto;
   vnet_main_t *vnm;
   int rv = 0;
 
@@ -224,7 +226,7 @@ l3xc_cmd (vlib_main_t * vm,
       else if (unformat (line_input, "add"))
        is_del = 0;
       else if (unformat (line_input, "via %U",
-                        unformat_fib_route_path, &rpath))
+                        unformat_fib_route_path, &rpath, &payload_proto))
        vec_add1 (rpaths, rpath);
       else
        return (clib_error_return (0, "unknown input '%U'",
@@ -262,7 +264,6 @@ out:
   return (NULL);
 }
 
-/* *INDENT-OFF* */
 /**
  * Create an L3XC policy.
  */
@@ -272,7 +273,6 @@ VLIB_CLI_COMMAND (l3xc_cmd_node, static) = {
   .short_help = "l3xc [add|del] <INTERFACE> via ...",
   .is_mp_safe = 1,
 };
-/* *INDENT-ON* */
 
 static u8 *
 format_l3xc (u8 * s, va_list * args)
@@ -303,13 +303,11 @@ l3xc_walk (l3xc_walk_cb_t cb, void *ctx)
 {
   u32 l3xci;
 
-  /* *INDENT-OFF* */
-  pool_foreach_index(l3xci, l3xc_pool,
-  ({
+  pool_foreach_index (l3xci, l3xc_pool)
+   {
     if (!cb(l3xci, ctx))
       break;
-  }));
-  /* *INDENT-ON* */
+  }
 }
 
 static clib_error_t *
@@ -318,24 +316,20 @@ l3xc_show_cmd (vlib_main_t * vm,
 {
   l3xc_t *l3xc;
 
-  /* *INDENT-OFF* */
-  pool_foreach(l3xc, l3xc_pool,
-  ({
+  pool_foreach (l3xc, l3xc_pool)
+   {
     vlib_cli_output(vm, "%U", format_l3xc, l3xc);
-  }));
-  /* *INDENT-ON* */
+  }
 
   return (NULL);
 }
 
-/* *INDENT-OFF* */
 VLIB_CLI_COMMAND (l3xc_show_cmd_node, static) = {
   .path = "show l3xc",
   .function = l3xc_show_cmd,
   .short_help = "show l3xc",
   .is_mp_safe = 1,
 };
-/* *INDENT-ON* */
 
 static fib_node_t *
 l3xc_get_node (fib_node_index_t index)
@@ -379,7 +373,7 @@ static const fib_node_vft_t l3xc_vft = {
 static clib_error_t *
 l3xc_init (vlib_main_t * vm)
 {
-  l3xc_fib_node_type = fib_node_register_new_type (&l3xc_vft);
+  l3xc_fib_node_type = fib_node_register_new_type ("l3xc", &l3xc_vft);
 
   return (NULL);
 }