OpenVZ Forum - RDF feed
type: channel
items: [PATCH 0/12 net-2.6.25] [NETNS]: Routing namespacing on IP output path.
items: [PATCH 1/12 net-2.6.25] [IPV4]: Declarations cleanup in ip_fib.h.
items: [PATCH 2/12 net-2.6.25] [IPV4]: Consolidate fib_select_default.
items: [PATCH 3/12 net-2.6.25] [NETNS]: Add netns parameter to fib_select_default.
items: [PATCH 4/12 net-2.6.25] [NETNS]: Add namespace parameter to ip_dev_find.
items: [PATCH 5/12 net-2.6.25] [NETNS]: Re-export init_net via EXPORT_SYMBOL.
items: [PATCH 6/12 net-2.6.25] [NETNS]: Add namespace parameter to ip_route_output_slow.
items: [PATCH 7/12 net-2.6.25] [NETNS]: Add namespace parameter to __ip_route_output_key.
items: [PATCH 8/12 net-2.6.25] [NETNS]: Add namespace parameter to ip_route_output_flow.
items: [PATCH 9/12 net-2.6.25] [NETNS]: Add namespace parameter to ip_route_output_key.
items: Re: [PATCH 5/12 net-2.6.25] [NETNS]: Re-export init_net via EXPORT_SYMBOL.
items: Re: [PATCH 0/12 net-2.6.25] [NETNS]: Routing namespacing on IP output path.
items: [PATCH 10/12 net-2.6.25] [NETNS]: Correct namespace for connect-time routing.
items: [PATCH 11/12 net-2.6.25] [NETNS]: Routing cache virtualization.
items: [PATCH 12/12 net-2.6.25] [NETNS]: Add namespace for ICMP replying code.
items: Re: [PATCH 10/12 net-2.6.25] [NETNS]: Correct namespace for connect-time routing.
items: Re: [PATCH 11/12 net-2.6.25] [NETNS]: Routing cache virtualization.
items: Re: [PATCH 12/12 net-2.6.25] [NETNS]: Add namespace for ICMP replying code.

[PATCH 0/12 net-2.6.25] [NETNS]: Routing namespacing on IP output path.
type: item
description: This set introduces namespacing in the IP output path. The namespace is added to all routing API functions except ones with a valid socket. This is very intrusive. Routing cache is virtualized as a part of this efforts, though the hash function is not tuned to use namespace id. This not required to work in initial namespace. ICMP replies now also use correct namespace. Signed-off-by: Denis V. Lunev <den@openvz.org>
creator: den
date: 2008-01-22T15:58:54-00:00

[PATCH 1/12 net-2.6.25] [IPV4]: Declarations cleanup in ip_fib.h.
type: item
description: Two small issues fixed: - fib_select_multipath is exported from fib_semantics.c rather than from fib_frontend.c. So, move the declaration below appropriate comment. - struct rt_entry declaration is not used. Drop it. Signed-off-by: Denis V. Lunev <den@openvz.org> --- include/net/ip_fib.h | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index a859124..be70b33 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -222,15 +222,13 @@ extern const struct nla_policy rtm_ipv4_policy[]; extern void ip_fib_init(void); extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, struct net_device *dev, __be32 *spec_dst, u32 *itag); -extern void fib_select_multipath(const struct flowi *flp, struct fib_result *res); - -struct rtentry; /* Exported by fib_semantics.c */ extern int ip_fib_check_default(__be32 gw, struct net_device *dev); extern int fib_sync_down(__be32 local, struct net_device *dev, int force); extern int fib_sync_up(struct net_device *dev); extern __be32 __fib_res_prefsrc(struct fib_result *res); +extern void fib_select_multipath(const struct flowi *flp, struct fib_result *res); /* Exported by fib_{hash|trie}.c */ extern void fib_hash_init(void); -- 1.5.3.rc5
creator: den
date: 2008-01-22T15:59:18-00:00

[PATCH 2/12 net-2.6.25] [IPV4]: Consolidate fib_select_default.
type: item
description: The difference in the implementation of the fib_select_default when CONFIG_IP_MULTIPLE_TABLES is (not) defined looks negligible. Consolidate it and place into fib_frontend.c. Signed-off-by: Denis V. Lunev <den@openvz.org> --- include/net/ip_fib.h | 10 +--------- net/ipv4/fib_frontend.c | 14 ++++++++++++++ net/ipv4/fib_rules.c | 10 ---------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index be70b33..39f944a 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -193,14 +193,6 @@ static inline int fib_lookup(struct net *net, const struct flowi *flp, return -ENETUNREACH; } -static inline void fib_select_default(const struct flowi *flp, - struct fib_result *res) -{ - struct fib_table *table = fib_get_table(&init_net, RT_TABLE_MAIN); - if (FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) - table->tb_select_default(table, flp, res); -} - #else /* CONFIG_IP_MULTIPLE_TABLES */ extern int __net_init fib4_rules_init(struct net *net); extern void __net_exit fib4_rules_exit(struct net *net); @@ -213,7 +205,6 @@ extern int fib_lookup(struct net *n, struct flowi *flp, struct fib_result *res); extern struct fib_table *fib_new_table(struct net *net, u32 id); extern struct fib_table *fib_get_table(struct net *net, u32 id); -extern void fib_select_default(const struct flowi *flp, struct fib_result *res); #endif /* CONFIG_IP_MULTIPLE_TABLES */ @@ -222,6 +213,7 @@ extern const struct nla_policy rtm_ipv4_policy[]; extern void ip_fib_init(void); extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, struct net_device *dev, __be32 *spec_dst, u32 *itag); +extern void fib_select_default(const struct flowi *flp, struct fib_result *res); /* Exported by fib_semantics.c */ extern int ip_fib_check_default(__be32 gw, struct net_device *dev); diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 6761639..13bf01d 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c …
creator: den
date: 2008-01-22T15:59:19-00:00

[PATCH 3/12 net-2.6.25] [NETNS]: Add netns parameter to fib_select_default.
type: item
description: Currently fib_select_default calls fib_get_table() with the init_net. Prepare it to provide a correct namespace to lookup default route. Signed-off-by: Denis V. Lunev <den@openvz.org> --- include/net/ip_fib.h | 3 ++- net/ipv4/fib_frontend.c | 5 +++-- net/ipv4/route.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 39f944a..9daa60b 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -213,7 +213,8 @@ extern const struct nla_policy rtm_ipv4_policy[]; extern void ip_fib_init(void); extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, struct net_device *dev, __be32 *spec_dst, u32 *itag); -extern void fib_select_default(const struct flowi *flp, struct fib_result *res); +extern void fib_select_default(struct net *net, const struct flowi *flp, + struct fib_result *res); /* Exported by fib_semantics.c */ extern int ip_fib_check_default(__be32 gw, struct net_device *dev); diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 13bf01d..7e3e732 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -116,7 +116,8 @@ struct fib_table *fib_get_table(struct net *net, u32 id) } #endif /* CONFIG_IP_MULTIPLE_TABLES */ -void fib_select_default(const struct flowi *flp, struct fib_result *res) +void fib_select_default(struct net *net, + const struct flowi *flp, struct fib_result *res) { struct fib_table *tb; int table = RT_TABLE_MAIN; @@ -125,7 +126,7 @@ void fib_select_default(const struct flowi *flp, struct fib_result *res) return; table = res->r->table; #endif - tb = fib_get_table(&init_net, table); + tb = fib_get_table(net, table); if (FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) tb->tb_select_default(tb, flp, res); } diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 27e0f81..4313255 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2419,7 +2419,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *old…
creator: den
date: 2008-01-22T15:59:20-00:00

[PATCH 4/12 net-2.6.25] [NETNS]: Add namespace parameter to ip_dev_find.
type: item
description: in_dev_find() need a namespace to pass it to fib_get_table(), so add an argument. Signed-off-by: Denis V. Lunev <den@openvz.org> --- drivers/infiniband/core/addr.c | 4 ++-- drivers/infiniband/core/cma.c | 2 +- include/linux/inetdevice.h | 2 +- net/ipv4/fib_frontend.c | 4 ++-- net/ipv4/igmp.c | 2 +- net/ipv4/ip_sockglue.c | 2 +- net/ipv4/ipmr.c | 2 +- net/ipv4/route.c | 6 +++--- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index 0802b79..963177e 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -110,7 +110,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) __be32 ip = ((struct sockaddr_in *) addr)->sin_addr.s_addr; int ret; - dev = ip_dev_find(ip); + dev = ip_dev_find(&init_net, ip); if (!dev) return -EADDRNOTAVAIL; @@ -261,7 +261,7 @@ static int addr_resolve_local(struct sockaddr_in *src_in, __be32 dst_ip = dst_in->sin_addr.s_addr; int ret; - dev = ip_dev_find(dst_ip); + dev = ip_dev_find(&init_net, dst_ip); if (!dev) return -EADDRNOTAVAIL; diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index b37045c..ef9efb3 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -1280,7 +1280,7 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id, atomic_inc(&conn_id->dev_remove); conn_id->state = CMA_CONNECT; - dev = ip_dev_find(iw_event->local_addr.sin_addr.s_addr); + dev = ip_dev_find(&init_net, iw_event->local_addr.sin_addr.s_addr); if (!dev) { ret = -EADDRNOTAVAIL; cma_enable_remove(conn_id); diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index e74a2ee..8d9eaae 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -129,7 +129,7 @@ struct in_ifaddr extern int register_inetaddr_notifier(struct notifier_block *nb); extern int unregister_inetaddr_notifier(struct notifier_block *nb); -extern struct net_device *ip_dev_find(__be32 addr);…
creator: den
date: 2008-01-22T15:59:21-00:00

[PATCH 5/12 net-2.6.25] [NETNS]: Re-export init_net via EXPORT_SYMBOL.
type: item
description: init_net is used added as a parameter to a lot of old API calls, f.e. ip_dev_find. These calls were exported as EXPORT_SYMBOL. So, export init_net as EXPORT_SYMBOL to keep networking API consistent. Signed-off-by: Denis V. Lunev <den@openvz.org> --- net/core/net_namespace.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 8023208..26e941d 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -18,7 +18,7 @@ static DEFINE_MUTEX(net_mutex); LIST_HEAD(net_namespace_list); struct net init_net; -EXPORT_SYMBOL_GPL(init_net); +EXPORT_SYMBOL(init_net); /* * setup_net runs the initializers for the network namespace object. -- 1.5.3.rc5
creator: den
date: 2008-01-22T15:59:22-00:00

[PATCH 6/12 net-2.6.25] [NETNS]: Add namespace parameter to ip_route_output_slow.
type: item
description: This function needs a net namespace to lookup devices, fib tables, etc. in, so pass it there. Signed-off-by: Denis V. Lunev <den@openvz.org> --- net/ipv4/route.c | 22 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 674575b..c1f9950 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2248,7 +2248,8 @@ static inline int ip_mkroute_output(struct rtable **rp, * Major route resolver routine. */ -static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp) +static int ip_route_output_slow(struct net *net, struct rtable **rp, + const struct flowi *oldflp) { u32 tos = RT_FL_TOS(oldflp); struct flowi fl = { .nl_u = { .ip4_u = @@ -2260,7 +2261,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp) RT_SCOPE_UNIVERSE), } }, .mark = oldflp->mark, - .iif = init_net.loopback_dev->ifindex, + .iif = net->loopback_dev->ifindex, .oif = oldflp->oif }; struct fib_result res; unsigned flags = 0; @@ -2282,7 +2283,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp) goto out; /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */ - dev_out = ip_dev_find(&init_net, oldflp->fl4_src); + dev_out = ip_dev_find(net, oldflp->fl4_src); if (dev_out == NULL) goto out; @@ -2322,7 +2323,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp) if (oldflp->oif) { - dev_out = dev_get_by_index(&init_net, oldflp->oif); + dev_out = dev_get_by_index(net, oldflp->oif); err = -ENODEV; if (dev_out == NULL) goto out; @@ -2356,15 +2357,15 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp) fl.fl4_dst = fl.fl4_src = htonl(INADDR_LOOPBACK); if (dev_out) dev_put(dev_out); - dev_out = init_net.loopback_dev; + dev_out = net->loopback_dev; dev_hold(dev_out); - fl.oif = init_net.loopback_dev->ifindex; + fl.oif = net->loopback_dev->ifindex; res.type = RTN_LOCAL; flags |= RTCF_LOCAL; goto make_r…
creator: den
date: 2008-01-22T15:59:23-00:00

[PATCH 7/12 net-2.6.25] [NETNS]: Add namespace parameter to __ip_route_output_key.
type: item
description: This is only required to propagate it down to the ip_route_output_slow. Signed-off-by: Denis V. Lunev <den@openvz.org> --- include/net/route.h | 4 ++-- net/ipv4/icmp.c | 4 ++-- net/ipv4/route.c | 7 ++++--- net/ipv4/xfrm4_policy.c | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/net/route.h b/include/net/route.h index 5847e6f..3e3b14e 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -110,7 +110,7 @@ extern int ip_rt_init(void); extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, __be32 src, struct net_device *dev); extern void rt_cache_flush(int how); -extern int __ip_route_output_key(struct rtable **, const struct flowi *flp); +extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); extern int ip_route_output_key(struct rtable **, struct flowi *flp); extern int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin); @@ -158,7 +158,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, int err; if (!dst || !src) { - err = __ip_route_output_key(rp, &fl); + err = __ip_route_output_key(&init_net, rp, &fl); if (err) return err; fl.fl4_dst = (*rp)->rt_dst; diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 7ed8c50..21422bf 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -569,7 +569,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) struct rtable *rt2; security_skb_classify_flow(skb_in, &fl); - if (__ip_route_output_key(&rt, &fl)) + if (__ip_route_output_key(&init_net, &rt, &fl)) goto out_unlock; /* No need to clone since we're just using its address. */ @@ -592,7 +592,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) goto out_unlock; if (inet_addr_type(&init_net, fl.fl4_src) == RTN_LOCAL) - err = __ip_route_output_key(&rt2, &fl); + err = __ip_route_output_key(&init_net, &…
creator: den
date: 2008-01-22T15:59:24-00:00

[PATCH 8/12 net-2.6.25] [NETNS]: Add namespace parameter to ip_route_output_flow.
type: item
description: Needed to propagate it down to the __ip_route_output_key. Signed_off_by: Denis V. Lunev <den@openvz.org> --- drivers/infiniband/hw/cxgb3/iwch_cm.c | 2 +- include/net/route.h | 6 +++--- net/dccp/ipv4.c | 2 +- net/ipv4/af_inet.c | 2 +- net/ipv4/inet_connection_sock.c | 2 +- net/ipv4/ip_output.c | 2 +- net/ipv4/raw.c | 2 +- net/ipv4/route.c | 7 ++++--- net/ipv4/udp.c | 2 +- 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index 20ba372..ff3dee4 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c @@ -332,7 +332,7 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip, } }; - if (ip_route_output_flow(&rt, &fl, NULL, 0)) + if (ip_route_output_flow(&init_net, &rt, &fl, NULL, 0)) return NULL; return rt; } diff --git a/include/net/route.h b/include/net/route.h index 3e3b14e..6b970d7 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -112,7 +112,7 @@ extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, extern void rt_cache_flush(int how); extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); extern int ip_route_output_key(struct rtable **, struct flowi *flp); -extern int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); +extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin); extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu); extern void ip_rt_send_redirect(struct sk_buff *skb); @@ -167,7 +167,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, *rp = NULL; } security_sk_classify_flow(sk, &fl); - return ip_route_output_flow(rp, &fl, sk, flags); + return ip_route_output_flow(&init_net, rp, &fl, sk, flags); } static in…
creator: den
date: 2008-01-22T15:59:25-00:00

[PATCH 9/12 net-2.6.25] [NETNS]: Add namespace parameter to ip_route_output_key.
type: item
description: Needed to propagate it down to the ip_route_output_flow. Signed-off-by: Denis V. Lunev <den@openvz.org> --- drivers/infiniband/core/addr.c | 4 ++-- drivers/net/bonding/bond_main.c | 2 +- include/net/route.h | 2 +- net/atm/clip.c | 2 +- net/bridge/br_netfilter.c | 2 +- net/ipv4/arp.c | 6 +++--- net/ipv4/icmp.c | 4 ++-- net/ipv4/igmp.c | 6 +++--- net/ipv4/ip_gre.c | 10 +++++----- net/ipv4/ip_output.c | 2 +- net/ipv4/ipip.c | 8 ++++---- net/ipv4/ipmr.c | 4 ++-- net/ipv4/ipvs/ip_vs_xmit.c | 6 +++--- net/ipv4/netfilter.c | 6 +++--- net/ipv4/netfilter/nf_nat_rule.c | 2 +- net/ipv4/route.c | 6 +++--- net/ipv4/syncookies.c | 2 +- net/ipv6/ip6_tunnel.c | 4 ++-- net/ipv6/sit.c | 4 ++-- net/rxrpc/ar-peer.c | 2 +- net/sctp/protocol.c | 4 ++-- 21 files changed, 44 insertions(+), 44 deletions(-) diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index 963177e..a58ad8a 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -158,7 +158,7 @@ static void addr_send_arp(struct sockaddr_in *dst_in) memset(&fl, 0, sizeof fl); fl.nl_u.ip4_u.daddr = dst_ip; - if (ip_route_output_key(&rt, &fl)) + if (ip_route_output_key(&init_net, &rt, &fl)) return; neigh_event_send(rt->u.dst.neighbour, NULL); @@ -179,7 +179,7 @@ static int addr_resolve_remote(struct sockaddr_in *src_in, memset(&fl, 0, sizeof fl); fl.nl_u.ip4_u.daddr = dst_ip; fl.nl_u.ip4_u.saddr = src_ip; - ret = ip_route_output_key(&rt, &fl); + ret = ip_route_output_key(&init_net, &rt, &fl); if (ret) goto out; diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index b0b2603..7a7be20 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2513,7 +2513,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) fl.fl4_dst = targets[i]; fl.fl4_tos = RTO_ONLINK; - rv = ip_route_output_key(&rt, &fl); + rv = ip_route_output_key(&init_net, &rt, &fl); if (rv) { if (net_ratelimit()) { printk(KERN_WARNING DRV_NAME diff…
creator: den
date: 2008-01-22T15:59:26-00:00

Re: [PATCH 5/12 net-2.6.25] [NETNS]: Re-export init_net via EXPORT_SYMBOL.
type: item
description: Denis V. Lunev wrote: > init_net is used added as a parameter to a lot of old API calls, f.e. > ip_dev_find. These calls were exported as EXPORT_SYMBOL. So, export init_net > as EXPORT_SYMBOL to keep networking API consistent. I think this should go in 2.6.24 if still possible so people don't have to find workarounds that will be obsolete one version later.
creator: Patrick McHardy
date: 2008-01-22T17:04:40-00:00

Re: [PATCH 5/12 net-2.6.25] [NETNS]: Re-export init_net via EXPORT_SYMBOL.
type: item
description: Patrick McHardy wrote: > Denis V. Lunev wrote: >> init_net is used added as a parameter to a lot of old API calls, f.e. >> ip_dev_find. These calls were exported as EXPORT_SYMBOL. So, export >> init_net >> as EXPORT_SYMBOL to keep networking API consistent. > > > I think this should go in 2.6.24 if still possible so people > don't have to find workarounds that will be obsolete one > version later. > yep, sure :) should I send this one separate for 2.4?
creator: dlunev
date: 2008-01-22T17:19:11-00:00

Re: [PATCH 5/12 net-2.6.25] [NETNS]: Re-export init_net via EXPORT_SYMBOL.
type: item
description: From: "Denis V. Lunev" <dlunev@gmail.com> Date: Tue, 22 Jan 2008 20:19:11 +0300 > Patrick McHardy wrote: > > Denis V. Lunev wrote: > >> init_net is used added as a parameter to a lot of old API calls, f.e. > >> ip_dev_find. These calls were exported as EXPORT_SYMBOL. So, export > >> init_net > >> as EXPORT_SYMBOL to keep networking API consistent. > > > > > > I think this should go in 2.6.24 if still possible so people > > don't have to find workarounds that will be obsolete one > > version later. > > > yep, sure :) should I send this one separate for 2.4? I'll take care of this.
creator: davem
date: 2008-01-23T06:08:37-00:00

Re: [PATCH 0/12 net-2.6.25] [NETNS]: Routing namespacing on IP output path.
type: item
description: From: "Denis V. Lunev" <den@openvz.org> Date: Tue, 22 Jan 2008 18:58:54 +0300 > This set introduces namespacing in the IP output path. The namespace is > added to all routing API functions except ones with a valid socket. This > is very intrusive. > > Routing cache is virtualized as a part of this efforts, though the hash > function is not tuned to use namespace id. This not required to work in > initial namespace. > > ICMP replies now also use correct namespace. > > Signed-off-by: Denis V. Lunev <den@openvz.org> Only patches to 1-9 (out of 12) showed up in my mailbox and the netdev list so that is what I applied :-) Thanks!
creator: davem
date: 2008-01-23T06:09:52-00:00

[PATCH 10/12 net-2.6.25] [NETNS]: Correct namespace for connect-time routing.
type: item
description: ip_route_connect and ip_route_newports are a part of routing API presented to the socket layer. The namespace is available inside them through a socket. Signed-off-by: Denis V. Lunev <den@openvz.org> --- include/net/route.h | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/net/route.h b/include/net/route.h index d9b876a..1985d82 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -33,6 +33,7 @@ #include <linux/ip.h> #include <linux/cache.h> #include <linux/security.h> +#include <net/sock.h> #ifndef __KERNEL__ #warning This file is not supposed to be used outside of kernel. @@ -157,8 +158,9 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, .dport = dport } } }; int err; + struct net *net = sk->sk_net; if (!dst || !src) { - err = __ip_route_output_key(&init_net, rp, &fl); + err = __ip_route_output_key(net, rp, &fl); if (err) return err; fl.fl4_dst = (*rp)->rt_dst; @@ -167,7 +169,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, *rp = NULL; } security_sk_classify_flow(sk, &fl); - return ip_route_output_flow(&init_net, rp, &fl, sk, flags); + return ip_route_output_flow(net, rp, &fl, sk, flags); } static inline int ip_route_newports(struct rtable **rp, u8 protocol, @@ -184,7 +186,7 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol, ip_rt_put(*rp); *rp = NULL; security_sk_classify_flow(sk, &fl); - return ip_route_output_flow(&init_net, rp, &fl, sk, 0); + return ip_route_output_flow(sk->sk_net, rp, &fl, sk, 0); } return 0; } -- 1.5.3.rc5
creator: den
date: 2008-01-23T07:46:25-00:00

[PATCH 11/12 net-2.6.25] [NETNS]: Routing cache virtualization.
type: item
description: Basically, this piece looks relatively easy. Namespace is already available on the dst entry via device and the device is safe to dereferrence. Compare it with one of a searcher and skip entry if appropriate. The only exception is ip_rt_frag_needed. So, add namespace parameter to it. Signed-off-by: Denis V. Lunev <den@openvz.org> --- include/net/route.h | 2 +- net/ipv4/icmp.c | 2 +- net/ipv4/route.c | 21 ++++++++++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/include/net/route.h b/include/net/route.h index 1985d82..4eabf00 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -115,7 +115,7 @@ extern int __ip_route_output_key(struct net *, struct rtable **, const struct f extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin); -extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu); +extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu); extern void ip_rt_send_redirect(struct sk_buff *skb); extern unsigned inet_addr_type(struct net *net, __be32 addr); diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index c04aac5..052b278 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -696,7 +696,7 @@ static void icmp_unreach(struct sk_buff *skb) "and DF set.\n", NIPQUAD(iph->daddr)); } else { - info = ip_rt_frag_needed(iph, + info = ip_rt_frag_needed(&init_net, iph, ntohs(icmph->un.frag.mtu)); if (!info) goto out; diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 87076c6..07dd295 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -648,6 +648,11 @@ static inline int compare_keys(struct flowi *fl1, struct flowi *fl2) (fl1->iif ^ fl2->iif)) == 0; } +static inline int compare_netns(struct rtable *rt1, struct rtable *rt2) +{ …
creator: den
date: 2008-01-23T07:46:26-00:00

[PATCH 12/12 net-2.6.25] [NETNS]: Add namespace for ICMP replying code.
type: item
description: All needed API is done, the namespace is available when required from the device on the DST entry from the incoming packet. So, just replace init_net with proper namespace. Other protocols will follow. Signed-off-by: Denis V. Lunev <den@openvz.org> --- net/ipv4/icmp.c | 21 +++++++++++++-------- net/ipv4/ip_output.c | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 052b278..a6c092c 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -404,7 +404,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) .tos = RT_TOS(ip_hdr(skb)->tos) } }, .proto = IPPROTO_ICMP }; security_skb_classify_flow(skb, &fl); - if (ip_route_output_key(&init_net, &rt, &fl)) + if (ip_route_output_key(rt->u.dst.dev->nd_net, &rt, &fl)) goto out_unlock; } if (icmpv4_xrlim_allow(rt, icmp_param->data.icmph.type, @@ -436,9 +436,11 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) struct ipcm_cookie ipc; __be32 saddr; u8 tos; + struct net *net; if (!rt) goto out; + net = rt->u.dst.dev->nd_net; /* * Find the original header. It is expected to be valid, of course. @@ -514,7 +516,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) struct net_device *dev = NULL; if (rt->fl.iif && sysctl_icmp_errors_use_inbound_ifaddr) - dev = dev_get_by_index(&init_net, rt->fl.iif); + dev = dev_get_by_index(net, rt->fl.iif); if (dev) { saddr = inet_select_addr(dev, 0, RT_SCOPE_LINK); @@ -569,7 +571,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) struct rtable *rt2; security_skb_classify_flow(skb_in, &fl); - if (__ip_route_output_key(&init_net, &rt, &fl)) + if (__ip_route_output_key(net, &rt, &fl)) goto out_unlock; /* No need to clone since we're just using its address. */ @@ -591,14 +593,14 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) if (xfrm_decode_session_reverse(skb_in, &fl, AF_INET)) goto out_unlock; - if (inet_addr_type(&init_net…
creator: den
date: 2008-01-23T07:46:27-00:00

Re: [PATCH 10/12 net-2.6.25] [NETNS]: Correct namespace for connect-time routing.
type: item
description: From: "Denis V. Lunev" <den@openvz.org> Date: Wed, 23 Jan 2008 10:46:25 +0300 > ip_route_connect and ip_route_newports are a part of routing API presented to > the socket layer. The namespace is available inside them through a socket. > > Signed-off-by: Denis V. Lunev <den@openvz.org> Applied.
creator: davem
date: 2008-01-23T07:51:16-00:00

Re: [PATCH 11/12 net-2.6.25] [NETNS]: Routing cache virtualization.
type: item
description: From: "Denis V. Lunev" <den@openvz.org> Date: Wed, 23 Jan 2008 10:46:26 +0300 > Basically, this piece looks relatively easy. Namespace is already available > on the dst entry via device and the device is safe to dereferrence. Compare > it with one of a searcher and skip entry if appropriate. > > The only exception is ip_rt_frag_needed. So, add namespace parameter to it. > > Signed-off-by: Denis V. Lunev <den@openvz.org> Applied.
creator: davem
date: 2008-01-23T07:51:23-00:00

Re: [PATCH 12/12 net-2.6.25] [NETNS]: Add namespace for ICMP replying code.
type: item
description: From: "Denis V. Lunev" <den@openvz.org> Date: Wed, 23 Jan 2008 10:46:27 +0300 > All needed API is done, the namespace is available when required from the > device on the DST entry from the incoming packet. So, just replace init_net > with proper namespace. > > Other protocols will follow. > > Signed-off-by: Denis V. Lunev <den@openvz.org> Applied, thanks.
creator: davem
date: 2008-01-23T07:51:30-00:00

Re: [PATCH 12/12 net-2.6.25] [NETNS]: Add namespace for ICMP replying code.
type: item
description: hi, On Tue, 2008-01-22 at 23:51 -0800, David Miller wrote: > From: "Denis V. Lunev" <den@openvz.org> > Date: Wed, 23 Jan 2008 10:46:27 +0300 > > > All needed API is done, the namespace is available when required from the > > device on the DST entry from the incoming packet. So, just replace init_net > > with proper namespace. > > > > Other protocols will follow. > > > > Signed-off-by: Denis V. Lunev <den@openvz.org> > > Applied, thanks. I have been following the netns patches on this ML for a while but I still have not figured out in which tree the patches fed to David Miller are applied. I have attempted to grep the public trees 'davem/net-2.6' and 'davem/net-2.6.25' but without much success so far. Is there a public git tree I can clone which contains all the netns patches which David Miller state are 'Applied' ? thank you, Mathieu _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Mathieu Lacage
date: 2008-01-23T09:16:29-00:00

Re: [PATCH 12/12 net-2.6.25] [NETNS]: Add namespace for ICMP replying code.
type: item
description: In article <1201079789.10778.26.camel@mistigri.inria.fr> (at Wed, 23 Jan 2008 10:16:29 +0100), Mathieu Lacage <mathieu.lacage@sophia.inria.fr> says: > I have been following the netns patches on this ML for a while but I > still have not figured out in which tree the patches fed to David Miller > are applied. I have attempted to grep the public trees 'davem/net-2.6' > and 'davem/net-2.6.25' but without much success so far. Is there a > public git tree I can clone which contains all the netns patches which > David Miller state are 'Applied' ? I'm cloning from git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25.git There may be some time-lag. --yoshfuji _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: yoshfuji
date: 2008-01-23T09:30:36-00:00