dpdk: enable RX interrupts for the virtio driver 08/33008/3
authorRobert Shearman <robertshearman@gmail.com>
Tue, 6 Jul 2021 09:34:52 +0000 (10:34 +0100)
committerDamjan Marion <dmarion@me.com>
Thu, 15 Jul 2021 19:51:58 +0000 (19:51 +0000)
Type: improvement

Request use of RX interrupts for virtio if the system will support it,
which is done by applying the same check as in the virtio driver,
namely whether multiple interrupts are supported. This allows the use
of RX adaptive/interrupt mode instead of just polling, which is useful
in virtualised environments where functionality may be more important
than performance and so using polling mode is wasteful.

Signed-off-by: Robert Shearman <robertshearman@gmail.com>
Change-Id: I29527b6f04b0b1d0c9f9424751b2bd252ed10505

src/plugins/dpdk/device/init.c

index cf0203d..aebbb64 100644 (file)
@@ -565,6 +565,14 @@ dpdk_lib_init (dpdk_main_t * dm)
              xd->port_type = VNET_DPDK_PORT_TYPE_ETH_1G;
              xd->nb_rx_desc = DPDK_NB_RX_DESC_VIRTIO;
              xd->nb_tx_desc = DPDK_NB_TX_DESC_VIRTIO;
+             /*
+              * Enable use of RX interrupts if supported.
+              *
+              * There is no device flag or capability for this, so
+              * use the same check that the virtio driver does.
+              */
+             if (pci_dev && rte_intr_cap_multiple (&pci_dev->intr_handle))
+               xd->port_conf.intr_conf.rxq = 1;
              break;
 
              /* vmxnet3 */