summaryrefslogtreecommitdiffstats
path: root/src/plugins/linux-cp/lcp_interface.c
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@yandex-team.ru>2023-10-07 23:04:03 +0500
committerMatthew Smith <mgsmith@netgate.com>2024-04-01 20:20:08 +0000
commit704d5a53e06d105c86822ea0cc20bb9c19f5b8d3 (patch)
tree0c81ea44788511e6a670bb5fd3dacff8a76865a7 /src/plugins/linux-cp/lcp_interface.c
parentd465fd0819853079c78ad3b6b1a86e2e05c3c142 (diff)
linux-cp: add support for tap num queues config
This change allows to limit lcp interface queues to be used by explicit host interface workers. Type: improvement Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: I0626f66021e5a5f251470156231dc44ddaea5ee6
Diffstat (limited to 'src/plugins/linux-cp/lcp_interface.c')
-rw-r--r--src/plugins/linux-cp/lcp_interface.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/linux-cp/lcp_interface.c b/src/plugins/linux-cp/lcp_interface.c
index 921dccf5519..e1f4a6a1d69 100644
--- a/src/plugins/linux-cp/lcp_interface.c
+++ b/src/plugins/linux-cp/lcp_interface.c
@@ -555,6 +555,7 @@ static clib_error_t *
lcp_itf_pair_config (vlib_main_t *vm, unformat_input_t *input)
{
u8 *default_ns;
+ u32 tmp;
default_ns = NULL;
@@ -579,6 +580,10 @@ lcp_itf_pair_config (vlib_main_t *vm, unformat_input_t *input)
lcp_set_del_static_on_link_down (1 /* is_del */);
else if (unformat (input, "del-dynamic-on-link-down"))
lcp_set_del_dynamic_on_link_down (1 /* is_del */);
+ else if (unformat (input, "num-rx-queues %d", &tmp))
+ lcp_set_default_num_queues (tmp, 0 /* is_tx */);
+ else if (unformat (input, "num-tx-queues %d", &tmp))
+ lcp_set_default_num_queues (tmp, 1 /* is_tx */);
else
return clib_error_return (0, "interfaces not found");
}
@@ -988,8 +993,10 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name,
else
{
tap_create_if_args_t args = {
- .num_rx_queues = clib_max (1, vlib_num_workers ()),
- .num_tx_queues = 1,
+ .num_rx_queues =
+ clib_max (1, lcp_get_default_num_queues (0 /* is_tx */)),
+ .num_tx_queues =
+ clib_max (1, lcp_get_default_num_queues (1 /* is_tx */)),
.id = hw->hw_if_index,
.sw_if_index = ~0,
.rx_ring_sz = 256,