- if (b0->flags & VLIB_BUFFER_IS_TRACED)
- {
- ethernet_header_t *h0 = vlib_buffer_get_current (b0);
- l2input_trace_t *t =
- vlib_add_trace (vm, node, b0, sizeof (*t));
- t->sw_if_index = sw_if_index0;
- clib_memcpy_fast (t->src, h0->src_address, 6);
- clib_memcpy_fast (t->dst, h0->dst_address, 6);
- }
- if (b1->flags & VLIB_BUFFER_IS_TRACED)
- {
- ethernet_header_t *h1 = vlib_buffer_get_current (b1);
- l2input_trace_t *t =
- vlib_add_trace (vm, node, b1, sizeof (*t));
- t->sw_if_index = sw_if_index1;
- clib_memcpy_fast (t->src, h1->src_address, 6);
- clib_memcpy_fast (t->dst, h1->dst_address, 6);
- }
- if (b2->flags & VLIB_BUFFER_IS_TRACED)
- {
- ethernet_header_t *h2 = vlib_buffer_get_current (b2);
- l2input_trace_t *t =
- vlib_add_trace (vm, node, b2, sizeof (*t));
- t->sw_if_index = sw_if_index2;
- clib_memcpy_fast (t->src, h2->src_address, 6);
- clib_memcpy_fast (t->dst, h2->dst_address, 6);
- }
- if (b3->flags & VLIB_BUFFER_IS_TRACED)
- {
- ethernet_header_t *h3 = vlib_buffer_get_current (b3);
- l2input_trace_t *t =
- vlib_add_trace (vm, node, b3, sizeof (*t));
- t->sw_if_index = sw_if_index3;
- clib_memcpy_fast (t->src, h3->src_address, 6);
- clib_memcpy_fast (t->dst, h3->dst_address, 6);
- }
- }
-
- classify_and_dispatch (msm, b0, &next0);
- classify_and_dispatch (msm, b1, &next1);
- classify_and_dispatch (msm, b2, &next2);
- classify_and_dispatch (msm, b3, &next3);
-
- /* verify speculative enqueues, maybe switch current next frame */
- /* if next0==next1==next_index then nothing special needs to be done */
- vlib_validate_buffer_enqueue_x4 (vm, node, next_index,
- to_next, n_left_to_next,
- bi0, bi1, bi2, bi3,
- next0, next1, next2, next3);
- }
-
- while (n_left_from > 0 && n_left_to_next > 0)
- {
- u32 bi0;
- vlib_buffer_t *b0;
- u32 next0;
- u32 sw_if_index0;
-
- /* speculatively enqueue b0 to the current next frame */
- bi0 = from[0];
- to_next[0] = bi0;
- from += 1;
- to_next += 1;
- n_left_from -= 1;
- n_left_to_next -= 1;
-
- b0 = vlib_get_buffer (vm, bi0);
-
- if (do_trace && PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
- {
- ethernet_header_t *h0 = vlib_buffer_get_current (b0);
- l2input_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t));
- sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
- t->sw_if_index = sw_if_index0;
- clib_memcpy_fast (t->src, h0->src_address, 6);
- clib_memcpy_fast (t->dst, h0->dst_address, 6);
- }
-
- classify_and_dispatch (msm, b0, &next0);
-
- /* verify speculative enqueue, maybe switch current next frame */
- vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
- to_next, n_left_to_next,
- bi0, next0);
- }
-
- vlib_put_next_frame (vm, node, next_index, n_left_to_next);