hs-test: cache docker build in local filesystem
[vpp.git] / src / vnet / ethernet / node.c
index c1a8e0d..03cbdde 100644 (file)
@@ -982,8 +982,31 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
              else
                {
                  for (int j = 0; j < 16; j++)
-                   if (next[j] == 0)
-                     slowpath_indices[n_slowpath++] = i + j;
+                   {
+                     if (next[j] == 0)
+                       slowpath_indices[n_slowpath++] = i + j;
+                     else if (dmac_check && main_is_l3 && dmacs_bad[i + j])
+                       {
+                         next[j] = 0;
+                         slowpath_indices[n_slowpath++] = i + j;
+                       }
+                   }
+               }
+           }
+         else
+           {
+             if (dmac_check && main_is_l3)
+               {
+                 u8x16 dmac_bad = u8x16_load_unaligned (&dmacs_bad[i]);
+                 if (!u8x16_is_all_zero (dmac_bad))
+                   {
+                     for (int j = 0; j < 16; j++)
+                       if (dmacs_bad[i + j])
+                         {
+                           next[j] = 0;
+                           slowpath_indices[n_slowpath++] = i + j;
+                         }
+                   }
                }
            }
 
@@ -994,7 +1017,12 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
          continue;
        }
 #endif
-      if (main_is_l3 && etype[0] == et_ip4)
+      if (dmac_check && main_is_l3 && dmacs_bad[i])
+       {
+         next[0] = 0;
+         slowpath_indices[n_slowpath++] = i;
+       }
+      else if (main_is_l3 && etype[0] == et_ip4)
        next[0] = next_ip4;
       else if (main_is_l3 && etype[0] == et_ip6)
        next[0] = next_ip6;
@@ -1052,7 +1080,7 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
            }
          else
            {
-             /* untagged packet with not well known etyertype */
+             /* untagged packet with not well known ethertype */
              if (last_unknown_etype != etype)
                {
                  last_unknown_etype = etype;
@@ -1563,21 +1591,20 @@ ethernet_input_inline (vlib_main_t * vm,
 
                  dmacs[0] = *(u64 *) e0;
 
-                 if (ei && vec_len (ei->secondary_addrs))
-                   ethernet_input_inline_dmac_check (hi, dmacs,
-                                                     dmacs_bad,
-                                                     1 /* n_packets */ ,
-                                                     ei,
-                                                     1 /* have_sec_dmac */ );
-                 else
-                   ethernet_input_inline_dmac_check (hi, dmacs,
-                                                     dmacs_bad,
-                                                     1 /* n_packets */ ,
-                                                     ei,
-                                                     0 /* have_sec_dmac */ );
-
-                 if (dmacs_bad[0])
-                   error0 = ETHERNET_ERROR_L3_MAC_MISMATCH;
+                 if (ei)
+                   {
+                     if (vec_len (ei->secondary_addrs))
+                       ethernet_input_inline_dmac_check (
+                         hi, dmacs, dmacs_bad, 1 /* n_packets */, ei,
+                         1 /* have_sec_dmac */);
+                     else
+                       ethernet_input_inline_dmac_check (
+                         hi, dmacs, dmacs_bad, 1 /* n_packets */, ei,
+                         0 /* have_sec_dmac */);
+
+                     if (dmacs_bad[0])
+                       error0 = ETHERNET_ERROR_L3_MAC_MISMATCH;
+                   }
 
                skip_dmac_check0:
                  vlib_buffer_advance (b0, sizeof (ethernet_header_t));
@@ -2099,7 +2126,6 @@ static char *ethernet_error_strings[] = {
 #undef ethernet_error
 };
 
-/* *INDENT-OFF* */
 VLIB_REGISTER_NODE (ethernet_input_node) = {
   .name = "ethernet-input",
   /* Takes a vector of packets. */
@@ -2141,7 +2167,6 @@ VLIB_REGISTER_NODE (ethernet_input_not_l2_node) = {
 #undef _
   },
 };
-/* *INDENT-ON* */
 
 #ifndef CLIB_MARCH_VARIANT
 void