From: Robert Shearman Date: Tue, 6 Jul 2021 09:34:52 +0000 (+0100) Subject: dpdk: enable RX interrupts for the virtio driver X-Git-Tag: v22.02-rc0~192 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F33008%2F3;p=vpp.git 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 --- 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 */