* [RFC(v2) net-next 12/13] ipv6: Remove temporary dst for icmpv6.
@ 2013-01-15 16:46 YOSHIFUJI Hideaki
2013-01-16 7:02 ` Cong Wang
0 siblings, 1 reply; 3+ messages in thread
From: YOSHIFUJI Hideaki @ 2013-01-15 16:46 UTC (permalink / raw)
To: netdev; +Cc: yoshfuji, xiyou.wangcong
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
net/ipv6/ip6_fib.c | 2 +-
net/ipv6/route.c | 98 ----------------------------------------------------
2 files changed, 1 insertion(+), 99 deletions(-)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 710cafd..1d7c448 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1643,7 +1643,7 @@ void fib6_run_gc(unsigned long expires, struct net *net)
gc_args.timeout = net->ipv6.sysctl.ip6_rt_gc_interval;
}
- gc_args.more = icmp6_dst_gc();
+ gc_args.more = 0;
fib6_clean_all(net, fib6_age, 0, NULL);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index e30a2aa..9605658 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1252,103 +1252,6 @@ static unsigned int ip6_mtu(const struct dst_entry *dst)
return mtu;
}
-static struct dst_entry *icmp6_dst_gc_list;
-static DEFINE_SPINLOCK(icmp6_dst_lock);
-
-struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
- struct neighbour *neigh,
- struct flowi6 *fl6)
-{
- struct dst_entry *dst;
- struct rt6_info *rt;
- struct inet6_dev *idev = in6_dev_get(dev);
- struct net *net = dev_net(dev);
-
- if (unlikely(!idev))
- return ERR_PTR(-ENODEV);
-
- rt = ip6_dst_alloc(net, dev, 0, NULL);
- if (unlikely(!rt)) {
- in6_dev_put(idev);
- dst = ERR_PTR(-ENOMEM);
- goto out;
- }
-
- if (neigh)
- neigh_hold(neigh);
- else {
- neigh = ip6_neigh_lookup(&rt->dst, NULL, &fl6->daddr);
- if (IS_ERR(neigh)) {
- in6_dev_put(idev);
- dst_free(&rt->dst);
- return ERR_CAST(neigh);
- }
- }
-
- rt->dst.flags |= DST_HOST;
- rt->dst.output = ip6_output;
- rt->n = neigh;
- atomic_set(&rt->dst.__refcnt, 1);
- rt->rt6i_dst.addr = fl6->daddr;
- rt->rt6i_dst.plen = 128;
- rt->rt6i_idev = idev;
- dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 0);
-
- spin_lock_bh(&icmp6_dst_lock);
- rt->dst.next = icmp6_dst_gc_list;
- icmp6_dst_gc_list = &rt->dst;
- spin_unlock_bh(&icmp6_dst_lock);
-
- fib6_force_start_gc(net);
-
- dst = xfrm_lookup(net, &rt->dst, flowi6_to_flowi(fl6), NULL, 0);
-
-out:
- return dst;
-}
-
-int icmp6_dst_gc(void)
-{
- struct dst_entry *dst, **pprev;
- int more = 0;
-
- spin_lock_bh(&icmp6_dst_lock);
- pprev = &icmp6_dst_gc_list;
-
- while ((dst = *pprev) != NULL) {
- if (!atomic_read(&dst->__refcnt)) {
- *pprev = dst->next;
- dst_free(dst);
- } else {
- pprev = &dst->next;
- ++more;
- }
- }
-
- spin_unlock_bh(&icmp6_dst_lock);
-
- return more;
-}
-
-static void icmp6_clean_all(int (*func)(struct rt6_info *rt, void *arg),
- void *arg)
-{
- struct dst_entry *dst, **pprev;
-
- spin_lock_bh(&icmp6_dst_lock);
- pprev = &icmp6_dst_gc_list;
- while ((dst = *pprev) != NULL) {
- struct rt6_info *rt = (struct rt6_info *) dst;
- if (func(rt, arg)) {
- *pprev = dst->next;
- dst_free(dst);
- } else {
- pprev = &dst->next;
- }
- }
- spin_unlock_bh(&icmp6_dst_lock);
-}
-
static int ip6_dst_gc(struct dst_ops *ops)
{
unsigned long now = jiffies;
@@ -2235,7 +2138,6 @@ void rt6_ifdown(struct net *net, struct net_device *dev)
};
fib6_clean_all(net, fib6_ifdown, 0, &adn);
- icmp6_clean_all(fib6_ifdown, &adn);
}
struct rt6_mtu_change_arg {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC(v2) net-next 12/13] ipv6: Remove temporary dst for icmpv6.
2013-01-15 16:46 [RFC(v2) net-next 12/13] ipv6: Remove temporary dst for icmpv6 YOSHIFUJI Hideaki
@ 2013-01-16 7:02 ` Cong Wang
2013-01-16 14:26 ` YOSHIFUJI Hideaki
0 siblings, 1 reply; 3+ messages in thread
From: Cong Wang @ 2013-01-16 7:02 UTC (permalink / raw)
To: YOSHIFUJI Hideaki; +Cc: netdev
On 01/16/2013 12:46 AM, YOSHIFUJI Hideaki wrote:
> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> ---
> net/ipv6/ip6_fib.c | 2 +-
> net/ipv6/route.c | 98 ----------------------------------------------------
> 2 files changed, 1 insertion(+), 99 deletions(-)
[...]
> -
> -int icmp6_dst_gc(void)
> -{
Please remove its declaration too:
include/net/ip6_route.h:extern int icmp6_dst_gc(void);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC(v2) net-next 12/13] ipv6: Remove temporary dst for icmpv6.
2013-01-16 7:02 ` Cong Wang
@ 2013-01-16 14:26 ` YOSHIFUJI Hideaki
0 siblings, 0 replies; 3+ messages in thread
From: YOSHIFUJI Hideaki @ 2013-01-16 14:26 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev, YOSHIFUJI Hideaki
Cong Wang wrote:
> On 01/16/2013 12:46 AM, YOSHIFUJI Hideaki wrote:
>> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
>> ---
>> net/ipv6/ip6_fib.c | 2 +-
>> net/ipv6/route.c | 98 ----------------------------------------------------
>> 2 files changed, 1 insertion(+), 99 deletions(-)
> [...]
>> -
>> -int icmp6_dst_gc(void)
>> -{
>
> Please remove its declaration too:
> include/net/ip6_route.h:extern int icmp6_dst_gc(void);
Agreed. Also removed icmp6_dst_alloc().
--yoshfuji
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-16 14:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 16:46 [RFC(v2) net-next 12/13] ipv6: Remove temporary dst for icmpv6 YOSHIFUJI Hideaki
2013-01-16 7:02 ` Cong Wang
2013-01-16 14:26 ` YOSHIFUJI Hideaki
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).