- 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 (CLIB_DEBUG > 0)
- {
- u32 sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_TX];
- ASSERT (sw_if_index0 == sw_if_index_all);
- }
-
- vnet_buffer (b0)->sw_if_index[VLIB_RX] = sw_if_index_all;
- vnet_buffer (b0)->sw_if_index[VLIB_TX] = new_tx_sw_if_index;
- if (next_all == VNET_SIMULATED_ETHERNET_TX_NEXT_L2_INPUT)
- vnet_update_l2_len (b0);
-
- n_bytes += vlib_buffer_length_in_chain (vm, b0);
-
- vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
- to_next, n_left_to_next,
- bi0, next_all);
+ config = l2input_intf_config
+ (vnet_buffer (b[0])->sw_if_index[VLIB_TX]);
+ next_index =
+ config->bridge ? VNET_SIMULATED_ETHERNET_TX_NEXT_L2_INPUT :
+ VNET_SIMULATED_ETHERNET_TX_NEXT_ETHERNET_INPUT;
+ new_tx_sw_if_index = config->bvi ? L2INPUT_BVI : ~0;
+ new_rx_sw_if_index = vnet_buffer (b[0])->sw_if_index[VLIB_TX];
+ }
+ next[0] = next_index;
+ vnet_buffer (b[0])->sw_if_index[VLIB_RX] = new_rx_sw_if_index;
+ vnet_buffer (b[0])->sw_if_index[VLIB_TX] = new_tx_sw_if_index;
+ n_bytes = vlib_buffer_length_in_chain (vm, b[0]);
+ if (next_index == VNET_SIMULATED_ETHERNET_TX_NEXT_L2_INPUT)
+ vnet_update_l2_len (b[0]);
+
+ vlib_increment_combined_counter (im->combined_sw_if_counters +
+ VNET_INTERFACE_COUNTER_TX,
+ thread_index, new_rx_sw_if_index,
+ 1 /* pkts */ , n_bytes);
+
+ if (PREDICT_FALSE (vnet_buffer (b[1])->sw_if_index[VLIB_TX]
+ != new_rx_sw_if_index))
+ {
+ config = l2input_intf_config
+ (vnet_buffer (b[1])->sw_if_index[VLIB_TX]);
+ next_index =
+ config->bridge ? VNET_SIMULATED_ETHERNET_TX_NEXT_L2_INPUT :
+ VNET_SIMULATED_ETHERNET_TX_NEXT_ETHERNET_INPUT;
+ new_rx_sw_if_index = vnet_buffer (b[1])->sw_if_index[VLIB_TX];
+ new_tx_sw_if_index = config->bvi ? L2INPUT_BVI : ~0;
+ }
+ next[1] = next_index;
+ vnet_buffer (b[1])->sw_if_index[VLIB_RX] = new_rx_sw_if_index;
+ vnet_buffer (b[1])->sw_if_index[VLIB_TX] = new_tx_sw_if_index;
+ n_bytes = vlib_buffer_length_in_chain (vm, b[1]);
+ if (next_index == VNET_SIMULATED_ETHERNET_TX_NEXT_L2_INPUT)
+ vnet_update_l2_len (b[1]);
+
+ vlib_increment_combined_counter (im->combined_sw_if_counters +
+ VNET_INTERFACE_COUNTER_TX,
+ thread_index, new_rx_sw_if_index,
+ 1 /* pkts */ , n_bytes);
+
+ if (PREDICT_FALSE (vnet_buffer (b[2])->sw_if_index[VLIB_TX]
+ != new_rx_sw_if_index))
+ {
+ config = l2input_intf_config
+ (vnet_buffer (b[2])->sw_if_index[VLIB_TX]);
+ next_index =
+ config->bridge ? VNET_SIMULATED_ETHERNET_TX_NEXT_L2_INPUT :
+ VNET_SIMULATED_ETHERNET_TX_NEXT_ETHERNET_INPUT;
+ new_rx_sw_if_index = vnet_buffer (b[2])->sw_if_index[VLIB_TX];
+ new_tx_sw_if_index = config->bvi ? L2INPUT_BVI : ~0;
+ }
+ next[2] = next_index;
+ vnet_buffer (b[2])->sw_if_index[VLIB_RX] = new_rx_sw_if_index;
+ vnet_buffer (b[2])->sw_if_index[VLIB_TX] = new_tx_sw_if_index;
+ n_bytes = vlib_buffer_length_in_chain (vm, b[2]);
+ if (next_index == VNET_SIMULATED_ETHERNET_TX_NEXT_L2_INPUT)
+ vnet_update_l2_len (b[2]);
+
+ vlib_increment_combined_counter (im->combined_sw_if_counters +
+ VNET_INTERFACE_COUNTER_TX,
+ thread_index, new_rx_sw_if_index,
+ 1 /* pkts */ , n_bytes);
+
+ if (PREDICT_FALSE (vnet_buffer (b[3])->sw_if_index[VLIB_TX]
+ != new_rx_sw_if_index))
+ {
+ config = l2input_intf_config
+ (vnet_buffer (b[3])->sw_if_index[VLIB_TX]);
+ next_index =
+ config->bridge ? VNET_SIMULATED_ETHERNET_TX_NEXT_L2_INPUT :
+ VNET_SIMULATED_ETHERNET_TX_NEXT_ETHERNET_INPUT;
+ new_rx_sw_if_index = vnet_buffer (b[3])->sw_if_index[VLIB_TX];
+ new_tx_sw_if_index = config->bvi ? L2INPUT_BVI : ~0;