From 9f2d8bbfa2a6eea255c76de4230e28e91210809a Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Tue, 6 Jul 2021 10:34:52 +0100 Subject: 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 Change-Id: I29527b6f04b0b1d0c9f9424751b2bd252ed10505 --- src/plugins/dpdk/device/init.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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 */ -- cgit 1.2.3-korg