!765 [sync] PR-758: sync adapt dpdk-23.11 remove kni

From: @openeuler-sync-bot 
Reviewed-by: @jiangheng12 
Signed-off-by: @jiangheng12
This commit is contained in:
openeuler-ci-bot 2024-04-19 09:04:32 +00:00 committed by Gitee
commit 39c487e39d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 140 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From 5fff605ff68741482d7fff992343eaccb383115f Mon Sep 17 00:00:00 2001
From: li_yunqing <liyunqing@kylinos.cn>
Date: Fri, 22 Mar 2024 15:47:19 +0800
Subject: [PATCH] fix tcp recv does not return pkg when ring buffer is empty
---
src/lstack/core/lstack_lwip.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index a604a62..51238ba 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -925,7 +925,9 @@ static ssize_t recv_ring_tcp_read(struct lwip_sock *sock, void *buf, size_t len,
}
while (recv_left > 0) {
- if (recv_ring_get_one(sock, noblock, &pbuf) != 0) {
+ if (recv_ring_get_one(sock, noblock | recvd, &pbuf) != 0) {
+ /* When the buffer is empty, it will be returned directly
+ if in non-blocking mode or if data has already been received */
break;
}
--
2.33.0

View File

@ -0,0 +1,24 @@
From e4d3f17fbb3efce9e29c86838a09fa1f9e224fd3 Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Tue, 16 Apr 2024 03:46:12 +0000
Subject: [PATCH] add tuple_fileter error info
---
src/lstack/core/lstack_cfg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c
index b533a33..533eb6c 100644
--- a/src/lstack/core/lstack_cfg.c
+++ b/src/lstack/core/lstack_cfg.c
@@ -1159,6 +1159,7 @@ static int parse_tuple_filter(void)
return 0;
}
if (g_config_params.use_ltran || g_config_params.listen_shadow) {
+ LSTACK_LOG(ERR, LSTACK, "tuple filter and (ltran or listen_shadow) cannot be enabled at the same time\n");
return -EINVAL;
}
--
2.33.0

View File

@ -0,0 +1,80 @@
From 201e8d1e2fad0d83ea1544fd14b35492d8dd72bc Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Wed, 17 Apr 2024 15:43:07 +0800
Subject: [PATCH] adapt dpdk-23.11 remove kni
---
src/lstack/core/lstack_dpdk.c | 4 +++-
src/lstack/core/lstack_init.c | 4 ++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c
index 5d90408..016276a 100644
--- a/src/lstack/core/lstack_dpdk.c
+++ b/src/lstack/core/lstack_dpdk.c
@@ -694,6 +694,7 @@ int32_t dpdk_ethdev_start(void)
return 0;
}
+#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
int32_t dpdk_init_lstack_kni(void)
{
struct protocol_stack_group *stack_group = get_protocol_stack_group();
@@ -712,7 +713,6 @@ int32_t dpdk_init_lstack_kni(void)
return 0;
}
-#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
void dpdk_skip_nic_init(void)
{
/* when lstack init nic again, ltran can't read pkts from nic. unregister pci_bus to avoid init nic in lstack */
@@ -799,12 +799,14 @@ int32_t init_dpdk_ethdev(void)
}
}
+#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
if (get_global_cfg_params()->kni_switch && get_global_cfg_params()->is_primary) {
ret = dpdk_init_lstack_kni();
if (ret < 0) {
return -1;
}
}
+#endif
return 0;
}
diff --git a/src/lstack/core/lstack_init.c b/src/lstack/core/lstack_init.c
index 79b4060..c2499d7 100644
--- a/src/lstack/core/lstack_init.c
+++ b/src/lstack/core/lstack_init.c
@@ -183,6 +183,7 @@ static void gazelle_signal_init(void)
lstack_signal_init();
}
+#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
static void set_kni_ip_mac()
{
struct cfg_params *cfg = get_global_cfg_params();
@@ -230,6 +231,7 @@ static void set_kni_ip_mac()
posix_api->close_fn(fd);
}
+#endif
__attribute__((constructor)) void gazelle_network_init(void)
{
@@ -315,9 +317,11 @@ __attribute__((constructor)) void gazelle_network_init(void)
/* lwip initialization */
lwip_sock_init();
+#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
if (get_global_cfg_params()->kni_switch) {
set_kni_ip_mac();
}
+#endif
if (set_process_start_flag() != 0) {
gazelle_exit();
--
2.33.0

View File

@ -2,7 +2,7 @@
Name: gazelle
Version: 1.0.2
Release: 32
Release: 33
Summary: gazelle is a high performance user-mode stack
License: MulanPSL-2.0
URL: https://gitee.com/openeuler/gazelle
@ -184,6 +184,9 @@ Patch9164: 0164-dfx-support-get-nic-bond-status.patch
Patch9165: 0165-remove-dpdk_skip_nic_init-for-dpdk-23.11.patch
Patch9166: 0166-gazellectl-add-lwip-stats_proto-print.patch
Patch9167: 0167-fix-port-not-support-vlan-filter.patch
Patch9168: 0168-fix-tcp-recv-does-not-return-pkg-when-ring-buffer-is.patch
Patch9169: 0169-add-tuple_fileter-error-info.patch
Patch9170: 0170-adapt-dpdk-23.11-remove-kni.patch
%description
%{name} is a high performance user-mode stack.
@ -225,6 +228,11 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b
%config(noreplace) %{conf_path}/ltran.conf
%changelog
* Fri Apr 19 2024 yangchen555 <yangchen145@huawei.com> - 1.0.2-33
- adapt dpdk-23.11 remove kni
- add tuple_fileter error info
- fix tcp recv does not return pkg when ring buffer is empty
* Fri Apr 12 2024 yinbin6 <yinbin8@huawei.com> - 1.0.2-32
- fix port not support vlan filter
- gazellectl add lwip stats_proto print