[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230609151332.263152-4-pctammela@mojatatu.com>
Date: Fri, 9 Jun 2023 12:13:31 -0300
From: Pedro Tammela <pctammela@...atatu.com>
To: netdev@...r.kernel.org
Cc: tgraf@...g.ch,
herbert@...dor.apana.org.au,
davem@...emloft.net,
dsahern@...nel.org,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
Pedro Tammela <pctammela@...atatu.com>
Subject: [RFC PATCH net-next 3/4] net/ipv4: use rhashtable length helper
Avoid open coding the rhashtable length read
Signed-off-by: Pedro Tammela <pctammela@...atatu.com>
---
net/ipv4/proc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index eaf1d3113b62..cab1edc3c416 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -42,6 +42,7 @@
#include <linux/export.h>
#include <net/sock.h>
#include <net/raw.h>
+#include <linux/rhashtable.h>
#define TCPUDP_MIB_MAX max_t(u32, UDP_MIB_MAX, TCP_MIB_MAX)
@@ -69,7 +70,7 @@ static int sockstat_seq_show(struct seq_file *seq, void *v)
seq_printf(seq, "RAW: inuse %d\n",
sock_prot_inuse_get(net, &raw_prot));
seq_printf(seq, "FRAG: inuse %u memory %lu\n",
- atomic_read(&net->ipv4.fqdir->rhashtable.nelems),
+ rhashtable_len(&net->ipv4.fqdir->rhashtable),
frag_mem_limit(net->ipv4.fqdir));
return 0;
}
--
2.39.2
Powered by blists - more mailing lists