1 Star 0 Fork 32

fantaotao1/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0092-ltran-update-list.patch 1.99 KB
一键复制 编辑 原始数据 按行查看 历史
吴昌盛 提交于 2022-10-08 22:27 . adapt ceph client
From d609d7a16c0ab0e0215e7c84909bc19b8216727f Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Wed, 21 Sep 2022 12:06:21 +0000
Subject: [PATCH 08/21] ltran update list
---
src/ltran/ltran_forward.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/ltran/ltran_forward.c b/src/ltran/ltran_forward.c
index 1a92348..9ca04aa 100644
--- a/src/ltran/ltran_forward.c
+++ b/src/ltran/ltran_forward.c
@@ -432,18 +432,25 @@ static __rte_always_inline void tcp_hash_table_add_conn(struct gazelle_stack *st
struct gazelle_quintuple *transfer_qtuple, uint32_t tid)
{
struct gazelle_tcp_conn *tcp_conn = NULL;
+ struct gazelle_tcp_conn_htable *conn_htable = gazelle_get_tcp_conn_htable();
- /* When lstack is the server, conn is created in tcp_handle func. lwip send the connect command after
- receiving syn, and delete conn timeout. */
- tcp_conn = gazelle_conn_get_by_quintuple(gazelle_get_tcp_conn_htable(), transfer_qtuple);
+ tcp_conn = gazelle_conn_get_by_quintuple(conn_htable, transfer_qtuple);
if (tcp_conn) {
- tcp_conn->conn_timeout = -1;
- return;
+ /* When lstack is the server, conn is created in tcp_handle func. lwip send the connect command after
+ * receiving syn, and delete conn timeout. */
+ if (tcp_conn->conn_timeout >= 0) {
+ tcp_conn->conn_timeout = -1;
+ return;
+ } else {
+ /* del old invaild conn */
+ gazelle_conn_del_by_quintuple(conn_htable, transfer_qtuple);
+ printf("del old conn port=%d\n", ntohs(transfer_qtuple->dst_port));
+ }
}
/* When lstack is the client, lwip send the connect command while calling connect func. conn is created
without a timeout */
- tcp_conn = gazelle_conn_add_by_quintuple(gazelle_get_tcp_conn_htable(), transfer_qtuple);
+ tcp_conn = gazelle_conn_add_by_quintuple(conn_htable, transfer_qtuple);
if (tcp_conn == NULL) {
LTRAN_ERR("add tcp conn htable failed\n");
return;
--
2.23.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fantaotao1/gazelle.git
git@gitee.com:fantaotao1/gazelle.git
fantaotao1
gazelle
gazelle
master

搜索帮助