Commit 7bd86cc2 authored by Yan, Zheng's avatar Yan, Zheng Committed by David S. Miller

ipv4: Cache local output routes

Commit caacf05e causes big drop of UDP loop back performance.
The cause of the regression is that we do not cache the local output
routes. Each time we send a datagram from unconnected UDP socket,
the kernel allocates a dst_entry and adds it to the rt_uncached_list.
It creates lock contention on the rt_uncached_lock.
Reported-by: default avatarAlex Shi <alex.shi@intel.com>
Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aefe5c00
...@@ -2028,7 +2028,6 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4) ...@@ -2028,7 +2028,6 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
} }
dev_out = net->loopback_dev; dev_out = net->loopback_dev;
fl4->flowi4_oif = dev_out->ifindex; fl4->flowi4_oif = dev_out->ifindex;
res.fi = NULL;
flags |= RTCF_LOCAL; flags |= RTCF_LOCAL;
goto make_route; goto make_route;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment