1From a9906aabda21b9d2912377352ef0058eb4fb76e0 Mon Sep 17 00:00:00 2001 2From: jiangheng <jiangheng14@huawei.com> 3Date: Mon, 13 Mar 2023 10:00:12 +0800 4Subject: [PATCH] add pbuf lock when aggregate pbuf 5 6--- 7 src/include/lwip/pbuf.h | 3 ++- 8 src/include/lwipsock.h | 3 +-- 9 2 files changed, 3 insertions(+), 3 deletions(-) 10 11diff --git a/src/include/lwip/pbuf.h b/src/include/lwip/pbuf.h 12index a2e8e01..8807a49 100644 13--- a/src/include/lwip/pbuf.h 14+++ b/src/include/lwip/pbuf.h 15@@ -231,9 +231,10 @@ struct pbuf { 16 u64_t l4_len:8; 17 u8_t header_off; 18 u8_t rexmit; 19- u8_t in_write; 20+ volatile u8_t allow_in; 21 u8_t head; 22 struct pbuf *last; 23+ pthread_spinlock_t pbuf_lock; 24 #endif /* GAZELLE_ENABLE CHECKSUM_OFFLOAD_SWITCH */ 25 26 /** In case the user needs to store data custom data on a pbuf */ 27diff --git a/src/include/lwipsock.h b/src/include/lwipsock.h 28index 810e98f..7e16ec8 100644 29--- a/src/include/lwipsock.h 30+++ b/src/include/lwipsock.h 31@@ -104,11 +104,10 @@ struct lwip_sock { 32 33 char pad1 __rte_cache_aligned; 34 /* app and stack thread all use */ 35- uint32_t in_send; /* avoid sock too much send rpc msg*/ 36+ uint32_t call_num; /* avoid sock too much send rpc msg*/ 37 char pad2 __rte_cache_aligned; 38 /* stack thread all use */ 39 struct list_node recv_list; 40- struct list_node send_list; 41 struct pbuf *send_lastdata; 42 struct pbuf *send_pre_del; 43 sem_t snd_ring_sem; 44-- 452.29.0.windows.1 46 47