tcp: avoid fr segments less than mss if possible
[vpp.git] / src / vnet / l2 / l2_output_classify.c
index 49a589c..33a7c92 100644 (file)
@@ -59,10 +59,12 @@ format_l2_output_classify_trace (u8 * s, va_list * args)
   return s;
 }
 
+extern l2_output_classify_main_t l2_output_classify_main;
+
+#ifndef CLIB_MARCH_VARIANT
 /** l2 output classifier main data structure. */
 l2_output_classify_main_t l2_output_classify_main;
-
-vlib_node_registration_t l2_output_classify_node;
+#endif /* CLIB_MARCH_VARIANT */
 
 #define foreach_l2_output_classify_error               \
 _(MISS, "Classify misses")                      \
@@ -134,9 +136,9 @@ static char *l2_output_classify_error_strings[] = {
  *   Classifier hits in other than the first table
  */
 
-static uword
-l2_output_classify_node_fn (vlib_main_t * vm,
-                           vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (l2_output_classify_node) (vlib_main_t * vm,
+                                       vlib_node_runtime_t * node,
+                                       vlib_frame_t * frame)
 {
   u32 n_left_from, *from, *to_next;
   l2_output_classify_next_t next_index;
@@ -170,8 +172,7 @@ l2_output_classify_node_fn (vlib_main_t * vm,
       int type_index0, type_index1;
       vnet_classify_table_t *t0, *t1;
       u32 table_index0, table_index1;
-      u64 hash0, hash1;
-
+      u32 hash0, hash1;
 
       /* prefetch next iteration */
       {
@@ -181,9 +182,9 @@ l2_output_classify_node_fn (vlib_main_t * vm,
        p3 = vlib_get_buffer (vm, from[3]);
 
        vlib_prefetch_buffer_header (p2, STORE);
-       CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
+       clib_prefetch_store (p2->data);
        vlib_prefetch_buffer_header (p3, STORE);
-       CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
+       clib_prefetch_store (p3->data);
       }
 
       bi0 = from[0];
@@ -255,7 +256,7 @@ l2_output_classify_node_fn (vlib_main_t * vm,
       u32 type_index0;
       vnet_classify_table_t *t0;
       u32 table_index0;
-      u64 hash0;
+      u32 hash0;
 
       bi0 = from[0];
       b0 = vlib_get_buffer (vm, bi0);
@@ -306,14 +307,14 @@ l2_output_classify_node_fn (vlib_main_t * vm,
          u32 next0 = ~0;
          ethernet_header_t *h0;
          u32 table_index0;
-         u64 hash0;
+         u32 hash0;
          vnet_classify_table_t *t0;
          vnet_classify_entry_t *e0;
 
          if (PREDICT_TRUE (n_left_from > 2))
            {
              vlib_buffer_t *p2 = vlib_get_buffer (vm, from[2]);
-             u64 phash2;
+             u32 phash2;
              u32 table_index2;
              vnet_classify_table_t *tp2;
 
@@ -434,9 +435,7 @@ l2_output_classify_node_fn (vlib_main_t * vm,
   return frame->n_vectors;
 }
 
-/* *INDENT-OFF* */
 VLIB_REGISTER_NODE (l2_output_classify_node) = {
-  .function = l2_output_classify_node_fn,
   .name = "l2-output-classify",
   .vector_size = sizeof (u32),
   .format_trace = format_l2_output_classify_trace,
@@ -454,11 +453,8 @@ VLIB_REGISTER_NODE (l2_output_classify_node) = {
     [L2_OUTPUT_CLASSIFY_NEXT_DROP]  = "error-drop",
   },
 };
-/* *INDENT-ON* */
-
-VLIB_NODE_FUNCTION_MULTIARCH (l2_output_classify_node,
-                             l2_output_classify_node_fn);
 
+#ifndef CLIB_MARCH_VARIANT
 /** l2 output classsifier feature initialization. */
 clib_error_t *
 l2_output_classify_init (vlib_main_t * vm)
@@ -568,6 +564,7 @@ vnet_l2_output_classify_set_tables (u32 sw_if_index,
 
   return 0;
 }
+#endif /* CLIB_MARCH_VARIANT */
 
 static clib_error_t *
 int_l2_output_classify_command_fn (vlib_main_t * vm,
@@ -635,7 +632,6 @@ int_l2_output_classify_command_fn (vlib_main_t * vm,
  * @todo This is incomplete. This needs a detailed description and a
  * practical example.
 ?*/
-/* *INDENT-OFF* */
 VLIB_CLI_COMMAND (int_l2_output_classify_cli, static) = {
   .path = "set interface l2 output classify",
   .short_help =
@@ -643,7 +639,6 @@ VLIB_CLI_COMMAND (int_l2_output_classify_cli, static) = {
   "  [ip6-table <n>] [other-table <n>]",
   .function = int_l2_output_classify_command_fn,
 };
-/* *INDENT-ON* */
 
 /*
  * fd.io coding-style-patch-verification: ON