From: we...@ucloud.cn Date: Tue, 15 Jan 2019 10:44:35 +0800 > + tun_info = skb_tunnel_info(skb); > + if (tun_info && (tun_info->mode & IP_TUNNEL_INFO_TX) && > + ip_tunnel_info_af(tun_info) == AF_INET && > + tun_info->key.u.ipv4.dst) { > + struct iphdr tnl_params_info; > + > + memcpy(&tnl_params_info, tnl_params, > + sizeof(tnl_params_info));
It is not at all reasonable to build and memcpy an entire extra iphdr on the cpu stack, for every packet transmit. That's terrible for performance. Please find a more minimal and efficient way to achieve the behavior you are looking for. Thank you.