deprecate VLIB_DEVICE_TX_FUNCTION_MULTIARCH
[vpp.git] / src / vnet / devices / af_packet / device.c
index 0b0697b..2886fb5 100644 (file)
@@ -51,6 +51,7 @@ static char *af_packet_tx_func_error_strings[] = {
 };
 
 
+#ifndef CLIB_MARCH_VARIANT
 u8 *
 format_af_packet_device_name (u8 * s, va_list * args)
 {
@@ -61,6 +62,7 @@ format_af_packet_device_name (u8 * s, va_list * args)
   s = format (s, "host-%s", apif->host_if_name);
   return s;
 }
+#endif /* CLIB_MARCH_VARIANT */
 
 static u8 *
 format_af_packet_device (u8 * s, va_list * args)
@@ -76,12 +78,12 @@ format_af_packet_tx_trace (u8 * s, va_list * args)
   return s;
 }
 
-static uword
-af_packet_interface_tx (vlib_main_t * vm,
-                       vlib_node_runtime_t * node, vlib_frame_t * frame)
+VNET_DEVICE_CLASS_TX_FN (af_packet_device_class) (vlib_main_t * vm,
+                                                 vlib_node_runtime_t * node,
+                                                 vlib_frame_t * frame)
 {
   af_packet_main_t *apm = &af_packet_main;
-  u32 *buffers = vlib_frame_args (frame);
+  u32 *buffers = vlib_frame_vector_args (frame);
   u32 n_left = frame->n_vectors;
   u32 n_sent = 0;
   vnet_interface_output_runtime_t *rd = (void *) node->runtime_data;
@@ -119,9 +121,9 @@ af_packet_interface_tx (vlib_main_t * vm,
        {
          b0 = vlib_get_buffer (vm, bi);
          len = b0->current_length;
-         clib_memcpy ((u8 *) tph +
-                      TPACKET_ALIGN (sizeof (struct tpacket2_hdr)) + offset,
-                      vlib_buffer_get_current (b0), len);
+         clib_memcpy_fast ((u8 *) tph +
+                           TPACKET_ALIGN (sizeof (struct tpacket2_hdr)) +
+                           offset, vlib_buffer_get_current (b0), len);
          offset += len;
        }
       while ((bi =
@@ -168,7 +170,7 @@ af_packet_interface_tx (vlib_main_t * vm,
     vlib_error_count (vm, node->node_index, AF_PACKET_TX_ERROR_TXRING_OVERRUN,
                      n_left);
 
-  vlib_buffer_free (vm, vlib_frame_args (frame), frame->n_vectors);
+  vlib_buffer_free (vm, vlib_frame_vector_args (frame), frame->n_vectors);
   return frame->n_vectors;
 }
 
@@ -278,7 +280,7 @@ af_packet_subif_add_del_function (vnet_main_t * vnm,
 }
 
 static clib_error_t *af_packet_set_mac_address_function
-  (struct vnet_hw_interface_t *hi, char *address)
+  (struct vnet_hw_interface_t *hi, const u8 * old_address, const u8 * address)
 {
   af_packet_main_t *apm = &af_packet_main;
   af_packet_if_t *apif =
@@ -330,7 +332,6 @@ error:
 /* *INDENT-OFF* */
 VNET_DEVICE_CLASS (af_packet_device_class) = {
   .name = "af-packet",
-  .tx_function = af_packet_interface_tx,
   .format_device_name = format_af_packet_device_name,
   .format_device = format_af_packet_device,
   .format_tx_trace = format_af_packet_tx_trace,
@@ -342,9 +343,6 @@ VNET_DEVICE_CLASS (af_packet_device_class) = {
   .subif_add_del_function = af_packet_subif_add_del_function,
   .mac_addr_change_function = af_packet_set_mac_address_function,
 };
-
-VLIB_DEVICE_TX_FUNCTION_MULTIARCH (af_packet_device_class,
-                                  af_packet_interface_tx)
 /* *INDENT-ON* */
 
 /*