gazelle/0035-cfg-nic-queue-size-only-support-power-of-2.patch
hantwofish af32524b45 sync solve problem that rte_pktmbuf_poll_creat in same numa .
(cherry picked from commit f9784aa3960e2a2fbb560a9d8e9d896b2848f8c4)
2023-11-18 15:23:40 +08:00

39 lines
1.3 KiB
Diff

From cb8d274804ccc9d9c5bb434d1c2e60aaf14e8fd5 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Wed, 8 Nov 2023 20:53:22 +0800
Subject: [PATCH] cfg: nic queue size only support power of 2
---
src/lstack/core/lstack_cfg.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c
index 8e83c0d..d2d0fc1 100644
--- a/src/lstack/core/lstack_cfg.c
+++ b/src/lstack/core/lstack_cfg.c
@@ -1191,6 +1191,10 @@ static int32_t parse_nic_rxqueue_size(void)
int32_t ret;
PARSE_ARG(g_config_params.nic.rxqueue_size, "nic_rxqueue_size", 4096,
NIC_QUEUE_SIZE_MIN, NIC_QUEUE_SIZE_MAX, ret);
+ if (!rte_is_power_of_2(g_config_params.nic.rxqueue_size)) {
+ LSTACK_LOG(ERR, LSTACK, "nic queue size only support power of two\n");
+ return -1;
+ }
return ret;
}
@@ -1199,6 +1203,10 @@ static int32_t parse_nic_txqueue_size(void)
int32_t ret;
PARSE_ARG(g_config_params.nic.txqueue_size, "nic_txqueue_size", 2048,
NIC_QUEUE_SIZE_MIN, NIC_QUEUE_SIZE_MAX, ret);
+ if (!rte_is_power_of_2(g_config_params.nic.txqueue_size)) {
+ LSTACK_LOG(ERR, LSTACK, "nic queue size only support power of two\n");
+ return -1;
+ }
return ret;
}
--
2.23.0