[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20131210.144538.1753921871836942715.davem@davemloft.net>
Date: Tue, 10 Dec 2013 14:45:38 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: jiri@...nulli.us
Cc: netdev@...r.kernel.org
Subject: Re: [patch net-next] neighbour: always have struct net pointer in
struct neigh_parms
From: Jiri Pirko <jiri@...nulli.us>
Date: Tue, 10 Dec 2013 08:44:57 +0100
> This fixes compile error when CONFIG_NET_NS is not set.
>
> Introduced by:
> commit 1d4c8c29841b9991cdf3c7cc4ba7f96a94f104ca
> "neigh: restore old behaviour of default parms values"
>
> Signed-off-by: Jiri Pirko <jiri@...nulli.us>
Jiri please don't fix things this way.
When network name spaces are disabled, you're supposed to abstract
all of this stuff away behind accessor macros so that it is truly
zero cost.
For example, look at how "dev_net()" and related helpers works.
This means you need to do something like:
/*
* Net namespace inlines
*/
static inline
struct net *neigh_parms_net(const struct neigh_parms *np)
{
return read_pnet(&np->net);
}
static inline
void neigh_parms_net_set(struct neigh_parms *np, struct net *net)
{
#ifdef CONFIG_NET_NS
release_net(np->net);
np->net = hold_net(net);
#endif
}
And then use these helpers consistently in your new code.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists