ipv4: Set DST_NOCACHE in rt_dst_alloc().
Subsystems (3)
David Miller
maintainerRFC PATCH 3/3 ipv4: Set DST_NOCACHE in rt_dst_alloc().
Instead of using a read/modify/write in rt_finalize().
Signed-off-by David S. Miller <[email protected]>
--- net/ipv4/route.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-)
net/ipv4/route.c +5 -6
@@ -500,11 +500,6 @@ static int rt_garbage_collect(struct dst_ops *ops)static int rt_finalize (struct rtable *rt,struct rtable **rp,struct sk_buff *skb) { -/* To avoid expensive rcu stuff for this uncached dst, we set -* DST_NOCACHE so that dst_release() can free dst without -* waiting a grace period. -*/ - rt->dst.flags |=DST_NOCACHE ;if (rt->rt_type ==RTN_UNICAST ||rt_is_output_route (rt)) {int err =arp_bind_neighbour (&rt->dst);if (err) {
@@ -1114,7 +1109,11 @@ static struct rtable *rt_dst_alloc(bool nopolicy, bool noxfrm)if (rt) { rt->dst.obsolete =-1 ; - rt->dst.flags =DST_HOST | +/* To avoid expensive rcu stuff for this uncached dst, we set +* DST_NOCACHE so that dst_release() can free dst without +* waiting a grace period. +*/ + rt->dst.flags =DST_NOCACHE |DST_HOST | (nopolicy ?DST_NOPOLICY :0 ) | (noxfrm ?DST_NOXFRM :0 ); }
Signature · 1 line
1.7.4.1