summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-08-13 18:57:26 +0200
committerBenoƮt Ganne <bganne@cisco.com>2020-08-17 08:46:53 +0000
commit9e2a78564f0fc07f1ea3d15a31fa7ca3a0f6424d (patch)
tree03387739672584357b7038b67e998d8824de5d01 /src/vnet/devices/virtio/virtio.c
parent00dd39044e64b4a7a33d204ef7d19aac819d71f5 (diff)
tap: add gro support
Type: feature Change-Id: I5868dd267aa26aa97aec5fd70e70c5956ac52277 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/virtio.c')
-rw-r--r--src/vnet/devices/virtio/virtio.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/virtio.c b/src/vnet/devices/virtio/virtio.c
index 17fbd7920da..f8b6a39ea47 100644
--- a/src/vnet/devices/virtio/virtio.c
+++ b/src/vnet/devices/virtio/virtio.c
@@ -217,11 +217,26 @@ virtio_vring_free_tx (vlib_main_t * vm, virtio_if_t * vif, u32 idx)
if (vring->avail)
clib_mem_free (vring->avail);
vec_free (vring->buffers);
+ gro_flow_table_free (vring->flow_table);
clib_spinlock_free (&vring->lockp);
return 0;
}
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;
+ 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);
+ }
+}
+
+void
virtio_vring_set_numa_node (vlib_main_t * vm, virtio_if_t * vif, u32 idx)
{
vnet_main_t *vnm = vnet_get_main ();
@@ -320,6 +335,7 @@ virtio_show (vlib_main_t * vm, u32 * hw_if_indices, u8 show_descr, u32 type)
}
vlib_cli_output (vm, " gso-enabled %d", vif->gso_enabled);
vlib_cli_output (vm, " csum-enabled %d", vif->csum_offload_enabled);
+ vlib_cli_output (vm, " packet-coalesce %d", vif->packet_coalesce);
if (type & (VIRTIO_IF_TYPE_TAP | VIRTIO_IF_TYPE_PCI))
vlib_cli_output (vm, " Mac Address: %U", format_ethernet_address,
vif->mac_addr);
@@ -412,6 +428,11 @@ virtio_show (vlib_main_t * vm, u32 * hw_if_indices, u8 show_descr, u32 type)
vlib_cli_output (vm, " kickfd %d, callfd %d", vring->kick_fd,
vring->call_fd);
}
+ if (vring->flow_table)
+ {
+ vlib_cli_output (vm, " %U", gro_flow_table_format,
+ vring->flow_table);
+ }
if (show_descr)
{
vlib_cli_output (vm, "\n descriptor table:\n");