summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/init.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2022-03-31 21:59:15 +0000
committerDamjan Marion <dmarion@me.com>2022-04-08 16:17:49 +0000
commit90998bc00253730fc640d51e9995e71c2abbd6d0 (patch)
tree9ce9e907902ebde860ecc023d8306a08ccf569dd /src/plugins/dpdk/device/init.c
parentbf91b48cbba65336de2043028f54b4b813325f3d (diff)
dpdk: add multi-txq support
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I9f061a05d947bc2867e1b962bf0522ad344bcc1a
Diffstat (limited to 'src/plugins/dpdk/device/init.c')
-rw-r--r--src/plugins/dpdk/device/init.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 13cecda9bf4..6d3b8643147 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -24,6 +24,7 @@
#include <vnet/vnet.h>
#include <vnet/ethernet/ethernet.h>
#include <vnet/interface/rx_queue_funcs.h>
+#include <vnet/interface/tx_queue_funcs.h>
#include <dpdk/buffer.h>
#include <dpdk/device/dpdk.h>
#include <dpdk/cryptodev/cryptodev.h>
@@ -429,6 +430,8 @@ dpdk_lib_init (dpdk_main_t * dm)
vec_validate_aligned (xd->rx_queues, xd->conf.n_rx_queues - 1,
CLIB_CACHE_LINE_BYTES);
+ vec_validate_aligned (xd->tx_queues, xd->conf.n_tx_queues - 1,
+ CLIB_CACHE_LINE_BYTES);
rte_eth_macaddr_get (port_id, (void *) addr);
@@ -469,6 +472,19 @@ dpdk_lib_init (dpdk_main_t * dm)
vnm, xd->hw_if_index, q, VNET_HW_IF_RXQ_THREAD_ANY);
}
+ for (q = 0; q < xd->conf.n_tx_queues; q++)
+ {
+ dpdk_tx_queue_t *txq = vec_elt_at_index (xd->tx_queues, q);
+ txq->queue_index =
+ vnet_hw_if_register_tx_queue (vnm, xd->hw_if_index, q);
+ }
+
+ for (q = 0; q < tm->n_vlib_mains; q++)
+ {
+ u32 qi = xd->tx_queues[q % xd->conf.n_tx_queues].queue_index;
+ vnet_hw_if_tx_queue_assign_thread (vnm, qi, q);
+ }
+
if (devconf->tso == DPDK_DEVICE_TSO_ON)
{
/*tcp_udp checksum must be enabled*/