diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2020-09-28 10:26:33 +0000 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2020-09-28 16:47:30 +0000 |
commit | e347acbc31111504c015531e8ad764a86d489309 (patch) | |
tree | 3a72d961fd97b9ce7985865d89b0c45d27cab2fc /src/vnet/devices/virtio/pci.c | |
parent | 7741afaf5c66a5d7ed1d2d76ae36a81ec24fdaaa (diff) |
virtio: add packet buffering on tx
Type: feature
This patch adds packet buffering on tx for
slow backend which have some jitter/delays
in freeing the vrings.
There are some limitations to the current design:
1) It only works in poll mode.
2) Atleast 1 rx queue of an interface (with buffering
enabled) should be placed on each worker and main thread.
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ib93c350298b228e80426e58ac77f3bbc93b8be27
Diffstat (limited to 'src/vnet/devices/virtio/pci.c')
-rw-r--r-- | src/vnet/devices/virtio/pci.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/pci.c b/src/vnet/devices/virtio/pci.c index df8e2bdaf68..71d813abfd7 100644 --- a/src/vnet/devices/virtio/pci.c +++ b/src/vnet/devices/virtio/pci.c @@ -1154,6 +1154,19 @@ virtio_pci_create_if (vlib_main_t * vm, virtio_pci_create_if_args_t * args) vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, vif->hw_if_index); hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE; + + if (args->virtio_flags & VIRTIO_FLAG_BUFFERING) + { + error = virtio_set_packet_buffering (vif, args->buffering_size); + if (error) + { + args->rv = VNET_API_ERROR_INIT_FAILED; + virtio_log_error (vif, + "error encountered during packet buffering init"); + goto error; + } + } + vnet_hw_interface_set_input_node (vnm, vif->hw_if_index, virtio_input_node.index); u32 i = 0; |