Skip to contentSkip to conversation

ipv4: Cache local output routes

PATCH In review Yan, Zheng 2 participants 2 messages Aug 13, 2012 – Aug 14, 2012

Subsystems (3)
lore
Share & tools
lore

Yan, Zheng

author
#0 lore raw

PATCH 1/1 ipv4: Cache local output routes

Commit caacf05e5ad1abf 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.

---

net/ipv4/route.c +0 -1
index e4ba974..fd9ecb5 100644
@@ -2028,7 +2028,6 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
 		}
 		dev_out = net->loopback_dev;
 		fl4->flowi4_oif = dev_out->ifindex;
-		res.fi = NULL;
 		flags |= RTCF_LOCAL;
 		goto make_route;
 	}
maintainer
#1 lore raw

From: "Yan, Zheng" <[email protected]>
Date: Mon, 13 Aug 2012 14:09:59 +0800

Quoted 8 lines

Commit caacf05e5ad1abf 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.

I was pretty sure not using 'fi' was necessary for semantic reasons here, but I can't find any such requirement, so I've applied this, thanks.