On 2/21/19 10:00 PM, we...@ucloud.cn wrote: > From: wenxu <we...@ucloud.cn> > > The lwtunnel_state is not init the dst_cache Which make the > ip_md_tunnel_xmit can't use the dst_cache. It will lookup > route table every packets. > > Signed-off-by: wenxu <we...@ucloud.cn> > --- > net/ipv4/ip_tunnel_core.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c > index 9a0e67b..f91ef7a 100644 > --- a/net/ipv4/ip_tunnel_core.c > +++ b/net/ipv4/ip_tunnel_core.c > @@ -252,6 +252,12 @@ static int ip_tun_build_state(struct nlattr *attr, > > tun_info = lwt_tun_info(new_state); > > + err = dst_cache_init(&tun_info->dst_cache, GFP_ATOMIC);
build_state is called with rtnl held. Unless I am missing something, you don't need ATOMIC here.