virtio: place the event fds on worker threads for pci device 10/31410/2
authorMohsin Kazmi <sykazmi@cisco.com>
Tue, 23 Feb 2021 11:46:14 +0000 (12:46 +0100)
committerBeno�t Ganne <bganne@cisco.com>
Fri, 26 Feb 2021 17:27:26 +0000 (17:27 +0000)
Type: improvement

Change-Id: I8322bca1a9aa75c97c0fe2ff24b2f65fc43242ce
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
src/vnet/devices/virtio/virtio.c

index 2e49c79..4f812b1 100644 (file)
@@ -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);
 }