+void
+virtio_set_packet_coalesce (virtio_if_t * vif)
+{
+ vnet_main_t *vnm = vnet_get_main ();
+ vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, vif->hw_if_index);
+ virtio_vring_t *vring;
+ vif->packet_coalesce = 1;
+ vec_foreach (vring, vif->txq_vrings)
+ {
+ gro_flow_table_init (&vring->flow_table,
+ vif->type & (VIRTIO_IF_TYPE_TAP |
+ VIRTIO_IF_TYPE_PCI), hw->tx_node_index);
+ }
+}
+
+clib_error_t *
+virtio_set_packet_buffering (virtio_if_t * vif, u16 buffering_size)
+{
+ vnet_main_t *vnm = vnet_get_main ();
+ vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, vif->hw_if_index);
+ virtio_vring_t *vring;
+ clib_error_t *error = 0;
+ vif->packet_buffering = 1;
+
+ vec_foreach (vring, vif->txq_vrings)
+ {
+ if ((error =
+ virtio_vring_buffering_init (&vring->buffering, hw->tx_node_index,
+ buffering_size)))
+ {
+ break;
+ }
+ }
+
+ return error;
+}
+