[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87livve74q.fsf@sapphire.mobileactivedefense.com>
Date: Mon, 18 Jul 2011 20:11:33 +0100
From: Rainer Weikusat <rweikusat@...ileactivedefense.com>
To: Patrick McHardy <kaber@...sh.net>
Cc: Rainer Weikusat <rweikusat@...ileactivedefense.com>,
netfilter-devel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] netfilter: add per-namespace logging to nfnetlink_log.c
Rainer Weikusat <rw@...phire.mobileactivedefense.com> writes:
> Patrick McHardy <kaber@...sh.net> writes:
[...]
>>> +#define INSTANCE_BUCKETS 16
>>> +
>>> +struct nfulnl_instances {
>>> + spinlock_t lock;
>>> + atomic_t global_seq;
>>> + struct hlist_head table[INSTANCE_BUCKETS];
>>> + unsigned hash_init;
>>> +#ifdef NET_NS
>>> + struct net *net;
>>> +#endif
>>> +};
>>> +
>>> struct nfulnl_instance {
>>> struct hlist_node hlist; /* global list of instances */
>>> spinlock_t lock;
>>> @@ -67,14 +85,92 @@ struct nfulnl_instance {
>>> u_int16_t flags;
>>> u_int8_t copy_mode;
>>> struct rcu_head rcu;
>>> +#ifdef NET_NS
>>> + struct nfulnl_instances *instances;
>>> +#endif
>>
>> This seems odd, the usual way is to add the global data to the
>> net-ns structure.
>
> Since a facility for having 'per subsystem' network namespace specific
> data exists, there seems to be little reason to not use it.
An additional remark: There is actually a reason for using it, namely,
'adding global data to the net-ns structure' implies that this
structure has to contain per-module data of modules which aren't
loaded, while using 'generic net pointers' enables this data to be
allocated/ deallocated on module load/ unload.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists