mpls: Set the MTU field in the frag-needed ICMP when doing MPLS fragmentation
[vpp.git] / src / vnet / l2 / l2_xcrw.c
index 1280b11..d848fac 100644 (file)
@@ -107,8 +107,8 @@ VLIB_NODE_FN (l2_xcrw_node) (vlib_main_t * vm,
            vlib_prefetch_buffer_header (p2, LOAD);
            vlib_prefetch_buffer_header (p3, LOAD);
 
-           CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
-           CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
+           clib_prefetch_store (p2->data);
+           clib_prefetch_store (p3->data);
          }
 
          /* speculatively enqueue b0 and b1 to the current next frame */
@@ -272,14 +272,6 @@ l2_xcrw_init (vlib_main_t * vm)
 
 VLIB_INIT_FUNCTION (l2_xcrw_init);
 
-static uword
-dummy_interface_tx (vlib_main_t * vm,
-                   vlib_node_runtime_t * node, vlib_frame_t * frame)
-{
-  clib_warning ("you shouldn't be here, leaking buffers...");
-  return frame->n_vectors;
-}
-
 static u8 *
 format_xcrw_name (u8 * s, va_list * args)
 {
@@ -291,7 +283,6 @@ format_xcrw_name (u8 * s, va_list * args)
 VNET_DEVICE_CLASS (xcrw_device_class,static) = {
   .name = "Xcrw",
   .format_device_name = format_xcrw_name,
-  .tx_function = dummy_interface_tx,
 };
 /* *INDENT-ON* */
 
@@ -300,6 +291,7 @@ static u32
 create_xcrw_interface (vlib_main_t * vm)
 {
   vnet_main_t *vnm = vnet_get_main ();
+  vnet_eth_interface_registration_t eir = {};
   static u32 instance;
   u8 address[6];
   u32 hw_if_index;
@@ -310,10 +302,9 @@ create_xcrw_interface (vlib_main_t * vm)
   clib_memset (address, 0, sizeof (address));
   address[2] = 0x12;
 
-  /* can returns error iff phy != 0 */
-  (void) ethernet_register_interface
-    (vnm, xcrw_device_class.index, instance++, address, &hw_if_index,
-     /* flag change */ 0);
+  eir.dev_class_index = xcrw_device_class.index;
+  eir.dev_instance = instance++, eir.address = address;
+  hw_if_index = vnet_eth_register_interface (vnm, &eir);
 
   hi = vnet_get_hw_interface (vnm, hw_if_index);
   sw_if_index = hi->sw_if_index;
@@ -578,10 +569,10 @@ show_l2xcrw_command_fn (vlib_main_t * vm,
   vlib_cli_output (vm, "%U", format_l2xcrw, 0, 0);
 
   /* *INDENT-OFF* */
-  pool_foreach (t, xcm->tunnels,
-  ({
+  pool_foreach (t, xcm->tunnels)
+   {
     vlib_cli_output (vm, "%U", format_l2xcrw, vnm, t);
-  }));
+  }
   /* *INDENT-ON* */
 
   return 0;