From: Mohsin Kazmi Date: Tue, 23 Feb 2021 11:46:14 +0000 (+0100) Subject: virtio: place the event fds on worker threads for pci device X-Git-Tag: v21.10-rc0~456 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F10%2F31410%2F2;p=vpp.git virtio: place the event fds on worker threads for pci device Type: improvement Change-Id: I8322bca1a9aa75c97c0fe2ff24b2f65fc43242ce Signed-off-by: Mohsin Kazmi --- diff --git a/src/vnet/devices/virtio/virtio.c b/src/vnet/devices/virtio/virtio.c index 2e49c798c7c..4f812b1e7aa 100644 --- a/src/vnet/devices/virtio/virtio.c +++ b/src/vnet/devices/virtio/virtio.c @@ -225,6 +225,7 @@ virtio_vring_set_rx_queues (vlib_main_t *vm, virtio_if_t *vif) { vnet_main_t *vnm = vnet_get_main (); virtio_vring_t *vring; + u32 i = 0; vnet_hw_if_set_input_node (vnm, vif->hw_if_index, virtio_input_node.index); @@ -251,6 +252,16 @@ virtio_vring_set_rx_queues (vlib_main_t *vm, virtio_if_t *vif) vnet_hw_if_set_rx_queue_file_index (vnm, vring->queue_index, vring->call_file_index); } + else if ((vif->type == VIRTIO_IF_TYPE_PCI) && (vif->support_int_mode) && + (vif->msix_enabled == VIRTIO_MSIX_ENABLED)) + { + u32 file_index; + file_index = + vlib_pci_get_msix_file_index (vm, vif->pci_dev_handle, i + 1); + vnet_hw_if_set_rx_queue_file_index (vnm, vring->queue_index, + file_index); + i++; + } } vnet_hw_if_update_runtime_data (vnm, vif->hw_if_index); }