+#endif /* CLIB_MARCH_VARIANT */
+
+static_always_inline void vnet_interface_pcap_tx_trace
+ (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame,
+ int sw_if_index_from_buffer)
+{
+ u32 n_left_from, *from;
+ u32 sw_if_index;
+
+ if (PREDICT_TRUE (vm->pcap[VLIB_TX].pcap_enable == 0))
+ return;
+
+ if (sw_if_index_from_buffer == 0)
+ {
+ vnet_interface_output_runtime_t *rt = (void *) node->runtime_data;
+ sw_if_index = rt->sw_if_index;
+ }
+ else
+ sw_if_index = ~0;
+
+ n_left_from = frame->n_vectors;
+ from = vlib_frame_vector_args (frame);
+
+ while (n_left_from > 0)
+ {
+ u32 bi0 = from[0];
+ vlib_buffer_t *b0 = vlib_get_buffer (vm, bi0);
+
+ if (sw_if_index_from_buffer)
+ sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
+
+ if (vm->pcap[VLIB_TX].pcap_sw_if_index == 0 ||
+ vm->pcap[VLIB_TX].pcap_sw_if_index == sw_if_index)
+ pcap_add_buffer (&vm->pcap[VLIB_TX].pcap_main, vm, bi0, 512);
+ from++;
+ n_left_from--;
+ }
+}
+
+#ifndef CLIB_MARCH_VARIANT
+static_always_inline uword
+vnet_interface_output_node_inline (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame, vnet_main_t * vnm,
+ vnet_hw_interface_t * hi,
+ int do_tx_offloads)
+{
+ /*
+ * The 3-headed "if" is here because we want to err on the side
+ * of not impacting the non-GSO performance - so for the more
+ * common case of no GSO interfaces we want to prevent the
+ * segmentation codepath from being there altogether.
+ */
+ if (PREDICT_TRUE (vnm->interface_main.gso_interface_count == 0))
+ return vnet_interface_output_node_inline_gso (vm, node, frame, vnm, hi,
+ do_tx_offloads,
+ /* do_segmentation */ 0);
+ else if (hi->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO)
+ return vnet_interface_output_node_inline_gso (vm, node, frame, vnm, hi,
+ do_tx_offloads,
+ /* do_segmentation */ 0);
+ else
+ return vnet_interface_output_node_inline_gso (vm, node, frame, vnm, hi,
+ do_tx_offloads,
+ /* do_segmentation */ 1);
+}
+
+uword
+vnet_interface_output_node (vlib_main_t * vm, vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
+{
+ vnet_main_t *vnm = vnet_get_main ();
+ vnet_hw_interface_t *hi;
+ vnet_interface_output_runtime_t *rt = (void *) node->runtime_data;
+ hi = vnet_get_sup_hw_interface (vnm, rt->sw_if_index);