Subject: Re: [net-next PATCH V2] net: frag queue per hash bucket locking

From: Jesper Dangaard Brouer <[email-masked]>
Date: Thu, 04 Apr 2013 11:27:52 +0200

On Thu, 2013-04-04 at 11:03 +0200, Hannes Frederic Sowa wrote:
> On Thu, Apr 04, 2013 at 09:52:26AM +0200, Jesper Dangaard Brouer wrote:
> > +struct inet_frag_bucket {
> > +	struct hlist_head	chain;
> > +	spinlock_t		chain_lock;
> > +	u16			chain_len;
> > +};
> > +
> 
> I just noticed and wanted to ask for what chain_len is needed?  Could it
> be dropped?

It could be dropped from this patch.  Its part of my future hash cleanup
strategy.
I also wanted to use it to replace the nqueues counter, but its would
not be correct, because nqueues counter is maintained per netns (network
namespace).

Its currently the netns separation, which is causing "headaches" for my
removal of LRU and direct-hash-cleaning solution...

> If the elements are swapped between the hash buckets in
> inet_frag_secret_rebuild it seems you forgot to update chain_len
> correctly.

Ah, good catch.
Given its not even correct, I'll remove the chain_len and repost a V3.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Sr. Network Kernel Developer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer