mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-11 15:49:56 +00:00
sit: use dst_cache in ipip6_tunnel_xmit
Same as other ip tunnel, use dst_cache in xmit action to avoid unnecessary fib lookups. Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
14b4c48bb1
commit
6e3d1bbbba
@ -900,12 +900,17 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
|
|||||||
RT_TOS(tos), RT_SCOPE_UNIVERSE, IPPROTO_IPV6,
|
RT_TOS(tos), RT_SCOPE_UNIVERSE, IPPROTO_IPV6,
|
||||||
0, dst, tiph->saddr, 0, 0,
|
0, dst, tiph->saddr, 0, 0,
|
||||||
sock_net_uid(tunnel->net, NULL));
|
sock_net_uid(tunnel->net, NULL));
|
||||||
rt = ip_route_output_flow(tunnel->net, &fl4, NULL);
|
|
||||||
|
|
||||||
if (IS_ERR(rt)) {
|
rt = dst_cache_get_ip4(&tunnel->dst_cache, &fl4.saddr);
|
||||||
dev->stats.tx_carrier_errors++;
|
if (!rt) {
|
||||||
goto tx_error_icmp;
|
rt = ip_route_output_flow(tunnel->net, &fl4, NULL);
|
||||||
|
if (IS_ERR(rt)) {
|
||||||
|
dev->stats.tx_carrier_errors++;
|
||||||
|
goto tx_error_icmp;
|
||||||
|
}
|
||||||
|
dst_cache_set_ip4(&tunnel->dst_cache, &rt->dst, fl4.saddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rt->rt_type != RTN_UNICAST) {
|
if (rt->rt_type != RTN_UNICAST) {
|
||||||
ip_rt_put(rt);
|
ip_rt_put(rt);
|
||||||
dev->stats.tx_carrier_errors++;
|
dev->stats.tx_carrier_errors++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user