mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-09 02:51:11 +01:00
net/ipv4: add dst cache support for gre lwtunnels
In case of UDP traffic with datagram length below MTU this gives about 4% performance increase Signed-off-by: Paolo Abeni <[email protected]> Suggested-and-Acked-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
468dfffcd7
commit
3c1cb4d260
1 file changed
+10
-3
+10
-3
@@ -540,9 +540,16 @@ static void gre_fb_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
goto err_free_skb;
|
||||
|
||||
key = &tun_info->key;
|
||||
rt = gre_get_rt(skb, dev, &fl, key);
|
||||
if (IS_ERR(rt))
|
||||
goto err_free_skb;
|
||||
rt = !skb->mark ? dst_cache_get_ip4(&tun_info->dst_cache, &fl.saddr) :
|
||||
NULL;
|
||||
if (!rt) {
|
||||
rt = gre_get_rt(skb, dev, &fl, key);
|
||||
if (IS_ERR(rt))
|
||||
goto err_free_skb;
|
||||
if (!skb->mark)
|
||||
dst_cache_set_ip4(&tun_info->dst_cache, &rt->dst,
|
||||
fl.saddr);
|
||||
}
|
||||
|
||||
tunnel_hlen = ip_gre_calc_hlen(key->tun_flags);
|
||||
|
||||
|
||||
Reference in new issue
Block a user