git: 140c473fb905 - stable/14 - tcp_ratelimit: Use static initializers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 13 Mar 2025 10:14:31 UTC
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=140c473fb9050c2befae2f021d00b2713a12c60f commit 140c473fb9050c2befae2f021d00b2713a12c60f Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2025-03-06 04:51:45 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2025-03-13 10:13:51 +0000 tcp_ratelimit: Use static initializers MFC after: 1 week (cherry picked from commit 09de37310313d87942fc5349914be46b9cb8c808) --- sys/netinet/tcp_ratelimit.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index 1834c702c493..521ebad4e5dd 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -246,10 +246,10 @@ const uint64_t desired_rates[] = { #define RS_ONE_GIGABIT_PERSEC 1000000000 #define RS_TEN_GIGABIT_PERSEC 10000000000 -static struct head_tcp_rate_set int_rs; +static struct head_tcp_rate_set int_rs = CK_LIST_HEAD_INITIALIZER(); static struct mtx rs_mtx; -uint32_t rs_number_alive; -uint32_t rs_number_dead; +uint32_t rs_number_alive = 0; +uint32_t rs_number_dead = 0; static uint32_t rs_floor_mss = 0; static uint32_t wait_time_floor = 8000; /* 8 ms */ static uint32_t rs_hw_floor_mss = 16; @@ -1772,9 +1772,6 @@ static eventhandler_tag rl_shutdown_start; static void tcp_rs_init(void *st __unused) { - CK_LIST_INIT(&int_rs); - rs_number_alive = 0; - rs_number_dead = 0; mtx_init(&rs_mtx, "tcp_rs_mtx", "rsmtx", MTX_DEF); rl_ifnet_departs = EVENTHANDLER_REGISTER(ifnet_departure_event, tcp_rl_ifnet_departure,