mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
ipv6: unify fragment thresh handling code
Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Michal Kubeček <mkubecek@suse.cz> Cc: David Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d4915c087f
commit
6b102865e7
5 changed files with 18 additions and 22 deletions
|
@ -89,7 +89,7 @@ void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f)
|
|||
nf->low_thresh = 0;
|
||||
|
||||
local_bh_disable();
|
||||
inet_frag_evictor(nf, f);
|
||||
inet_frag_evictor(nf, f, true);
|
||||
local_bh_enable();
|
||||
}
|
||||
EXPORT_SYMBOL(inet_frags_exit_net);
|
||||
|
@ -158,11 +158,16 @@ void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f,
|
|||
}
|
||||
EXPORT_SYMBOL(inet_frag_destroy);
|
||||
|
||||
int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f)
|
||||
int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f, bool force)
|
||||
{
|
||||
struct inet_frag_queue *q;
|
||||
int work, evicted = 0;
|
||||
|
||||
if (!force) {
|
||||
if (atomic_read(&nf->mem) <= nf->high_thresh)
|
||||
return 0;
|
||||
}
|
||||
|
||||
work = atomic_read(&nf->mem) - nf->low_thresh;
|
||||
while (work > 0) {
|
||||
read_lock(&f->lock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue