From 704d5a53e06d105c86822ea0cc20bb9c19f5b8d3 Mon Sep 17 00:00:00 2001 From: Vladislav Grishenko Date: Sat, 7 Oct 2023 23:04:03 +0500 Subject: 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 Change-Id: I0626f66021e5a5f251470156231dc44ddaea5ee6 --- src/plugins/linux-cp/lcp.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/plugins/linux-cp/lcp.c') diff --git a/src/plugins/linux-cp/lcp.c b/src/plugins/linux-cp/lcp.c index 561ebb152ae..34e8550a13f 100644 --- a/src/plugins/linux-cp/lcp.c +++ b/src/plugins/linux-cp/lcp.c @@ -161,6 +161,28 @@ lcp_get_netlink_processing_active (void) return lcpm->netlink_processing_active; } +void +lcp_set_default_num_queues (u16 num_queues, u8 is_tx) +{ + lcp_main_t *lcpm = &lcp_main; + + if (is_tx) + lcpm->num_tx_queues = num_queues; + else + lcpm->num_rx_queues = num_queues; +} + +u16 +lcp_get_default_num_queues (u8 is_tx) +{ + lcp_main_t *lcpm = &lcp_main; + + if (is_tx) + return lcpm->num_tx_queues; + + return lcpm->num_rx_queues ?: vlib_num_workers (); +} + /* * fd.io coding-style-patch-verification: ON * -- cgit