aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2019-01-31 13:18:00 +0000
committerDamjan Marion <dmarion@me.com>2019-02-06 17:27:44 +0000
commit80659b4624d55e2d293198b06c5c6077b3ba816b (patch)
tree195b39ddfd4fbc5642eb58da482c3c0c990b7a7d /src/vnet/devices/virtio/virtio.c
parentef20f0eff7f0e6ed75f316eb7080aa655de077ff (diff)
virtio: Use new buffer optimization
Change-Id: Ifc98373371b967c49a75989eac415ddda1dcf15f 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.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/virtio.c b/src/vnet/devices/virtio/virtio.c
index 94f140dac97..cfeb30246f0 100644
--- a/src/vnet/devices/virtio/virtio.c
+++ b/src/vnet/devices/virtio/virtio.c
@@ -196,6 +196,21 @@ virtio_vring_free (vlib_main_t * vm, virtio_if_t * vif, u32 idx)
return 0;
}
+void
+virtio_vring_set_numa_node (vlib_main_t * vm, virtio_if_t * vif, u32 idx)
+{
+ vnet_main_t *vnm = vnet_get_main ();
+ u32 thread_index;
+ virtio_vring_t *vring = vec_elt_at_index (vif->vrings, idx);
+ thread_index =
+ vnet_get_device_input_thread_index (vnm, vif->hw_if_index,
+ vring->queue_id);
+ vring->buffer_pool_index =
+ vlib_buffer_pool_get_default_for_numa (vm,
+ vlib_mains
+ [thread_index]->numa_node);
+}
+
inline void
virtio_set_net_hdr_size (virtio_if_t * vif)
{