From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EAEAC43381 for ; Thu, 21 Feb 2019 18:37:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 093F42081B for ; Thu, 21 Feb 2019 18:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728037AbfBUSho (ORCPT ); Thu, 21 Feb 2019 13:37:44 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:41066 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726075AbfBUSho (ORCPT ); Thu, 21 Feb 2019 13:37:44 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id CE332145A92E9; Thu, 21 Feb 2019 10:37:43 -0800 (PST) Date: Thu, 21 Feb 2019 10:37:43 -0800 (PST) Message-Id: <20190221.103743.1368165116938788064.davem@davemloft.net> To: wenxu@ucloud.cn Cc: netdev@vger.kernel.org Subject: Re: [PATCH] ip_tunnel: Add ip tunnel tunnel_info dst_cache in ip_tunnel_xmit From: David Miller In-Reply-To: <1550750930-27138-1-git-send-email-wenxu@ucloud.cn> References: <1550750930-27138-1-git-send-email-wenxu@ucloud.cn> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 21 Feb 2019 10:37:43 -0800 (PST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: wenxu@ucloud.cn Date: Thu, 21 Feb 2019 20:08:50 +0800 > From: wenxu > > ip l add dev tun type gretap key 1000 > > Non-tunnel-dst ip tunnel device can send packet through lwtunnel. > This patch provide the tun_info dst cache support for this mode > > Signed-off-by: wenxu > --- > net/ipv4/ip_tunnel.c | 25 ++++++++++++++++++++----- > 1 file changed, 20 insertions(+), 5 deletions(-) > > diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c > index 893f013..874ad58 100644 > --- a/net/ipv4/ip_tunnel.c > +++ b/net/ipv4/ip_tunnel.c > @@ -662,6 +662,9 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, > unsigned int max_headroom; /* The extra header space needed */ > __be32 dst; > bool connected; > + bool use_cache = false; > + bool md = false; > + struct ip_tunnel_info *tun_info; Reverse christmas tree, please.