!411 [sync] PR-410: sync change send_ring_size 32 in lstack conf
From: @openeuler-sync-bot Reviewed-by: @jiangheng12 Signed-off-by: @jiangheng12
This commit is contained in:
commit
529c25eb24
133
0248-rpc-pool-use-dpdk-mempool-replace-array.patch
Normal file
133
0248-rpc-pool-use-dpdk-mempool-replace-array.patch
Normal file
@ -0,0 +1,133 @@
|
||||
From 795c15182d2dbeeb34982f274185b20920be195f Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Mon, 5 Sep 2022 09:49:10 +0800
|
||||
Subject: [PATCH] rpc pool use dpdk mempool replace array
|
||||
|
||||
---
|
||||
src/lstack/core/lstack_dpdk.c | 20 ++++++++++++++++++++
|
||||
src/lstack/core/lstack_thread_rpc.c | 22 +++++++++++++++-------
|
||||
src/lstack/include/lstack_dpdk.h | 2 ++
|
||||
src/lstack/include/lstack_thread_rpc.h | 7 +++----
|
||||
4 files changed, 40 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c
|
||||
index 169025c..1dab9a3 100644
|
||||
--- a/src/lstack/core/lstack_dpdk.c
|
||||
+++ b/src/lstack/core/lstack_dpdk.c
|
||||
@@ -217,6 +217,26 @@ int32_t pktmbuf_pool_init(struct protocol_stack *stack, uint16_t stack_num)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+struct rte_mempool *create_mempool(const char *name, uint32_t count, uint32_t size,
|
||||
+ uint32_t flags, int32_t idx)
|
||||
+{
|
||||
+ char pool_name [RTE_MEMPOOL_NAMESIZE];
|
||||
+ struct rte_mempool *mempool;
|
||||
+ int32_t ret = snprintf_s(pool_name, sizeof(pool_name), RTE_MEMPOOL_NAMESIZE - 1,
|
||||
+ "%s_%d", name, idx);
|
||||
+ if (ret < 0) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ mempool = rte_mempool_create(pool_name, count, size,
|
||||
+ 0, 0, NULL, NULL, NULL, NULL, rte_socket_id(), flags);
|
||||
+ if (mempool == NULL) {
|
||||
+ LSTACK_LOG(ERR, LSTACK, "%s create failed. errno: %d.\n", name, rte_errno);
|
||||
+ }
|
||||
+
|
||||
+ return mempool;
|
||||
+}
|
||||
+
|
||||
struct rte_ring *create_ring(const char *name, uint32_t count, uint32_t flags, int32_t queue_id)
|
||||
{
|
||||
char ring_name[RTE_RING_NAMESIZE] = {0};
|
||||
diff --git a/src/lstack/core/lstack_thread_rpc.c b/src/lstack/core/lstack_thread_rpc.c
|
||||
index fe3b757..1234bc6 100644
|
||||
--- a/src/lstack/core/lstack_thread_rpc.c
|
||||
+++ b/src/lstack/core/lstack_thread_rpc.c
|
||||
@@ -27,15 +27,15 @@ static PER_THREAD struct rpc_msg_pool *g_rpc_pool = NULL;
|
||||
|
||||
static inline __attribute__((always_inline)) struct rpc_msg *get_rpc_msg(struct rpc_msg_pool *rpc_pool)
|
||||
{
|
||||
- uint32_t cons = __atomic_load_n(&rpc_pool->cons, __ATOMIC_ACQUIRE);
|
||||
- uint32_t prod = rpc_pool->prod + 1;
|
||||
-
|
||||
- if (prod - cons >= RPC_MSG_MAX) {
|
||||
+ int ret;
|
||||
+ struct rpc_msg *msg = NULL;
|
||||
+ ret = rte_mempool_get(rpc_pool->rpc_pool, (void **)&msg);
|
||||
+ if (ret < 0) {
|
||||
+ LSTACK_LOG(INFO, LSTACK, "rpc pool empty!\n");
|
||||
+ errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
-
|
||||
- rpc_pool->prod = prod;
|
||||
- return &rpc_pool->msgs[prod & RPC_MSG_MASK];
|
||||
+ return msg;
|
||||
}
|
||||
|
||||
static struct rpc_msg *rpc_msg_alloc(struct protocol_stack *stack, rpc_msg_func func)
|
||||
@@ -49,6 +49,14 @@ static struct rpc_msg *rpc_msg_alloc(struct protocol_stack *stack, rpc_msg_func
|
||||
if (g_rpc_pool == NULL) {
|
||||
g_rpc_pool = calloc(1, sizeof(struct rpc_msg_pool));
|
||||
if (g_rpc_pool == NULL) {
|
||||
+ LSTACK_LOG(INFO, LSTACK, "g_rpc_pool calloc failed\n");
|
||||
+ get_protocol_stack_group()->call_alloc_fail++;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ g_rpc_pool->rpc_pool = create_mempool("rpc_pool", RPC_MSG_MAX, sizeof(struct rpc_msg),
|
||||
+ 0, rte_gettid());
|
||||
+ if (g_rpc_pool->rpc_pool == NULL) {
|
||||
get_protocol_stack_group()->call_alloc_fail++;
|
||||
return NULL;
|
||||
}
|
||||
diff --git a/src/lstack/include/lstack_dpdk.h b/src/lstack/include/lstack_dpdk.h
|
||||
index a189557..c233120 100644
|
||||
--- a/src/lstack/include/lstack_dpdk.h
|
||||
+++ b/src/lstack/include/lstack_dpdk.h
|
||||
@@ -44,6 +44,8 @@ int32_t fill_mbuf_to_ring(struct rte_mempool *mempool, struct rte_ring *ring, ui
|
||||
int32_t dpdk_eal_init(void);
|
||||
int32_t pktmbuf_pool_init(struct protocol_stack *stack, uint16_t stack_num);
|
||||
struct rte_ring *create_ring(const char *name, uint32_t count, uint32_t flags, int32_t queue_id);
|
||||
+struct rte_mempool *create_mempool(const char *name, uint32_t count, uint32_t size,
|
||||
+ uint32_t flags, int32_t idx);
|
||||
int32_t create_shared_ring(struct protocol_stack *stack);
|
||||
void lstack_log_level_init(void);
|
||||
int dpdk_ethdev_init(int port_id, bool bond_port);
|
||||
diff --git a/src/lstack/include/lstack_thread_rpc.h b/src/lstack/include/lstack_thread_rpc.h
|
||||
index 657ffa9..bcb40dd 100644
|
||||
--- a/src/lstack/include/lstack_thread_rpc.h
|
||||
+++ b/src/lstack/include/lstack_thread_rpc.h
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <pthread.h>
|
||||
#include <arch/sys_arch.h>
|
||||
+#include <rte_mempool.h>
|
||||
|
||||
#include "lstack_lockless_queue.h"
|
||||
|
||||
@@ -53,9 +54,7 @@ struct rpc_msg {
|
||||
};
|
||||
|
||||
struct rpc_msg_pool {
|
||||
- struct rpc_msg msgs[RPC_MSG_MAX];
|
||||
- uint32_t prod __rte_cache_aligned;
|
||||
- uint32_t cons __rte_cache_aligned;
|
||||
+ struct rte_mempool *rpc_pool;
|
||||
};
|
||||
|
||||
struct protocol_stack;
|
||||
@@ -99,7 +98,7 @@ static inline __attribute__((always_inline)) void rpc_msg_free(struct rpc_msg *m
|
||||
|
||||
msg->self_release = 0;
|
||||
|
||||
- __atomic_fetch_add((_Atomic uint32_t *)&msg->pool->cons, 1, __ATOMIC_SEQ_CST);
|
||||
+ rte_mempool_put(msg->pool->rpc_pool, (void *)msg);
|
||||
}
|
||||
|
||||
#endif
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,97 @@
|
||||
From 52a5607eb8f20ccbaf03c8046b29763c2081e24a Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Mon, 5 Sep 2022 14:46:46 +0800
|
||||
Subject: [PATCH] fix t_params use after free in kernel event thread
|
||||
|
||||
---
|
||||
src/lstack/core/lstack_protocol_stack.c | 30 +++++++++++++++----------
|
||||
1 file changed, 18 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c
|
||||
index 52a0c8f..a8c5e14 100644
|
||||
--- a/src/lstack/core/lstack_protocol_stack.c
|
||||
+++ b/src/lstack/core/lstack_protocol_stack.c
|
||||
@@ -263,7 +263,9 @@ static void* gazelle_kernelevent_thread(void *arg)
|
||||
struct thread_params *t_params = (struct thread_params*) arg;
|
||||
uint16_t idx = t_params->idx;
|
||||
struct protocol_stack *stack = get_protocol_stack_group()->stacks[idx];
|
||||
+ struct protocol_stack_group *stack_group = get_protocol_stack_group();
|
||||
|
||||
+ sem_post(&stack_group->thread_phase1);
|
||||
bind_to_stack_numa(stack);
|
||||
|
||||
LSTACK_LOG(INFO, LSTACK, "kernelevent_%02hu start\n", idx);
|
||||
@@ -358,23 +360,22 @@ static struct protocol_stack *stack_thread_init(void *arg)
|
||||
struct protocol_stack *stack = calloc(1, sizeof(*stack));
|
||||
if (stack == NULL) {
|
||||
LSTACK_LOG(ERR, LSTACK, "malloc stack failed\n");
|
||||
- sem_post(&stack_group->thread_phase1);
|
||||
- return NULL;
|
||||
+ goto END2;
|
||||
}
|
||||
|
||||
if (init_stack_value(stack, arg) != 0) {
|
||||
- goto END;
|
||||
+ goto END2;
|
||||
}
|
||||
|
||||
if (init_stack_numa_cpuset(stack) < 0) {
|
||||
- goto END;
|
||||
+ goto END2;
|
||||
}
|
||||
if (create_affiliate_thread(arg) < 0) {
|
||||
- goto END;
|
||||
+ goto END2;
|
||||
}
|
||||
|
||||
if (thread_affinity_init(stack->cpu_id) != 0) {
|
||||
- goto END;
|
||||
+ goto END1;
|
||||
}
|
||||
RTE_PER_LCORE(_lcore_id) = stack->cpu_id;
|
||||
|
||||
@@ -384,7 +385,7 @@ static struct protocol_stack *stack_thread_init(void *arg)
|
||||
|
||||
if (use_ltran()) {
|
||||
if (client_reg_thrd_ring() != 0) {
|
||||
- goto END;
|
||||
+ goto END1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,14 +398,18 @@ static struct protocol_stack *stack_thread_init(void *arg)
|
||||
usleep(SLEEP_US_BEFORE_LINK_UP);
|
||||
|
||||
if (ethdev_init(stack) != 0) {
|
||||
- free(stack);
|
||||
- return NULL;
|
||||
+ goto END1;
|
||||
}
|
||||
|
||||
return stack;
|
||||
-END:
|
||||
+/* kernel event thread dont create, stack thread post sem twice */
|
||||
+END2:
|
||||
+ sem_post(&stack_group->thread_phase1);
|
||||
+END1:
|
||||
sem_post(&stack_group->thread_phase1);
|
||||
- free(stack);
|
||||
+ if (stack != NULL) {
|
||||
+ free(stack);
|
||||
+ }
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -597,7 +602,8 @@ int32_t init_protocol_stack(void)
|
||||
}
|
||||
}
|
||||
|
||||
- wait_sem_value(&stack_group->thread_phase1, stack_group->stack_num);
|
||||
+ /* stack_num * 2: stack thread and kernel event thread will post sem */
|
||||
+ wait_sem_value(&stack_group->thread_phase1, stack_group->stack_num * 2);
|
||||
|
||||
for (int idx = 0; idx < queue_num; idx++){
|
||||
free(t_params[idx]);
|
||||
--
|
||||
2.27.0
|
||||
|
||||
241
0250-adapt-to-dpdk-19.11-and-dpdk-21.11.patch
Normal file
241
0250-adapt-to-dpdk-19.11-and-dpdk-21.11.patch
Normal file
@ -0,0 +1,241 @@
|
||||
From 9884a2bcbe74647a49fb3969211e12fa399da2a1 Mon Sep 17 00:00:00 2001
|
||||
From: Lemmy Huang <huangliming5@huawei.com>
|
||||
Date: Thu, 15 Jun 2023 13:07:33 +0800
|
||||
Subject: [PATCH] adapt to dpdk-19.11 and dpdk-21.11
|
||||
|
||||
Signed-off-by: Lemmy Huang <huangliming5@huawei.com>
|
||||
---
|
||||
src/common/dpdk_common.h | 1 +
|
||||
src/lstack/Makefile | 47 +++++++++++++++-------
|
||||
src/lstack/include/lstack_lockless_queue.h | 2 +
|
||||
src/lstack/netif/lstack_ethdev.c | 6 ++-
|
||||
src/ltran/CMakeLists.txt | 41 ++++++++++++++-----
|
||||
src/ltran/ltran_dfx.c | 2 +-
|
||||
src/ltran/ltran_param.h | 1 +
|
||||
7 files changed, 74 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/src/common/dpdk_common.h b/src/common/dpdk_common.h
|
||||
index 2f0e8d1..38f09ae 100644
|
||||
--- a/src/common/dpdk_common.h
|
||||
+++ b/src/common/dpdk_common.h
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <rte_mbuf.h>
|
||||
#include <rte_ring.h>
|
||||
#include <lwip/pbuf.h>
|
||||
+#include <lwip/dpdk_version.h>
|
||||
|
||||
#include "gazelle_opt.h"
|
||||
|
||||
diff --git a/src/lstack/Makefile b/src/lstack/Makefile
|
||||
index ab039ec..d9c8396 100644
|
||||
--- a/src/lstack/Makefile
|
||||
+++ b/src/lstack/Makefile
|
||||
@@ -14,6 +14,12 @@ ROOT_DIR := $(dir $(abspath $(LSTACK_DIR)))
|
||||
LWIP_INCLUDE_FILE ?= /usr/include/lwip
|
||||
LIB_PATH ?= /usr/lib64
|
||||
|
||||
+ifeq ($(DPDK_VERSION_1911), 1)
|
||||
+ DPDK_INCLUDE_FILE ?= /usr/include/dpdk
|
||||
+else
|
||||
+ DPDK_INCLUDE_FILE ?= /usr/local/include/
|
||||
+endif
|
||||
+
|
||||
AR = ar
|
||||
ARFLAGS = crDP
|
||||
CC ?= gcc
|
||||
@@ -30,7 +36,8 @@ $(info $(CC):$(SEC_FLAGS))
|
||||
|
||||
INC = -I$(LSTACK_DIR)/include \
|
||||
-I$(LSTACK_DIR)/../common \
|
||||
- -I$(LWIP_INCLUDE_FILE)
|
||||
+ -I$(LWIP_INCLUDE_FILE) \
|
||||
+ -I$(DPDK_INCLUDE_FILE)
|
||||
|
||||
CFLAGS = $(OPTIMIZATION) -fno-strict-aliasing $(INC)
|
||||
|
||||
@@ -58,8 +65,8 @@ include $(patsubst %, %/dir.mk, $(DIRS))
|
||||
OBJS = $(subst .c,.o,$(SRCS))
|
||||
|
||||
LWIP_LIB = $(LIB_PATH)/liblwip.a
|
||||
-LIBRTE_LIB = $(LIB_PATH)/librte_bus_pci.so \
|
||||
- $(LIB_PATH)/librte_pci.so \
|
||||
+LIBRTE_LIB = $(LIB_PATH)/librte_pci.so \
|
||||
+ $(LIB_PATH)/librte_bus_pci.so \
|
||||
$(LIB_PATH)/librte_cmdline.so \
|
||||
$(LIB_PATH)/librte_hash.so \
|
||||
$(LIB_PATH)/librte_mempool.so \
|
||||
@@ -69,25 +76,35 @@ LIBRTE_LIB = $(LIB_PATH)/librte_bus_pci.so \
|
||||
$(LIB_PATH)/librte_gro.so \
|
||||
$(LIB_PATH)/librte_ring.so \
|
||||
$(LIB_PATH)/librte_mbuf.so \
|
||||
- $(LIB_PATH)/librte_telemetry.so \
|
||||
$(LIB_PATH)/librte_kni.so \
|
||||
- $(LIB_PATH)/librte_net_ixgbe.so \
|
||||
$(LIB_PATH)/librte_kvargs.so \
|
||||
- $(LIB_PATH)/librte_net_hinic.so \
|
||||
- $(LIB_PATH)/librte_net_i40e.so \
|
||||
- $(LIB_PATH)/librte_net_virtio.so \
|
||||
$(LIB_PATH)/librte_bus_vdev.so \
|
||||
$(LIB_PATH)/librte_net.so \
|
||||
- $(LIB_PATH)/librte_rcu.so \
|
||||
$(LIB_PATH)/librte_ethdev.so \
|
||||
$(LIB_PATH)/librte_pdump.so \
|
||||
- $(LIB_PATH)/librte_bpf.so \
|
||||
- $(LIB_PATH)/librte_pcapng.so \
|
||||
- $(LIB_PATH)/librte_security.so \
|
||||
- $(LIB_PATH)/librte_cryptodev.so \
|
||||
- $(LIB_PATH)/librte_net_pcap.so \
|
||||
- $(LIB_PATH)/librte_net_bond.so
|
||||
|
||||
+ifeq ($(DPDK_VERSION_1911), 1)
|
||||
+ CFLAGS += -DDPDK_VERSION_1911=1
|
||||
+ LIBRTE_LIB += $(LIB_PATH)/librte_pmd_pcap.so \
|
||||
+ $(LIB_PATH)/librte_pmd_bond.so \
|
||||
+ $(LIB_PATH)/librte_pmd_hinic.so \
|
||||
+ $(LIB_PATH)/librte_pmd_i40e.so \
|
||||
+ $(LIB_PATH)/librte_pmd_ixgbe.so \
|
||||
+ $(LIB_PATH)/librte_pmd_virtio.so
|
||||
+else
|
||||
+ LIBRTE_LIB += $(LIB_PATH)/librte_net_pcap.so \
|
||||
+ $(LIB_PATH)/librte_net_bond.so \
|
||||
+ $(LIB_PATH)/librte_net_hinic.so \
|
||||
+ $(LIB_PATH)/librte_net_i40e.so \
|
||||
+ $(LIB_PATH)/librte_net_ixgbe.so \
|
||||
+ $(LIB_PATH)/librte_net_virtio.so \
|
||||
+ $(LIB_PATH)/librte_pcapng.so \
|
||||
+ $(LIB_PATH)/librte_rcu.so \
|
||||
+ $(LIB_PATH)/librte_telemetry.so \
|
||||
+ $(LIB_PATH)/librte_bpf.so \
|
||||
+ $(LIB_PATH)/librte_security.so \
|
||||
+ $(LIB_PATH)/librte_cryptodev.so
|
||||
+endif
|
||||
|
||||
DEP_LIBS = $(LWIP_LIB) $(LIBRTE_LIB)
|
||||
LDFLAGS += -Wl,--whole-archive $(DEP_LIBS) $(OBJS) -Wl,--no-whole-archive
|
||||
diff --git a/src/lstack/include/lstack_lockless_queue.h b/src/lstack/include/lstack_lockless_queue.h
|
||||
index c6f6f32..b0fc31f 100644
|
||||
--- a/src/lstack/include/lstack_lockless_queue.h
|
||||
+++ b/src/lstack/include/lstack_lockless_queue.h
|
||||
@@ -13,6 +13,8 @@
|
||||
#ifndef __GAZELLE_LOCKLESS_QUEUE_H__
|
||||
#define __GAZELLE_LOCKLESS_QUEUE_H__
|
||||
|
||||
+#include <stdbool.h>
|
||||
+
|
||||
typedef struct lockless_queue_node {
|
||||
struct lockless_queue_node *volatile next;
|
||||
} lockless_queue_node;
|
||||
diff --git a/src/lstack/netif/lstack_ethdev.c b/src/lstack/netif/lstack_ethdev.c
|
||||
index e4e7ebd..2052240 100644
|
||||
--- a/src/lstack/netif/lstack_ethdev.c
|
||||
+++ b/src/lstack/netif/lstack_ethdev.c
|
||||
@@ -780,7 +780,11 @@ int32_t gazelle_eth_dev_poll(struct protocol_stack *stack, uint8_t use_ltran_fla
|
||||
struct rte_ether_hdr *ethh = rte_pktmbuf_mtod(stack->pkts[i], struct rte_ether_hdr *);
|
||||
if (unlikely(RTE_BE16(RTE_ETHER_TYPE_ARP) == ethh->ether_type)) {
|
||||
stack_broadcast_arp(stack->pkts[i], stack);
|
||||
- if (!use_ltran_flag && !rte_is_broadcast_ether_addr(ðh->dst_addr)) {
|
||||
+#if DPDK_VERSION_1911
|
||||
+ if (!rte_is_broadcast_ether_addr(ðh->d_addr)) {
|
||||
+#else /* DPDK_VERSION_1911 */
|
||||
+ if (!rte_is_broadcast_ether_addr(ðh->dst_addr)) {
|
||||
+#endif /* DPDK_VERSION_1911 */
|
||||
// copy arp into other process
|
||||
transfer_arp_to_other_process(stack->pkts[i]);
|
||||
transfer_type = TRANSFER_KERNEL;
|
||||
diff --git a/src/ltran/CMakeLists.txt b/src/ltran/CMakeLists.txt
|
||||
index f37a232..1370dc8 100644
|
||||
--- a/src/ltran/CMakeLists.txt
|
||||
+++ b/src/ltran/CMakeLists.txt
|
||||
@@ -27,12 +27,40 @@ if($ENV{GAZELLE_COVERAGE_ENABLE})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
endif($ENV{GAZELLE_COVERAGE_ENABLE})
|
||||
|
||||
+if($ENV{DPDK_VERSION_1911})
|
||||
+ set(DPDK_DIR /usr/include/dpdk)
|
||||
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDPDK_VERSION_1911=1")
|
||||
+ set(DPDK_LINK_FLAGS "-Wl,-lrte_pmd_af_packet -Wl,-lrte_pmd_ark -Wl,-lrte_pmd_atlantic -Wl,-lrte_pmd_axgbe \
|
||||
+ -Wl,-lrte_pmd_bnxt -Wl,-lrte_pmd_bond -Wl,-lrte_pmd_cxgbe -Wl,-lrte_pmd_dpaa -Wl,-lrte_pmd_dpaa2 \
|
||||
+ -Wl,-lrte_pmd_e1000 -Wl,-lrte_pmd_ena -Wl,-lrte_pmd_enetc -Wl,-lrte_pmd_enic -Wl,-lrte_pmd_failsafe \
|
||||
+ -Wl,-lrte_pmd_i40e -Wl,-lrte_pmd_hinic -Wl,-lrte_pmd_ixgbe -Wl,-lrte_pmd_kni \
|
||||
+ -Wl,-lrte_pmd_nfp -Wl,-lrte_pmd_null -Wl,-lpcap -Wl,-lrte_pmd_qede -Wl,-lrte_pmd_ring -Wl,-lrte_pmd_softnic \
|
||||
+ -Wl,-lrte_pmd_pcap -Wl,-lrte_pmd_tap -Wl,-lrte_pmd_vdev_netvsc -Wl,-lrte_pmd_virtio -Wl,-lrte_pmd_vhost \
|
||||
+ -Wl,-lrte_mempool_octeontx -Wl,-lrte_pmd_octeontx -Wl,-lrte_bus_vmbus -Wl,-lrte_pmd_netvsc \
|
||||
+ -Wl,-lrte_pmd_vmxnet3_uio -Wl,-lrte_pmd_bbdev_null \
|
||||
+ -Wl,-lrte_pmd_null_crypto -Wl,-lrte_pmd_octeontx_crypto -Wl,-lrte_pmd_crypto_scheduler \
|
||||
+ -Wl,-lrte_pmd_dpaa2_sec -Wl,-lrte_pmd_dpaa_sec -Wl,-lrte_pmd_caam_jr -Wl,-lrte_pmd_virtio_crypto \
|
||||
+ -Wl,-lrte_pmd_octeontx_zip -Wl,-lrte_pmd_qat -Wl,-lrte_pmd_skeleton_event -Wl,-lrte_pmd_sw_event \
|
||||
+ -Wl,-lrte_pmd_dsw_event -Wl,-lrte_pmd_octeontx_ssovf -Wl,-lrte_pmd_dpaa_event -Wl,-lrte_pmd_dpaa2_event \
|
||||
+ -Wl,-lrte_pmd_opdl_event -Wl,-lrte_pmd_lio -Wl,-lrte_pmd_thunderx_nicvf -Wl,-lrte_pmd_ifc")
|
||||
+else()
|
||||
+ set(DPDK_DIR /usr/local/include/)
|
||||
+ set(DPDK_LINK_FLAGS "-Wl,-lrte_net_af_packet -Wl,-lrte_net_ark -Wl,-lrte_net_atlantic -Wl,-lrte_net_axgbe \
|
||||
+ -Wl,-lrte_net_bnxt -Wl,-lrte_net_bond -Wl,-lrte_net_cxgbe -Wl,-lrte_net_dpaa -Wl,-lrte_net_dpaa2 \
|
||||
+ -Wl,-lrte_net_e1000 -Wl,-lrte_net_ena -Wl,-lrte_net_enetc -Wl,-lrte_net_enic -Wl,-lrte_net_failsafe \
|
||||
+ -Wl,-lrte_net_i40e -Wl,-lrte_net_hinic -Wl,-lrte_net_ixgbe -Wl,-lrte_net_kni \
|
||||
+ -Wl,-lrte_net_nfp -Wl,-lrte_net_null -Wl,-lpcap -Wl,-lrte_net_qede -Wl,-lrte_net_ring -Wl,-lrte_net_softnic \
|
||||
+ -Wl,-lrte_net_pcap -Wl,-lrte_net_tap -Wl,-lrte_net_vdev_netvsc -Wl,-lrte_net_virtio -Wl,-lrte_net_vhost \
|
||||
+ -Wl,-lrte_mempool_octeontx -Wl,-lrte_net_octeontx -Wl,-lrte_bus_vmbus -Wl,-lrte_net_netvsc \
|
||||
+ -Wl,-lrte_telemetry")
|
||||
+endif($ENV{DPDK_VERSION_1911})
|
||||
+
|
||||
add_executable(ltran main.c ltran_param.c ltran_config.c ltran_ethdev.c ltran_stat.c ltran_errno.c
|
||||
ltran_monitor.c ltran_instance.c ltran_stack.c ltran_tcp_conn.c ltran_tcp_sock.c
|
||||
ltran_forward.c ltran_timer.c ${COMMON_DIR}/gazelle_dfx_msg.c ${COMMON_DIR}/dpdk_common.c
|
||||
${COMMON_DIR}/gazelle_parse_config.c)
|
||||
|
||||
-target_include_directories(ltran PRIVATE ${COMMON_DIR} ${PROJECT_SOURCE_DIR} ${LWIP_DIR})
|
||||
+target_include_directories(ltran PRIVATE ${COMMON_DIR} ${PROJECT_SOURCE_DIR} ${LWIP_DIR} ${DPDK_DIR})
|
||||
target_compile_options(ltran PRIVATE -march=native -fno-strict-aliasing -D__ARM_FEATURE_CRC32=1 -DRTE_MACHINE_CPUFLAG_NEON
|
||||
-DRTE_MACHINE_CPUFLAG_CRC32 -DRTE_MACHINE_CPUFLAG_PMULL -DRTE_MACHINE_CPUFLAG_AES
|
||||
-DRTE_MACHINE_CPUFLAG_SHA1 -DRTE_MACHINE_CPUFLAG_SHA2 -include rte_config.h
|
||||
@@ -51,16 +79,11 @@ set_target_properties(ltran PROPERTIES LINK_FLAGS "-L$ENV{DPDK_LIB_PATH} -Wl,--w
|
||||
-Wl,-Bstatic -lrte_eal -Wl,-Bdynamic -Wl,-lrte_cmdline \
|
||||
-Wl,-lrte_sched -Wl,-lrte_reorder -Wl,-lrte_kni -Wl,-lrte_common_cpt -Wl,-lrte_common_octeontx -Wl,-lrte_common_dpaax -Wl,-lrte_bus_pci \
|
||||
-Wl,-lrte_bus_dpaa -Wl,-lrte_bus_vdev -Wl,-lrte_bus_fslmc -Wl,-lrte_mempool_bucket -Wl,-lrte_mempool_stack -Wl,-lrte_mempool_dpaa \
|
||||
- -Wl,-lrte_mempool_dpaa2 -Wl,-lrte_net_af_packet -Wl,-lrte_net_ark -Wl,-lrte_net_atlantic -Wl,-lrte_net_axgbe \
|
||||
- -Wl,-lrte_net_bnxt -Wl,-lrte_net_bond -Wl,-lrte_net_cxgbe -Wl,-lrte_net_dpaa -Wl,-lrte_net_dpaa2 -Wl,-lrte_net_e1000 -Wl,-lrte_net_ena \
|
||||
- -Wl,-lrte_net_enetc -Wl,-lrte_net_enic -Wl,-lrte_net_failsafe -Wl,-lrte_net_i40e -Wl,-lrte_net_hinic -Wl,-lrte_net_ixgbe -Wl,-lrte_net_kni \
|
||||
- -Wl,-lrte_net_nfp -Wl,-lrte_net_null -Wl,-lpcap -Wl,-lrte_net_qede -Wl,-lrte_net_ring -Wl,-lrte_net_softnic -Wl,-lrte_net_pcap \
|
||||
- -Wl,-lrte_net_tap -Wl,-lrte_net_vdev_netvsc -Wl,-lrte_net_virtio -Wl,-lrte_net_vhost \
|
||||
- -Wl,-lrte_bus_vmbus -Wl,-lrte_net_netvsc -Wl,-lrte_mempool_octeontx -Wl,-lrte_net_octeontx \
|
||||
- -Wl,-lrte_bus_ifpga -Wl,-lrte_stack -Wl,-lrte_telemetry\
|
||||
+ -Wl,-lrte_mempool_dpaa2 -Wl,-lrte_bus_ifpga -Wl,-lrte_stack \
|
||||
+ ${DPDK_LINK_FLAGS} \
|
||||
-Wl,--no-whole-archive -Wl,-lm -Wl,-lrt -Wl,-lnuma -Wl,-ldl -Wl,-export-dynamic -Wl,-export-dynamic \
|
||||
-Wl,--as-needed -Wl,-export-dynamic -Wl,-Map=ltran.map -Wl,--cref")
|
||||
|
||||
add_executable(gazellectl ltran_dfx.c ${COMMON_DIR}/gazelle_dfx_msg.c)
|
||||
-target_include_directories(gazellectl PRIVATE $ENV{DPDK_INCLUDE_FILE} ${COMMON_DIR})
|
||||
+target_include_directories(gazellectl PRIVATE $ENV{DPDK_INCLUDE_FILE} ${COMMON_DIR} ${DPDK_DIR})
|
||||
target_link_libraries(gazellectl PRIVATE boundscheck -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack)
|
||||
diff --git a/src/ltran/ltran_dfx.c b/src/ltran/ltran_dfx.c
|
||||
index e41c6db..b8d9c99 100644
|
||||
--- a/src/ltran/ltran_dfx.c
|
||||
+++ b/src/ltran/ltran_dfx.c
|
||||
@@ -10,10 +10,10 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
+#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/time.h>
|
||||
-
|
||||
#include <arpa/inet.h>
|
||||
#include <getopt.h>
|
||||
#include <errno.h>
|
||||
diff --git a/src/ltran/ltran_param.h b/src/ltran/ltran_param.h
|
||||
index 40a92b1..75addcd 100644
|
||||
--- a/src/ltran/ltran_param.h
|
||||
+++ b/src/ltran/ltran_param.h
|
||||
@@ -13,6 +13,7 @@
|
||||
#ifndef __GAZELLE_PARAM_H__
|
||||
#define __GAZELLE_PARAM_H__
|
||||
|
||||
+#include <stdbool.h>
|
||||
#include <netinet/in.h>
|
||||
#include <rte_ether.h>
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
25
0251-change-send_ring_size-32-in-lstack-conf.patch
Normal file
25
0251-change-send_ring_size-32-in-lstack-conf.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 8e11724484118e82a29fec768a0d601a613df705 Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Mon, 5 Sep 2022 18:57:38 +0800
|
||||
Subject: [PATCH] change send_ring_size 32 in lstack conf
|
||||
|
||||
---
|
||||
src/lstack/lstack.conf | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/lstack/lstack.conf b/src/lstack/lstack.conf
|
||||
index 81da10a..fa7e284 100644
|
||||
--- a/src/lstack/lstack.conf
|
||||
+++ b/src/lstack/lstack.conf
|
||||
@@ -20,7 +20,7 @@ tcp_conn_count = 1500
|
||||
mbuf_count_per_conn = 170
|
||||
|
||||
# send ring size, default is 32, max is 2048
|
||||
-send_ring_size = 256
|
||||
+send_ring_size = 32
|
||||
|
||||
# 0: when send ring full, send return
|
||||
# 1: when send ring full, alloc mbuf from mempool to send data
|
||||
--
|
||||
2.27.0
|
||||
|
||||
13
gazelle.spec
13
gazelle.spec
@ -2,7 +2,7 @@
|
||||
|
||||
Name: gazelle
|
||||
Version: 1.0.1
|
||||
Release: 63
|
||||
Release: 64
|
||||
Summary: gazelle is a high performance user-mode stack
|
||||
License: MulanPSL-2.0
|
||||
URL: https://gitee.com/openeuler/gazelle
|
||||
@ -262,6 +262,10 @@ Patch9244: 0244-add-exception-handling-for-is_dst_ip_localhost.patch
|
||||
Patch9245: 0245-fix-gazellectl-block-before-lstack-registration-is-c.patch
|
||||
Patch9246: 0246-fix-udp-send-recv-in-muliple-queue.patch
|
||||
Patch9247: 0247-set-sock-when-select-path-is-PATH_UNKNOW.patch
|
||||
Patch9248: 0248-rpc-pool-use-dpdk-mempool-replace-array.patch
|
||||
Patch9249: 0249-fix-t_params-use-after-free-in-kernel-event-thread.patch
|
||||
Patch9250: 0250-adapt-to-dpdk-19.11-and-dpdk-21.11.patch
|
||||
Patch9251: 0251-change-send_ring_size-32-in-lstack-conf.patch
|
||||
|
||||
%description
|
||||
%{name} is a high performance user-mode stack.
|
||||
@ -272,6 +276,7 @@ ExclusiveArch: x86_64 aarch64
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
|
||||
%build
|
||||
#export DPDK_VERSION_1911=1
|
||||
cd %{_builddir}/%{name}-%{version}
|
||||
# Add compile option, ignore map address check. Scenarios: asan test
|
||||
%if 0%{?gazelle_map_addr_nocheck}
|
||||
@ -302,6 +307,12 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b
|
||||
%config(noreplace) %{conf_path}/ltran.conf
|
||||
|
||||
%changelog
|
||||
* Thu Jun 15 2023 jiangheng12 <jiangheng14@huawei.com> - 1.0.1-64
|
||||
- change send_ring_size 32 in lstack conf
|
||||
- adapt to dpdk-19.11 and dpdk-21.11
|
||||
- fix t_params use after free in kernel event thread
|
||||
- rpc pool use dpdk mempool replace array
|
||||
|
||||
* Wed Jun 14 2023 jiangheng12 <jiangheng14@huawei.com> - 1.0.1-63
|
||||
- set sock when select path is PATH_UNKNOW
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user