inet: frag: don't account number of fragment queues
The 'nqueues' counter is protected by the lru list lock, once thats removed this needs to be converted to atomic counter. Given this isn't used for anything except for reporting it to userspace via /proc, just remove it. We still report the memory currently used by fragment reassembly queues. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
b13d3cbfb8
Коммит
434d305405
|
@ -4,7 +4,6 @@
|
|||
#include <linux/percpu_counter.h>
|
||||
|
||||
struct netns_frags {
|
||||
int nqueues;
|
||||
struct list_head lru_list;
|
||||
spinlock_t lru_lock;
|
||||
|
||||
|
@ -158,7 +157,6 @@ static inline void inet_frag_lru_del(struct inet_frag_queue *q)
|
|||
{
|
||||
spin_lock(&q->net->lru_lock);
|
||||
list_del_init(&q->lru_list);
|
||||
q->net->nqueues--;
|
||||
spin_unlock(&q->net->lru_lock);
|
||||
}
|
||||
|
||||
|
@ -167,7 +165,6 @@ static inline void inet_frag_lru_add(struct netns_frags *nf,
|
|||
{
|
||||
spin_lock(&nf->lru_lock);
|
||||
list_add_tail(&q->lru_list, &nf->lru_list);
|
||||
q->net->nqueues++;
|
||||
spin_unlock(&nf->lru_lock);
|
||||
}
|
||||
|
||||
|
|
|
@ -495,7 +495,6 @@ static inline struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user)
|
|||
}
|
||||
#endif
|
||||
int ip_frag_mem(struct net *net);
|
||||
int ip_frag_nqueues(struct net *net);
|
||||
|
||||
/*
|
||||
* Functions provided by ip_forward.c
|
||||
|
|
|
@ -299,11 +299,6 @@ static inline bool ipv6_accept_ra(struct inet6_dev *idev)
|
|||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
static inline int ip6_frag_nqueues(struct net *net)
|
||||
{
|
||||
return net->ipv6.frags.nqueues;
|
||||
}
|
||||
|
||||
static inline int ip6_frag_mem(struct net *net)
|
||||
{
|
||||
return sum_frag_mem_limit(&net->ipv6.frags);
|
||||
|
|
|
@ -193,7 +193,6 @@ EXPORT_SYMBOL(inet_frags_init);
|
|||
|
||||
void inet_frags_init_net(struct netns_frags *nf)
|
||||
{
|
||||
nf->nqueues = 0;
|
||||
init_frag_mem_limit(nf);
|
||||
INIT_LIST_HEAD(&nf->lru_list);
|
||||
spin_lock_init(&nf->lru_lock);
|
||||
|
|
|
@ -86,11 +86,6 @@ static inline u8 ip4_frag_ecn(u8 tos)
|
|||
|
||||
static struct inet_frags ip4_frags;
|
||||
|
||||
int ip_frag_nqueues(struct net *net)
|
||||
{
|
||||
return net->ipv4.frags.nqueues;
|
||||
}
|
||||
|
||||
int ip_frag_mem(struct net *net)
|
||||
{
|
||||
return sum_frag_mem_limit(&net->ipv4.frags);
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
static int sockstat_seq_show(struct seq_file *seq, void *v)
|
||||
{
|
||||
struct net *net = seq->private;
|
||||
unsigned int frag_mem;
|
||||
int orphans, sockets;
|
||||
|
||||
local_bh_disable();
|
||||
|
@ -71,8 +72,8 @@ static int sockstat_seq_show(struct seq_file *seq, void *v)
|
|||
sock_prot_inuse_get(net, &udplite_prot));
|
||||
seq_printf(seq, "RAW: inuse %d\n",
|
||||
sock_prot_inuse_get(net, &raw_prot));
|
||||
seq_printf(seq, "FRAG: inuse %d memory %d\n",
|
||||
ip_frag_nqueues(net), ip_frag_mem(net));
|
||||
frag_mem = ip_frag_mem(net);
|
||||
seq_printf(seq, "FRAG: inuse %u memory %u\n", !!frag_mem, frag_mem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
static int sockstat6_seq_show(struct seq_file *seq, void *v)
|
||||
{
|
||||
struct net *net = seq->private;
|
||||
unsigned int frag_mem = ip6_frag_mem(net);
|
||||
|
||||
seq_printf(seq, "TCP6: inuse %d\n",
|
||||
sock_prot_inuse_get(net, &tcpv6_prot));
|
||||
|
@ -42,8 +43,7 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
|
|||
sock_prot_inuse_get(net, &udplitev6_prot));
|
||||
seq_printf(seq, "RAW6: inuse %d\n",
|
||||
sock_prot_inuse_get(net, &rawv6_prot));
|
||||
seq_printf(seq, "FRAG6: inuse %d memory %d\n",
|
||||
ip6_frag_nqueues(net), ip6_frag_mem(net));
|
||||
seq_printf(seq, "FRAG6: inuse %u memory %u\n", !!frag_mem, frag_mem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче