On Thu, 2007-27-09 at 13:25 +0400, Evgeniy Polyakov wrote:
> > +#define NAT_TAB_MASK 15 > > This really wants to be configurable at least via module parameter. Would not be a bad idea, but not specific to just this one action. Note: probably not a very big deal to have 15 there because in the fast path that table is not being looked up; once an action is bound to a filter, its the filter lookups that count. > > +static struct tcf_common *tcf_nat_ht[NAT_TAB_MASK + 1]; > > +static u32 nat_idx_gen; > > +static DEFINE_RWLOCK(nat_lock); > > > +static struct tcf_hashinfo nat_hash_info = { > > + .htab = tcf_nat_ht, > > + .hmask = NAT_TAB_MASK, > > + .lock = &nat_lock, > > +}; > > When I read this I swear I heard 'I want to be RCU'. > But that is another task. Go ahead and clean that up to use rcu. What would be really nice is to have generic hash table scheme which uses the scheme above and then this code (and a lot other) is converted to use it; if you stared a bit at the code youd notice a lot of commonalities with a lot of similar netcode (look at the ipip driver for example). The LinuxWay(tm). I know Patrick hinted at some point he may do that (or maybe it was my imagination;->) cheers, jamal - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html