Skip to contentSkip to conversation

ipvs: correctly print the memory size of ip_vs_conn_tab

PATCH Superseded Pengcheng Yang 2 participants 2 messages Apr 12, 2022 – Apr 15, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipvs: correctly print the memory size of ip_vs_conn_tab

The memory size of ip_vs_conn_tab changed after we use hlist instead of list.

Fixes 731109e78415 ("ipvs: use hlist instead of list")
---
 net/netfilter/ipvs/ip_vs_conn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_conn.c +1 -1
index 2c467c4..e886c74 100644
@@ -1495,7 +1495,7 @@ int __init ip_vs_conn_init(void)
 	pr_info("Connection hash table configured "
 		"(size=%d, memory=%ldKbytes)\n",
 		ip_vs_conn_tab_size,
-		(long)(ip_vs_conn_tab_size*sizeof(struct list_head))/1024);
+		(long)(ip_vs_conn_tab_size*sizeof(struct hlist_head))/1024);
 	IP_VS_DBG(0, "Each connection entry needs %zd bytes at least\n",
 		  sizeof(struct ip_vs_conn));
 
Signature · 1 line
1.8.3.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Pengcheng Yang

The memory size of ip_vs_conn_tab changed after we use hlist instead of list.

Fixes 731109e78415 ("ipvs: use hlist instead of list")
Quoted 20 lines
---
 net/netfilter/ipvs/ip_vs_conn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_conn.c +1 -1
index 2c467c4..e886c74 100644
@@ -1495,7 +1495,7 @@ int __init ip_vs_conn_init(void)
 	pr_info("Connection hash table configured "
 		"(size=%d, memory=%ldKbytes)\n",
 		ip_vs_conn_tab_size,
-		(long)(ip_vs_conn_tab_size*sizeof(struct list_head))/1024);
+		(long)(ip_vs_conn_tab_size*sizeof(struct hlist_head))/1024);
 	IP_VS_DBG(0, "Each connection entry needs %zd bytes at least\n",
 		  sizeof(struct ip_vs_conn));
 
Signature · 1 line
1.8.3.1