sync fix parse args error
(cherry picked from commit bd0ed84f53a544848baca8e05e7461e655bf425a)
This commit is contained in:
parent
960376ea5f
commit
7a774e424c
27
0212-fix-kernel-scoket-select-path-error.patch
Normal file
27
0212-fix-kernel-scoket-select-path-error.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From 551fbc433a51eb34dd353236391f6d844866f67c Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng12 <jiangheng14@huawei.com>
|
||||
Date: Sat, 18 Mar 2023 19:36:38 +0800
|
||||
Subject: [PATCH] fix kernel scoket select path error
|
||||
|
||||
---
|
||||
src/lstack/api/lstack_wrap.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
|
||||
index 9a021d7..e1b82fc 100644
|
||||
--- a/src/lstack/api/lstack_wrap.c
|
||||
+++ b/src/lstack/api/lstack_wrap.c
|
||||
@@ -88,7 +88,9 @@ static enum KERNEL_LWIP_PATH select_path(int fd)
|
||||
}
|
||||
|
||||
struct tcp_pcb *pcb = sock->conn->pcb.tcp;
|
||||
- if (pcb != NULL && pcb->state <= ESTABLISHED) {
|
||||
+ /* after lwip connect, call send immediately, pcb->state is SYN_SENT, need return PATH_LWIP */
|
||||
+ /* pcb->state default value is CLOSED when call socket, need return PATH_UNKNOW */
|
||||
+ if (pcb != NULL && pcb->state <= ESTABLISHED && pcb->state >= LISTEN) {
|
||||
return PATH_LWIP;
|
||||
}
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
299
0213-discard-wakeup_num-parameter.patch
Normal file
299
0213-discard-wakeup_num-parameter.patch
Normal file
@ -0,0 +1,299 @@
|
||||
From 7692ad1681386e5ab27006ddbdcb530dfa887121 Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Mon, 20 Mar 2023 16:14:45 +0800
|
||||
Subject: [PATCH] discard wakeup_num parameter
|
||||
|
||||
---
|
||||
src/lstack/api/lstack_epoll.c | 15 +++----
|
||||
src/lstack/core/lstack_cfg.c | 39 -----------------
|
||||
src/lstack/core/lstack_dpdk.c | 8 ----
|
||||
src/lstack/core/lstack_protocol_stack.c | 51 ++--------------------
|
||||
src/lstack/include/lstack_cfg.h | 2 -
|
||||
src/lstack/include/lstack_protocol_stack.h | 1 -
|
||||
src/lstack/include/posix/lstack_epoll.h | 2 +-
|
||||
src/lstack/lstack.conf | 3 --
|
||||
8 files changed, 9 insertions(+), 112 deletions(-)
|
||||
|
||||
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
|
||||
index 4a10b09..d4b4be7 100644
|
||||
--- a/src/lstack/api/lstack_epoll.c
|
||||
+++ b/src/lstack/api/lstack_epoll.c
|
||||
@@ -79,7 +79,7 @@ void add_sock_event(struct lwip_sock *sock, uint32_t event)
|
||||
}
|
||||
}
|
||||
|
||||
-void wakeup_stack_epoll(struct protocol_stack *stack, bool wakeup_thread_enable)
|
||||
+void wakeup_stack_epoll(struct protocol_stack *stack)
|
||||
{
|
||||
struct list_node *node, *temp;
|
||||
|
||||
@@ -97,15 +97,10 @@ void wakeup_stack_epoll(struct protocol_stack *stack, bool wakeup_thread_enable)
|
||||
|
||||
struct wakeup_poll *wakeup = container_of((node - stack->stack_idx), struct wakeup_poll, wakeup_list);
|
||||
|
||||
- if (!wakeup_thread_enable) {
|
||||
- if (__atomic_load_n(&wakeup->in_wait, __ATOMIC_ACQUIRE)) {
|
||||
- __atomic_store_n(&wakeup->in_wait, false, __ATOMIC_RELEASE);
|
||||
- rte_mb();
|
||||
- pthread_mutex_unlock(&wakeup->wait);
|
||||
- stack->stats.wakeup_events++;
|
||||
- }
|
||||
- } else {
|
||||
- gazelle_light_ring_enqueue_busrt(stack->wakeup_ring, (void **)&wakeup, 1);
|
||||
+ if (__atomic_load_n(&wakeup->in_wait, __ATOMIC_ACQUIRE)) {
|
||||
+ __atomic_store_n(&wakeup->in_wait, false, __ATOMIC_RELEASE);
|
||||
+ rte_mb();
|
||||
+ pthread_mutex_unlock(&wakeup->wait);
|
||||
stack->stats.wakeup_events++;
|
||||
}
|
||||
|
||||
diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c
|
||||
index 88f69e1..4164b0e 100644
|
||||
--- a/src/lstack/core/lstack_cfg.c
|
||||
+++ b/src/lstack/core/lstack_cfg.c
|
||||
@@ -48,7 +48,6 @@ static int32_t parse_host_addr(void);
|
||||
static int32_t parse_low_power_mode(void);
|
||||
static int32_t parse_stack_cpu_number(void);
|
||||
static int32_t parse_use_ltran(void);
|
||||
-static int32_t parse_wakeup_cpu_number(void);
|
||||
static int32_t parse_mask_addr(void);
|
||||
static int32_t parse_devices(void);
|
||||
static int32_t parse_dpdk_args(void);
|
||||
@@ -104,7 +103,6 @@ static struct config_vector_t g_config_tbl[] = {
|
||||
{ "dpdk_args", parse_dpdk_args },
|
||||
{ "seperate_send_recv", parse_seperate_sendrecv_args },
|
||||
{ "num_cpus", parse_stack_cpu_number },
|
||||
- { "num_wakeup", parse_wakeup_cpu_number },
|
||||
{ "low_power_mode", parse_low_power_mode },
|
||||
{ "kni_switch", parse_kni_switch },
|
||||
{ "listen_shadow", parse_listen_shadow },
|
||||
@@ -450,9 +448,6 @@ int32_t init_stack_numa_cpuset(struct protocol_stack *stack)
|
||||
CPU_SET(cfg->recv_cpus[idx], &stack_cpuset);
|
||||
}
|
||||
}
|
||||
- for (int32_t idx = 0; idx < cfg->num_wakeup; ++idx) {
|
||||
- CPU_SET(cfg->wakeup[idx], &stack_cpuset);
|
||||
- }
|
||||
|
||||
ret = stack_idle_cpuset(stack, &stack_cpuset);
|
||||
if (ret < 0) {
|
||||
@@ -757,40 +752,6 @@ static int32_t parse_low_power_mode(void)
|
||||
return parse_int(&g_config_params.low_power_mod, "low_power_mode", 0, 0, 1);
|
||||
}
|
||||
|
||||
-static int32_t parse_wakeup_cpu_number(void)
|
||||
-{
|
||||
- const config_setting_t *cfg_args = NULL;
|
||||
- const char *args = NULL;
|
||||
-
|
||||
- g_config_params.num_wakeup = 0;
|
||||
-
|
||||
- cfg_args = config_lookup(&g_config, "num_wakeup");
|
||||
- if (cfg_args == NULL) {
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- args = config_setting_get_string(cfg_args);
|
||||
- if (cfg_args == NULL) {
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- char *tmp_arg = strdup(args);
|
||||
- int32_t cnt = separate_str_to_array(tmp_arg, g_config_params.wakeup, CFG_MAX_CPUS);
|
||||
- free(tmp_arg);
|
||||
- if (cnt <= 0 || cnt > CFG_MAX_CPUS) {
|
||||
- return -EINVAL;
|
||||
- }
|
||||
- g_config_params.num_wakeup = cnt;
|
||||
-
|
||||
- if (g_config_params.num_wakeup < g_config_params.num_cpu) {
|
||||
- LSTACK_PRE_LOG(LSTACK_ERR, "num_wakeup=%hu less than num_stack_cpu=%hu.\n", g_config_params.num_wakeup,
|
||||
- g_config_params.num_cpu);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static int32_t parse_use_ltran(void)
|
||||
{
|
||||
return parse_int(&g_config_params.use_ltran, "use_ltran", 1, 0, 1);
|
||||
diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c
|
||||
index 7ded9e9..ebfebaa 100644
|
||||
--- a/src/lstack/core/lstack_dpdk.c
|
||||
+++ b/src/lstack/core/lstack_dpdk.c
|
||||
@@ -237,14 +237,6 @@ int32_t create_shared_ring(struct protocol_stack *stack)
|
||||
{
|
||||
lockless_queue_init(&stack->rpc_queue);
|
||||
|
||||
- if (get_protocol_stack_group()->wakeup_enable) {
|
||||
- stack->wakeup_ring = create_ring("WAKEUP_RING", VDEV_WAKEUP_QUEUE_SZ, RING_F_SP_ENQ | RING_F_SC_DEQ,
|
||||
- stack->queue_id);
|
||||
- if (stack->wakeup_ring == NULL) {
|
||||
- return -1;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
if (use_ltran()) {
|
||||
stack->rx_ring = create_ring("RING_RX", VDEV_RX_QUEUE_SZ, RING_F_SP_ENQ | RING_F_SC_DEQ, stack->queue_id);
|
||||
if (stack->rx_ring == NULL) {
|
||||
diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c
|
||||
index 5e510bd..92300ef 100644
|
||||
--- a/src/lstack/core/lstack_protocol_stack.c
|
||||
+++ b/src/lstack/core/lstack_protocol_stack.c
|
||||
@@ -256,41 +256,6 @@ static int32_t create_thread(void *arg, char *thread_name, stack_thread_func fun
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void* gazelle_wakeup_thread(void *arg)
|
||||
-{
|
||||
- uint16_t queue_id = *(uint16_t *)arg;
|
||||
- struct protocol_stack *stack = get_protocol_stack_group()->stacks[queue_id];
|
||||
-
|
||||
- struct cfg_params *cfg = get_global_cfg_params();
|
||||
- int32_t lcore_id = cfg->wakeup[stack->stack_idx];
|
||||
- thread_affinity_init(lcore_id);
|
||||
-
|
||||
- struct timespec st = {
|
||||
- .tv_sec = 0,
|
||||
- .tv_nsec = 1
|
||||
- };
|
||||
-
|
||||
- LSTACK_LOG(INFO, LSTACK, "weakup_%02hu start\n", stack->queue_id);
|
||||
-
|
||||
- for (;;) {
|
||||
- if (cfg->low_power_mod != 0 && stack->low_power) {
|
||||
- nanosleep(&st, NULL);
|
||||
- }
|
||||
-
|
||||
- struct wakeup_poll *wakeup[WAKEUP_MAX_NUM];
|
||||
- uint32_t num = gazelle_light_ring_dequeue_burst(stack->wakeup_ring, (void **)wakeup, WAKEUP_MAX_NUM);
|
||||
- for (uint32_t i = 0; i < num; i++) {
|
||||
- if (__atomic_load_n(&wakeup[i]->in_wait, __ATOMIC_ACQUIRE)) {
|
||||
- __atomic_store_n(&wakeup[i]->in_wait, false, __ATOMIC_RELEASE);
|
||||
- rte_mb();
|
||||
- pthread_mutex_unlock(&wakeup[i]->wait);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return NULL;
|
||||
-}
|
||||
-
|
||||
static void* gazelle_kernelevent_thread(void *arg)
|
||||
{
|
||||
struct thread_params *t_params = (struct thread_params*) arg;
|
||||
@@ -374,16 +339,8 @@ void wait_sem_value(sem_t *sem, int32_t wait_value)
|
||||
} while (sem_val < wait_value);
|
||||
}
|
||||
|
||||
-static int32_t create_affiliate_thread(void *arg, bool wakeup_enable)
|
||||
+static int32_t create_affiliate_thread(void *arg)
|
||||
{
|
||||
-
|
||||
- if (wakeup_enable) {
|
||||
- if (create_thread(arg, "gazelleweakup", gazelle_wakeup_thread) != 0) {
|
||||
- LSTACK_LOG(ERR, LSTACK, "gazelleweakup errno=%d\n", errno);
|
||||
- return -1;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
if (create_thread(arg, "gazellekernel", gazelle_kernelevent_thread) != 0) {
|
||||
LSTACK_LOG(ERR, LSTACK, "gazellekernel errno=%d\n", errno);
|
||||
return -1;
|
||||
@@ -409,7 +366,7 @@ static struct protocol_stack *stack_thread_init(void *arg)
|
||||
if (init_stack_numa_cpuset(stack) < 0) {
|
||||
goto END;
|
||||
}
|
||||
- if (create_affiliate_thread(arg, stack_group->wakeup_enable) < 0) {
|
||||
+ if (create_affiliate_thread(arg) < 0) {
|
||||
goto END;
|
||||
}
|
||||
|
||||
@@ -484,7 +441,6 @@ static void* gazelle_stack_thread(void *arg)
|
||||
uint16_t low_power_mod = cfg->low_power_mod;
|
||||
uint32_t wakeup_tick = 0;
|
||||
struct protocol_stack_group *stack_group = get_protocol_stack_group();
|
||||
- bool wakeup_thread_enable = stack_group->wakeup_enable;
|
||||
|
||||
struct protocol_stack *stack = stack_thread_init(arg);
|
||||
|
||||
@@ -516,7 +472,7 @@ static void* gazelle_stack_thread(void *arg)
|
||||
|
||||
if ((wakeup_tick & 0xf) == 0) {
|
||||
wakeup_kernel_event(stack);
|
||||
- wakeup_stack_epoll(stack, wakeup_thread_enable);
|
||||
+ wakeup_stack_epoll(stack);
|
||||
}
|
||||
|
||||
/* KNI requests are generally low-rate I/Os,
|
||||
@@ -583,7 +539,6 @@ int32_t init_protocol_stack(void)
|
||||
stack_group->stack_num = get_global_cfg_params()->num_cpu * 2;
|
||||
}
|
||||
|
||||
- stack_group->wakeup_enable = (get_global_cfg_params()->num_wakeup > 0) ? true : false;
|
||||
init_list_node(&stack_group->poll_list);
|
||||
pthread_spin_init(&stack_group->poll_list_lock, PTHREAD_PROCESS_PRIVATE);
|
||||
|
||||
diff --git a/src/lstack/include/lstack_cfg.h b/src/lstack/include/lstack_cfg.h
|
||||
index 5f8e6b3..16f37b4 100644
|
||||
--- a/src/lstack/include/lstack_cfg.h
|
||||
+++ b/src/lstack/include/lstack_cfg.h
|
||||
@@ -67,8 +67,6 @@ struct cfg_params {
|
||||
uint32_t cpus[CFG_MAX_CPUS];
|
||||
uint32_t send_cpus[CFG_MAX_CPUS];
|
||||
uint32_t recv_cpus[CFG_MAX_CPUS];
|
||||
- uint16_t num_wakeup;
|
||||
- uint32_t wakeup[CFG_MAX_CPUS];
|
||||
uint8_t num_ports;
|
||||
uint16_t ports[CFG_MAX_PORTS];
|
||||
char log_file[PATH_MAX];
|
||||
diff --git a/src/lstack/include/lstack_protocol_stack.h b/src/lstack/include/lstack_protocol_stack.h
|
||||
index 3691250..001ab47 100644
|
||||
--- a/src/lstack/include/lstack_protocol_stack.h
|
||||
+++ b/src/lstack/include/lstack_protocol_stack.h
|
||||
@@ -95,7 +95,6 @@ struct protocol_stack_group {
|
||||
struct rte_mempool *kni_pktmbuf_pool;
|
||||
struct eth_params *eth_params;
|
||||
struct protocol_stack *stacks[PROTOCOL_STACK_MAX];
|
||||
- bool wakeup_enable;
|
||||
struct list_node poll_list;
|
||||
pthread_spinlock_t poll_list_lock;
|
||||
sem_t sem_listen_thread;
|
||||
diff --git a/src/lstack/include/posix/lstack_epoll.h b/src/lstack/include/posix/lstack_epoll.h
|
||||
index 6aa9d30..d6c81a7 100644
|
||||
--- a/src/lstack/include/posix/lstack_epoll.h
|
||||
+++ b/src/lstack/include/posix/lstack_epoll.h
|
||||
@@ -64,7 +64,7 @@ struct wakeup_poll {
|
||||
struct netconn;
|
||||
struct lwip_sock;
|
||||
void add_sock_event(struct lwip_sock *sock, uint32_t event);
|
||||
-void wakeup_stack_epoll(struct protocol_stack *stack, bool wakeup_thread_enable);
|
||||
+void wakeup_stack_epoll(struct protocol_stack *stack);
|
||||
int32_t lstack_epoll_create(int32_t size);
|
||||
int32_t lstack_epoll_create1(int32_t flags);
|
||||
int32_t lstack_epoll_ctl(int32_t epfd, int32_t op, int32_t fd, struct epoll_event *event);
|
||||
diff --git a/src/lstack/lstack.conf b/src/lstack/lstack.conf
|
||||
index 64a2f42..81da10a 100644
|
||||
--- a/src/lstack/lstack.conf
|
||||
+++ b/src/lstack/lstack.conf
|
||||
@@ -14,7 +14,6 @@ use_ltran=1
|
||||
kni_switch=0
|
||||
|
||||
low_power_mode=0
|
||||
-listen_shadow=0
|
||||
|
||||
#needed mbuf count = tcp_conn_count * mbuf_count_per_conn
|
||||
tcp_conn_count = 1500
|
||||
@@ -37,8 +36,6 @@ nic_read_number = 128
|
||||
|
||||
#each cpu core start a protocol stack thread.
|
||||
num_cpus="2"
|
||||
-#each cpu core start a wakeup thread.
|
||||
-#num_wakeup="3"
|
||||
|
||||
#app worker thread bind to numa in epoll/poll.
|
||||
app_bind_numa=1
|
||||
--
|
||||
2.23.0
|
||||
|
||||
207
0214-fix-parse-args-error.patch
Normal file
207
0214-fix-parse-args-error.patch
Normal file
@ -0,0 +1,207 @@
|
||||
From 6bdabdb8a18ab44559a2a824cbc45ae09ccc5341 Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Mon, 20 Mar 2023 20:27:01 +0800
|
||||
Subject: [PATCH] fix parse args error
|
||||
|
||||
---
|
||||
src/lstack/core/lstack_cfg.c | 109 +++++++++++++++++++++++------------
|
||||
1 file changed, 71 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c
|
||||
index 4164b0e..bed102e 100644
|
||||
--- a/src/lstack/core/lstack_cfg.c
|
||||
+++ b/src/lstack/core/lstack_cfg.c
|
||||
@@ -70,24 +70,25 @@ static int32_t parse_process_index(void);
|
||||
static int32_t parse_seperate_sendrecv_args(void);
|
||||
static int32_t parse_tuple_filter(void);
|
||||
|
||||
-static inline int32_t parse_int(void *arg, char * arg_string, int32_t default_val,
|
||||
- int32_t min_val, int32_t max_val)
|
||||
-{
|
||||
- const config_setting_t *config_arg = NULL;
|
||||
- config_arg = config_lookup(&g_config, arg_string);
|
||||
- if (config_arg == NULL) {
|
||||
- *(int32_t *)arg = default_val;
|
||||
- return 0;
|
||||
- }
|
||||
- int32_t val = config_setting_get_int(config_arg);
|
||||
- if (val < min_val || val > max_val) {
|
||||
- LSTACK_PRE_LOG(LSTACK_ERR, "cfg %s %d invaild, range is [%d, %d].\n",
|
||||
- arg_string, val, min_val, max_val);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
- *(int32_t *)arg = val;
|
||||
- return 0;
|
||||
-}
|
||||
+#define PARSE_ARG(_arg, _arg_string, _default_val, _min_val, _max_val, _ret) \
|
||||
+ do { \
|
||||
+ const config_setting_t *_config_arg = NULL; \
|
||||
+ _config_arg = config_lookup(&g_config, _arg_string); \
|
||||
+ if (_config_arg == NULL) { \
|
||||
+ _arg = _default_val; \
|
||||
+ _ret = 0; \
|
||||
+ break; \
|
||||
+ } \
|
||||
+ int32_t _val = config_setting_get_int(_config_arg); \
|
||||
+ if (_val < _min_val || _val > _max_val) { \
|
||||
+ LSTACK_PRE_LOG(LSTACK_ERR, "cfg %s %d invaild, range is [%d, %d].\n", \
|
||||
+ _arg_string, _val, _min_val, _max_val); \
|
||||
+ _ret = -EINVAL; \
|
||||
+ break; \
|
||||
+ } \
|
||||
+ _arg = _val; \
|
||||
+ _ret = 0; \
|
||||
+ } while (0)
|
||||
|
||||
struct config_vector_t {
|
||||
const char *name;
|
||||
@@ -744,78 +745,104 @@ free_dpdk_args:
|
||||
|
||||
static int32_t parse_low_power_mode(void)
|
||||
{
|
||||
+ int32_t ret;
|
||||
/* Set parameter default value */
|
||||
g_config_params.lpm_detect_ms = LSTACK_LPM_DETECT_MS;
|
||||
g_config_params.lpm_rx_pkts = LSTACK_LPM_RX_PKTS;
|
||||
g_config_params.lpm_pkts_in_detect = LSTACK_LPM_PKTS_IN_DETECT;
|
||||
|
||||
- return parse_int(&g_config_params.low_power_mod, "low_power_mode", 0, 0, 1);
|
||||
+ PARSE_ARG(g_config_params.low_power_mod, "low_power_mode", 0, 0, 1, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_use_ltran(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.use_ltran, "use_ltran", 1, 0, 1);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.use_ltran, "use_ltran", 1, 0, 1, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_tcp_conn_count(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.tcp_conn_count, "tcp_conn_count", TCP_CONN_COUNT, 1, TCP_CONN_COUNT);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.tcp_conn_count, "tcp_conn_count", TCP_CONN_COUNT, 1, TCP_CONN_COUNT, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_send_ring_size(void)
|
||||
{
|
||||
+ int32_t ret;
|
||||
/* send ring size default value is 32 */
|
||||
- return parse_int(&g_config_params.send_ring_size, "send_ring_size", 32, 1, SOCK_SEND_RING_SIZE_MAX);
|
||||
+ PARSE_ARG(g_config_params.send_ring_size, "send_ring_size", 32, 1, SOCK_SEND_RING_SIZE_MAX, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_expand_send_ring(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.expand_send_ring, "expand_send_ring", 0, 0, 1);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.expand_send_ring, "expand_send_ring", 0, 0, 1, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_mbuf_count_per_conn(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.mbuf_count_per_conn, "mbuf_count_per_conn",
|
||||
- MBUF_COUNT_PER_CONN, 1, INT32_MAX);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.mbuf_count_per_conn, "mbuf_count_per_conn",
|
||||
+ MBUF_COUNT_PER_CONN, 1, INT32_MAX, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_read_connect_number(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.read_connect_number, "read_connect_number",
|
||||
- STACK_THREAD_DEFAULT, 1, INT32_MAX);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.read_connect_number, "read_connect_number",
|
||||
+ STACK_THREAD_DEFAULT, 1, INT32_MAX, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_rpc_number(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.rpc_number, "rpc_number",
|
||||
- STACK_THREAD_DEFAULT, 1, INT32_MAX);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.rpc_number, "rpc_number",
|
||||
+ STACK_THREAD_DEFAULT, 1, INT32_MAX, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_nic_read_number(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.nic_read_number, "nic_read_number",
|
||||
- STACK_NIC_READ_DEFAULT, 1, INT32_MAX);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.nic_read_number, "nic_read_number",
|
||||
+ STACK_NIC_READ_DEFAULT, 1, INT32_MAX, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_listen_shadow(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.listen_shadow, "listen_shadow", 0, 0, 1);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.listen_shadow, "listen_shadow", 0, 0, 1, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_app_bind_numa(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.app_bind_numa, "app_bind_numa", 1, 0, 1);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.app_bind_numa, "app_bind_numa", 1, 0, 1, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_main_thread_affinity(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.main_thread_affinity, "main_thread_affinity", 0, 0, 1);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.main_thread_affinity, "main_thread_affinity", 0, 0, 1, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_kni_switch(void)
|
||||
{
|
||||
- if (parse_int(&g_config_params.kni_switch, "kni_switch", 0, 0, 1) != 0) {
|
||||
- return -1;
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.kni_switch, "kni_switch", 0, 0, 1, ret);
|
||||
+ if (ret != 0) {
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
if (g_config_params.use_ltran && g_config_params.kni_switch) {
|
||||
@@ -926,7 +953,9 @@ static int32_t parse_unix_prefix(void)
|
||||
|
||||
static int32_t parse_seperate_sendrecv_args(void)
|
||||
{
|
||||
- return parse_int(&g_config_params.seperate_send_recv, "seperate_send_recv", 0, 0, 1);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.seperate_send_recv, "seperate_send_recv", 0, 0, 1, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int32_t parse_num_process(void)
|
||||
@@ -995,7 +1024,11 @@ static int parse_process_index(void)
|
||||
|
||||
static int parse_tuple_filter(void)
|
||||
{
|
||||
- parse_int(&g_config_params.tuple_filter, "tuple_filter", 0, 0, 1);
|
||||
+ int32_t ret;
|
||||
+ PARSE_ARG(g_config_params.tuple_filter, "tuple_filter", 0, 0, 1, ret);
|
||||
+ if (ret != 0) {
|
||||
+ return ret;
|
||||
+ }
|
||||
if (g_config_params.tuple_filter == 0) {
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
10
gazelle.spec
10
gazelle.spec
@ -2,7 +2,7 @@
|
||||
|
||||
Name: gazelle
|
||||
Version: 1.0.1
|
||||
Release: 52
|
||||
Release: 53
|
||||
Summary: gazelle is a high performance user-mode stack
|
||||
License: MulanPSL-2.0
|
||||
URL: https://gitee.com/openeuler/gazelle
|
||||
@ -226,6 +226,9 @@ Patch9208: 0208-add-tuple-filter-in-conf-to-diff-rss-rule-and-tuple-.patch
|
||||
Patch9209: 0210-disable-tso-without-ipv4-checksum.patch
|
||||
Patch9210: 0210-support-tuple-rule-add-delete.patch
|
||||
Patch9211: 0211-refactor-mbuf-private-data.patch
|
||||
Patch9212: 0212-fix-kernel-scoket-select-path-error.patch
|
||||
Patch9213: 0213-discard-wakeup_num-parameter.patch
|
||||
Patch9214: 0214-fix-parse-args-error.patch
|
||||
|
||||
%description
|
||||
%{name} is a high performance user-mode stack.
|
||||
@ -266,6 +269,11 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b
|
||||
%config(noreplace) %{conf_path}/ltran.conf
|
||||
|
||||
%changelog
|
||||
* Tue Mar 21 2023 jiangheng12 <jiangheng14@huawei.com> - 1.0.1-53
|
||||
- fix parse args error
|
||||
- discard wakeup_num parameter
|
||||
- fix kernel scoket select path error
|
||||
|
||||
* Sat Mar 18 2023 jiangheng<jiangheng14@huawei.com> - 1.0.1-52
|
||||
- add pbuf lock when aggregate pbuf
|
||||
- support multi process
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user