lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201010181154.35792.hans.schillstrom@ericsson.com>
Date:	Mon, 18 Oct 2010 11:54:34 +0200
From:	Hans Schillstrom <hans.schillstrom@...csson.com>
To:	Daniel Lezcano <daniel.lezcano@...e.fr>
CC:	"lvs-devel@...r.kernel.org" <lvs-devel@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"netfilter-devel@...r.kernel.org" <netfilter-devel@...r.kernel.org>,
	"horms@...ge.net.au" <horms@...ge.net.au>, "ja@....bg" <ja@....bg>,
	"wensong@...ux-vs.org" <wensong@...ux-vs.org>
Subject: Re: [RFC PATCH 1/9] ipvs network name space aware

On Monday 18 October 2010 10:59:25 Daniel Lezcano wrote:
> On 10/08/2010 01:16 PM, Hans Schillstrom wrote:
> > This part contains the include files
> > where include/net/netns/ip_vs.h is new and contains all moved vars.
> >
> > SUMMARY
> >
> >   include/net/ip_vs.h                     |  136 ++++---
> >   include/net/net_namespace.h             |    2 +
> >   include/net/netns/ip_vs.h               |  112 +++++
> >
> > Signed-off-by:Hans Schillstrom<hans.schillstrom@...csson.com>
> > ---
> >
> >    
> 
> [ ... ]
> 
> >   #ifdef CONFIG_IP_VS_IPV6
> > diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
> > index bd10a79..b59cdc5 100644
> > --- a/include/net/net_namespace.h
> > +++ b/include/net/net_namespace.h
> > @@ -15,6 +15,7 @@
> >   #include<net/netns/ipv4.h>
> >   #include<net/netns/ipv6.h>
> >   #include<net/netns/dccp.h>
> > +#include<net/netns/ip_vs.h>
> >   #include<net/netns/x_tables.h>
> >   #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
> >   #include<net/netns/conntrack.h>
> > @@ -91,6 +92,7 @@ struct net {
> >   	struct sk_buff_head	wext_nlevents;
> >   #endif
> >   	struct net_generic	*gen;
> > +	struct netns_ipvs       *ipvs;
> >   };
> >    
> 
> IMHO, it would be better to use the net_generic infra-structure instead 
> of adding a new field in the netns structure.
> 
> 
I realized that to, but the performance penalty is quite high with net_generic :-(
But on the other hand if you are going to backport it, (without recompiling the kernel)
you gonna need it!

My sugestion, take both with a configuration switch like:
(i.e. avoid the rcu locking)

--- net/ip_vs.h ---
...
extern int ip_vs_net_id;		/* net id for ip_vs */


static inline struct netns_ipvs * net_ipvs(struct net* net, int id) {
#ifdef CONFIG_IP_VS_FAST_NETNS
	return net->ipvs;
#else
	return (struct netns_ipvs *)net_generic(net, id);
#endif
}
...

and where you need the netns_ipvs struct ptr,
[snip]
struct ip_vs_conn *ip_vs_conn_in_get(struct net *net, ....
{
	struct netns_ipvs *ipvs = net_ipvs(net, ip_vs_net_id);
...

-- 
Regards
Hans Schillstrom <hans.schillstrom@...csson.com>
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ