summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/device.c
diff options
context:
space:
mode:
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;