Thread (11 messages) 11 messages, 4 authors, 2018-03-30

Re: [PATCH net-next 4/6] inet: frags: use rhashtables for reassembly units

From: Eric Dumazet <hidden>
Date: 2018-03-30 13:31:11


On 03/30/2018 12:18 AM, Herbert Xu wrote:
Instead of using the walk interface, how about
rhashtable_free_and_destroy?
Oh, I was not aware of this beast ;)

I guess I will need to add a cond_resched() in it, right ?

My rough guess is that freeing 30 million frags would take few seconds ;)
quoted
 void inet_frag_kill(struct inet_frag_queue *fq)
 {
 	if (del_timer(&fq->timer))
 		refcount_dec(&fq->refcnt);
 
 	if (!(fq->flags & INET_FRAG_COMPLETE)) {
-		fq_unlink(fq);
+		struct netns_frags *nf = fq->net;
+
+		fq->flags |= INET_FRAG_COMPLETE;
+		rhashtable_remove_fast(&nf->rhashtable, &fq->node, nf->f->rhash_params);
 		refcount_dec(&fq->refcnt);
 	}
 }
This means that the hash won't inline properly.  Don't know big
of an issue it is to you.  But you could fix it by doing the same
hack as rhashtable by making inet_frag_kill an inline function and
take the rhash_params as an explicit argument.
I will investigate this, thanks !
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help