aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device
diff options
context:
space:
mode:
authorRobert Shearman <robertshearman@gmail.com>2021-07-06 10:34:52 +0100
committerDamjan Marion <dmarion@me.com>2021-07-15 19:51:58 +0000
commit9f2d8bbfa2a6eea255c76de4230e28e91210809a (patch)
treed456c309e37560a9a979104c943cbaae1d218337 /src/plugins/dpdk/device
parent18991be8d334f1e6f6e82305d9472d2925b7a1ba (diff)
dpdk: enable RX interrupts for the virtio driver
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
Diffstat (limited to 'src/plugins/dpdk/device')
-rw-r--r--src/plugins/dpdk/device/init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index cf0203d187d..aebbb64dd76 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -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 */