On Mon, Sep 14, 2015 at 11:13 AM, Pravin Shelar <[email protected]> wrote: > On Thu, Jul 30, 2015 at 12:24 PM, Jesse Gross <[email protected]> wrote: >> On Wed, Jul 29, 2015 at 12:53 PM, Joe Stringer <[email protected]> >> wrote: > > ... > >>> diff --git a/datapath/linux/compat/include/net/net_namespace.h >>> b/datapath/linux/compat/include/net/net_namespace.h >>> index b7dbfe3..05c48f4 100644 >>> --- a/datapath/linux/compat/include/net/net_namespace.h >>> +++ b/datapath/linux/compat/include/net/net_namespace.h >>> @@ -51,4 +51,33 @@ static void rpl_unregister_pernet_gen_##TYPE(struct >>> rpl_pernet_operations *rpl_p >>> #define DEFINE_COMPAT_PNET_REG_FUNC(TYPE) >>> #endif /* 2.6.33 */ >>> >>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) >>> +typedef struct { >>> +#ifdef CONFIG_NET_NS >>> + struct net *net; >>> +#endif >>> +} possible_net_t; >>> + >>> +static inline void rpl_write_pnet(possible_net_t *pnet, struct net *net) >>> +{ >>> +#ifdef CONFIG_NET_NS >>> + pnet->net = net; >>> +#endif >>> +} >>> + >>> +static inline struct net *rpl_read_pnet(const possible_net_t *pnet) >>> +{ >>> +#ifdef CONFIG_NET_NS >>> + return pnet->net; >>> +#else >>> + return &init_net; >>> +#endif >>> +} >>> +#else /* Linux >= 4.1 */ >>> +#define hold_net(x) (x) >>> +#define release_net(x) (x) >>> +#define rpl_read_pnet read_pnet >>> +#define rpl_write_pnet write_pnet >>> +#endif /* Linux >= 4.1 */ >>> + >>> #endif /* net/net_namespace.h wrapper */ >> >> Can we just drop use of hold_net()/release_net()? The commit message >> says that they were disabled even on old kernels. >> > > hold_net()/release_net() are still used on older kernel if debugging > is turned on. So we need to keep those function calls.
I don't think it is necessary to support them even on older kernels. This is the commit where they were removed: commit efd7ef1c1929d7a0329d4349252863c04d6f1729 Author: Eric W. Biederman <[email protected]> Date: Wed Mar 11 23:04:08 2015 -0500 net: Kill hold_net release_net hold_net and release_net were an idea that turned out to be useless. The code has been disabled since 2008. Kill the code it is long past due. Signed-off-by: "Eric W. Biederman" <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]> _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
