misc: remove GNU Indent directives
[vpp.git] / src / vnet / l2 / l2_in_out_acl.c
index 6f86a9f..2e2cb1e 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <vlib/vlib.h>
 #include <vnet/vnet.h>
-#include <vnet/pg/pg.h>
 #include <vnet/ethernet/ethernet.h>
 #include <vnet/ethernet/packet.h>
 #include <vnet/ip/ip_packet.h>
@@ -80,10 +79,14 @@ format_l2_outacl_trace (u8 * s, va_list * args)
   return format_l2_in_out_acl_trace (s, IN_OUT_ACL_OUTPUT_TABLE_GROUP, args);
 }
 
+extern l2_in_out_acl_main_t l2_in_out_acl_main;
+
+#ifndef CLIB_MARCH_VARIANT
 l2_in_out_acl_main_t l2_in_out_acl_main;
+#endif /* CLIB_MARCH_VARIANT */
 
-static vlib_node_registration_t l2_inacl_node;
-static vlib_node_registration_t l2_outacl_node;
+extern vlib_node_registration_t l2_inacl_node;
+extern vlib_node_registration_t l2_outacl_node;
 
 #define foreach_l2_inacl_error                  \
 _(NONE, "valid input ACL packets")              \
@@ -169,9 +172,9 @@ l2_in_out_acl_node_fn (vlib_main_t * vm,
        p2 = vlib_get_buffer (vm, from[2]);
 
        vlib_prefetch_buffer_header (p1, STORE);
-       CLIB_PREFETCH (p1->data, CLIB_CACHE_LINE_BYTES, STORE);
+       clib_prefetch_store (p1->data);
        vlib_prefetch_buffer_header (p2, STORE);
-       CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
+       clib_prefetch_store (p2->data);
       }
 
       bi0 = from[0];
@@ -197,7 +200,7 @@ l2_in_out_acl_node_fn (vlib_main_t * vm,
       if (t0->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA)
        h0 = (void *) vlib_buffer_get_current (b0) + t0->current_data_offset;
       else
-       h0 = b0->data;
+       h0 = (void *) vlib_buffer_get_current (b0);
 
       vnet_buffer (b0)->l2_classify.hash =
        vnet_classify_hash_packet (t0, (u8 *) h0);
@@ -207,7 +210,7 @@ l2_in_out_acl_node_fn (vlib_main_t * vm,
       if (t1->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA)
        h1 = (void *) vlib_buffer_get_current (b1) + t1->current_data_offset;
       else
-       h1 = b1->data;
+       h1 = (void *) vlib_buffer_get_current (b1);
 
       vnet_buffer (b1)->l2_classify.hash =
        vnet_classify_hash_packet (t1, (u8 *) h1);
@@ -244,7 +247,7 @@ l2_in_out_acl_node_fn (vlib_main_t * vm,
       if (t0->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA)
        h0 = (void *) vlib_buffer_get_current (b0) + t0->current_data_offset;
       else
-       h0 = b0->data;
+       h0 = (void *) vlib_buffer_get_current (b0);
 
       vnet_buffer (b0)->l2_classify.hash =
        vnet_classify_hash_packet (t0, (u8 *) h0);
@@ -275,7 +278,7 @@ l2_in_out_acl_node_fn (vlib_main_t * vm,
          u32 table_index0;
          vnet_classify_table_t *t0;
          vnet_classify_entry_t *e0;
-         u64 hash0;
+         u32 hash0;
          u8 *h0;
          u8 error0;
 
@@ -285,7 +288,7 @@ l2_in_out_acl_node_fn (vlib_main_t * vm,
              vlib_buffer_t *p1 = vlib_get_buffer (vm, from[3]);
              vnet_classify_table_t *tp1;
              u32 table_index1;
-             u64 phash1;
+             u32 phash1;
 
              table_index1 = vnet_buffer (p1)->l2_classify.table_index;
 
@@ -329,7 +332,7 @@ l2_in_out_acl_node_fn (vlib_main_t * vm,
                  (void *) vlib_buffer_get_current (b0) +
                  t0->current_data_offset;
              else
-               h0 = b0->data;
+               h0 = (void *) vlib_buffer_get_current (b0);
 
              e0 = vnet_classify_find_entry (t0, (u8 *) h0, hash0, now);
              if (e0)
@@ -384,7 +387,7 @@ l2_in_out_acl_node_fn (vlib_main_t * vm,
                          (void *) vlib_buffer_get_current (b0) +
                          t0->current_data_offset;
                      else
-                       h0 = b0->data;
+                       h0 = (void *) vlib_buffer_get_current (b0);
 
                      hash0 = vnet_classify_hash_packet (t0, (u8 *) h0);
                      e0 = vnet_classify_find_entry
@@ -445,25 +448,23 @@ l2_in_out_acl_node_fn (vlib_main_t * vm,
   return frame->n_vectors;
 }
 
-static uword
-l2_inacl_node_fn (vlib_main_t * vm,
-                 vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (l2_inacl_node) (vlib_main_t * vm,
+                             vlib_node_runtime_t * node,
+                             vlib_frame_t * frame)
 {
   return l2_in_out_acl_node_fn (vm, node, frame,
                                IN_OUT_ACL_INPUT_TABLE_GROUP);
 }
 
-static uword
-l2_outacl_node_fn (vlib_main_t * vm,
-                  vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (l2_outacl_node) (vlib_main_t * vm,
+                              vlib_node_runtime_t * node,
+                              vlib_frame_t * frame)
 {
   return l2_in_out_acl_node_fn (vm, node, frame,
                                IN_OUT_ACL_OUTPUT_TABLE_GROUP);
 }
 
-/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (l2_inacl_node,static) = {
-  .function = l2_inacl_node_fn,
+VLIB_REGISTER_NODE (l2_inacl_node) = {
   .name = "l2-input-acl",
   .vector_size = sizeof (u32),
   .format_trace = format_l2_inacl_trace,
@@ -480,8 +481,7 @@ VLIB_REGISTER_NODE (l2_inacl_node,static) = {
   },
 };
 
-VLIB_REGISTER_NODE (l2_outacl_node,static) = {
-  .function = l2_outacl_node_fn,
+VLIB_REGISTER_NODE (l2_outacl_node) = {
   .name = "l2-output-acl",
   .vector_size = sizeof (u32),
   .format_trace = format_l2_outacl_trace,
@@ -498,11 +498,8 @@ VLIB_REGISTER_NODE (l2_outacl_node,static) = {
   },
 };
 
-VLIB_NODE_FUNCTION_MULTIARCH (l2_inacl_node, l2_inacl_node_fn)
-VLIB_NODE_FUNCTION_MULTIARCH (l2_outacl_node, l2_outacl_node_fn)
-/* *INDENT-ON* */
-
 
+#ifndef CLIB_MARCH_VARIANT
 clib_error_t *
 l2_in_out_acl_init (vlib_main_t * vm)
 {
@@ -527,6 +524,7 @@ l2_in_out_acl_init (vlib_main_t * vm)
 }
 
 VLIB_INIT_FUNCTION (l2_in_out_acl_init);
+#endif /* CLIB_MARCH_VARIANT */
 
 /*
  * fd.io coding-style-patch-verification: ON