netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <dlezcano@fr.ibm.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, benjamin.thery@bull.net
Subject: Re: [PATCH] netns: embed ip6_dst_ops directly
Date: Sat, 29 Aug 2009 22:27:09 +0200	[thread overview]
Message-ID: <4A998F1D.2050705@fr.ibm.com> (raw)
In-Reply-To: <20090829113449.GA3067@x200.localdomain>

Alexey Dobriyan wrote:
> struct net::ipv6.ip6_dst_ops is separatedly dynamically allocated,
> but there is no fundamental reason for it. Embed it directly into
> struct netns_ipv6.
> 
> For that:
> * move struct dst_ops into separate header to fix circular dependencies
> 	I honestly tried not to, it's pretty impossible to do other way
> * drop dynamical allocation, allocate together with netns
> 
> For a change, remove struct dst_ops::dst_net, it's deducible
> by using container_of() given dst_ops pointer.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
> 
>  include/net/dst.h        |   23 +----------------------
>  include/net/dst_ops.h    |   28 ++++++++++++++++++++++++++++
>  include/net/netns/ipv6.h |    3 ++-
>  net/ipv6/route.c         |   34 +++++++++++++---------------------
>  4 files changed, 44 insertions(+), 44 deletions(-)
> 
> --- a/include/net/dst.h
> +++ b/include/net/dst.h
> @@ -8,6 +8,7 @@
>  #ifndef _NET_DST_H
>  #define _NET_DST_H
> 
> +#include <net/dst_ops.h>
>  #include <linux/netdevice.h>
>  #include <linux/rtnetlink.h>
>  #include <linux/rcupdate.h>
> @@ -102,28 +103,6 @@ struct dst_entry
>  	};
>  };
> 
> -
> -struct dst_ops
> -{
> -	unsigned short		family;
> -	__be16			protocol;
> -	unsigned		gc_thresh;
> -
> -	int			(*gc)(struct dst_ops *ops);
> -	struct dst_entry *	(*check)(struct dst_entry *, __u32 cookie);
> -	void			(*destroy)(struct dst_entry *);
> -	void			(*ifdown)(struct dst_entry *,
> -					  struct net_device *dev, int how);
> -	struct dst_entry *	(*negative_advice)(struct dst_entry *);
> -	void			(*link_failure)(struct sk_buff *);
> -	void			(*update_pmtu)(struct dst_entry *dst, u32 mtu);
> -	int			(*local_out)(struct sk_buff *skb);
> -
> -	atomic_t		entries;
> -	struct kmem_cache 		*kmem_cachep;
> -	struct net              *dst_net;
> -};

You will lose entries, kmem_cachep and gc_thresh per namespace, no ?

  reply	other threads:[~2009-08-29 20:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-29 11:34 [PATCH] netns: embed ip6_dst_ops directly Alexey Dobriyan
2009-08-29 20:27 ` Daniel Lezcano [this message]
2009-09-02  0:44 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A998F1D.2050705@fr.ibm.com \
    --to=dlezcano@fr.ibm.com \
    --cc=adobriyan@gmail.com \
    --cc=benjamin.thery@bull.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).