[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230609151332.263152-5-pctammela@mojatatu.com>
Date: Fri, 9 Jun 2023 12:13:32 -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 4/4] net/ipv6: use rhashtable length helper
Avoid open coding the rhashtab length read
Signed-off-by: Pedro Tammela <pctammela@...atatu.com>
---
net/ipv6/proc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index e20b3705c2d2..402e4f6f9e25 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -25,6 +25,7 @@
#include <net/udp.h>
#include <net/transp_v6.h>
#include <net/ipv6.h>
+#include <linux/rhashtable.h>
#define MAX4(a, b, c, d) \
max_t(u32, max_t(u32, a, b), max_t(u32, c, d))
@@ -44,7 +45,7 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
seq_printf(seq, "RAW6: inuse %d\n",
sock_prot_inuse_get(net, &rawv6_prot));
seq_printf(seq, "FRAG6: inuse %u memory %lu\n",
- atomic_read(&net->ipv6.fqdir->rhashtable.nelems),
+ rhashtable_len(&net->ipv6.fqdir->rhashtable),
frag_mem_limit(net->ipv6.fqdir));
return 0;
}
--
2.39.2
Powered by blists - more mailing lists