Ver Fonte

ipv4: Delete routing cache.

The ipv4 routing cache is non-deterministic, performance wise, and is
subject to reasonably easy to launch denial of service attacks.

The routing cache works great for well behaved traffic, and the world
was a much friendlier place when the tradeoffs that led to the routing
cache's design were considered.

What it boils down to is that the performance of the routing cache is
a product of the traffic patterns seen by a system rather than being a
product of the contents of the routing tables.  The former of which is
controllable by external entitites.

Even for "well behaved" legitimate traffic, high volume sites can see
hit rates in the routing cache of only ~%10.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller há 13 anos atrás
pai
commit
89aef8921b
3 ficheiros alterados com 11 adições e 859 exclusões
  1. 0 1
      include/net/route.h
  2. 0 5
      net/ipv4/fib_frontend.c
  3. 11 853
      net/ipv4/route.c

+ 0 - 1
include/net/route.h

@@ -109,7 +109,6 @@ extern struct ip_rt_acct __percpu *ip_rt_acct;
 struct in_device;
 struct in_device;
 extern int		ip_rt_init(void);
 extern int		ip_rt_init(void);
 extern void		rt_cache_flush(struct net *net, int how);
 extern void		rt_cache_flush(struct net *net, int how);
-extern void		rt_cache_flush_batch(struct net *net);
 extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp);
 extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp);
 extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp,
 extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp,
 					   struct sock *sk);
 					   struct sock *sk);

+ 0 - 5
net/ipv4/fib_frontend.c

@@ -1072,11 +1072,6 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
 		rt_cache_flush(dev_net(dev), 0);
 		rt_cache_flush(dev_net(dev), 0);
 		break;
 		break;
 	case NETDEV_UNREGISTER_BATCH:
 	case NETDEV_UNREGISTER_BATCH:
-		/* The batch unregister is only called on the first
-		 * device in the list of devices being unregistered.
-		 * Therefore we should not pass dev_net(dev) in here.
-		 */
-		rt_cache_flush_batch(NULL);
 		break;
 		break;
 	}
 	}
 	return NOTIFY_DONE;
 	return NOTIFY_DONE;

Diff do ficheiro suprimidas por serem muito extensas
+ 11 - 853
net/ipv4/route.c


Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff