summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/device.c
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2021-03-18 12:02:08 +0100
committerFlorin Coras <florin.coras@gmail.com>2021-03-18 16:35:32 +0000
commit34c54dff5c66f9a4aef77daf08219301e15cc1fa (patch)
tree622dcfcedbd679e4ffed8278713374c7e2183f8b /src/plugins/dpdk/device/device.c
parentaa7a2a1f32c9a91ea1ba04aa661b6ccddac2a79f (diff)
dpdk: don't mask interrupts for some drivers
It is well known that for some NICs, masking interrupts results in delaying desc writebacks, which breaks poll mode. This fix introduces an "int-unmaskable" dpdk device flag to identify such devices (typically Intel FVL). For such devices, interrupts are masked by a call to file_update(...,UNIX_FILE_UPDATE_DELETE) instead of rte_eth_dev_rx_intr_disable (...) Change-Id: Ifbc701aebe8572319b7aae19382bd683a47fc3cf Type: fix Fixes: 19ff0c3699342b512c03362b3815df684a661f49 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Diffstat (limited to 'src/plugins/dpdk/device/device.c')
-rw-r--r--src/plugins/dpdk/device/device.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c
index 95678e9b0e2..be20b4f8551 100644
--- a/src/plugins/dpdk/device/device.c
+++ b/src/plugins/dpdk/device/device.c
@@ -22,6 +22,7 @@
#include <dpdk/device/dpdk.h>
#include <dpdk/device/dpdk_priv.h>
#include <vppinfra/error.h>
+#include <vlib/unix/unix.h>
#define foreach_dpdk_tx_func_error \
_(BAD_RETVAL, "DPDK tx function returned an error") \
@@ -701,13 +702,29 @@ dpdk_interface_rx_mode_change (vnet_main_t *vnm, u32 hw_if_index, u32 qid,
dpdk_main_t *xm = &dpdk_main;
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
dpdk_device_t *xd = vec_elt_at_index (xm->devices, hw->dev_instance);
+ clib_file_main_t *fm = &file_main;
+ dpdk_rx_queue_t *rxq;
+ clib_file_t *f;
int rv = 0;
if (!(xd->flags & DPDK_DEVICE_FLAG_INT_SUPPORTED))
return clib_error_return (0, "unsupported op (is the interface up?)", rv);
- if (mode == VNET_HW_IF_RX_MODE_POLLING)
+ if (mode == VNET_HW_IF_RX_MODE_POLLING &&
+ !(xd->flags & DPDK_DEVICE_FLAG_INT_UNMASKABLE))
rv = rte_eth_dev_rx_intr_disable (xd->port_id, qid);
- else
+ else if (mode == VNET_HW_IF_RX_MODE_POLLING)
+ {
+ rxq = vec_elt_at_index (xd->rx_queues, qid);
+ f = pool_elt_at_index (fm->file_pool, rxq->clib_file_index);
+ fm->file_update (f, UNIX_FILE_UPDATE_DELETE);
+ }
+ else if (!(xd->flags & DPDK_DEVICE_FLAG_INT_UNMASKABLE))
rv = rte_eth_dev_rx_intr_enable (xd->port_id, qid);
+ else
+ {
+ rxq = vec_elt_at_index (xd->rx_queues, qid);
+ f = pool_elt_at_index (fm->file_pool, rxq->clib_file_index);
+ fm->file_update (f, UNIX_FILE_UPDATE_ADD);
+ }
if (rv)
return clib_error_return (0, "dpdk_interface_rx_mode_change err %d", rv);
return 0;