From 55203e745f5e3f1f6c4dbe99d6eab8dee4d13ea6 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Fri, 10 May 2019 17:28:28 +0200 Subject: Tap: Fix the indirect buffers allocation VPP-1660 Indirect buffers are used to store indirect descriptors to xmit big packets. This patch moves the indirect buffer allocation from interface creation to device node. Now it allocates or deallocates buffers during tx for chained buffers. Change-Id: I55cec208a2a7432e12fe9254a7f8ef84a9302bd5 Signed-off-by: Mohsin Kazmi --- src/vnet/devices/virtio/pci.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/vnet/devices/virtio/pci.c') diff --git a/src/vnet/devices/virtio/pci.c b/src/vnet/devices/virtio/pci.c index 31027f7f687..5076d9f4dbd 100644 --- a/src/vnet/devices/virtio/pci.c +++ b/src/vnet/devices/virtio/pci.c @@ -679,20 +679,8 @@ virtio_pci_vring_init (vlib_main_t * vm, virtio_if_t * vif, u16 queue_num) ASSERT (vring->buffers == 0); vec_validate_aligned (vring->buffers, queue_size, CLIB_CACHE_LINE_BYTES); - ASSERT (vring->indirect_buffers == 0); - vec_validate_aligned (vring->indirect_buffers, queue_size, - CLIB_CACHE_LINE_BYTES); if (queue_num % 2) { - u32 n_alloc = 0; - do - { - if (n_alloc < queue_size) - n_alloc = - vlib_buffer_alloc (vm, vring->indirect_buffers + n_alloc, - queue_size - n_alloc); - } - while (n_alloc != queue_size); vif->num_txqs++; virtio_log_debug (vim, vif, "tx-queue: number %u, size %u", queue_num, queue_size); @@ -1239,7 +1227,6 @@ virtio_pci_delete_if (vlib_main_t * vm, virtio_if_t * vif) virtio_free_rx_buffers (vm, vring); } vec_free (vring->buffers); - vec_free (vring->indirect_buffers); vlib_physmem_free (vm, vring->desc); } @@ -1252,12 +1239,7 @@ virtio_pci_delete_if (vlib_main_t * vm, virtio_if_t * vif) { virtio_free_used_desc (vm, vring); } - if (vring->queue_id % 2) - { - vlib_buffer_free_no_next (vm, vring->indirect_buffers, vring->size); - } vec_free (vring->buffers); - vec_free (vring->indirect_buffers); vlib_physmem_free (vm, vring->desc); } -- cgit 1.2.3-korg