From patchwork Sat Jul 9 13:22:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Westphal X-Patchwork-Id: 646683 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rmsVR3hyvz9sCp for ; Sat, 9 Jul 2016 23:22:55 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933166AbcGINWl (ORCPT ); Sat, 9 Jul 2016 09:22:41 -0400 Received: from Chamillionaire.breakpoint.cc ([80.244.247.6]:36188 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932947AbcGINWk (ORCPT ); Sat, 9 Jul 2016 09:22:40 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.84_2) (envelope-from ) id 1bLsDG-0003G6-NN; Sat, 09 Jul 2016 15:22:30 +0200 Date: Sat, 9 Jul 2016 15:22:30 +0200 From: Florian Westphal To: Shmulik Ladkani Cc: Florian Westphal , "David S. Miller" , Eric Dumazet , Hannes Frederic Sowa , shmulik.ladkani@gmail.com, netdev@vger.kernel.org, Alexander Duyck , Tom Herbert Subject: Re: [PATCH] net: ip_finish_output_gso: If skb_gso_network_seglen exceeds MTU, do segmentation even for non IPSKB_FORWARDED skbs Message-ID: <20160709132230.GD2067@breakpoint.cc> References: <1467722132-10084-1-git-send-email-shmulik.ladkani@ravellosystems.com> <20160705130327.GA10737@breakpoint.cc> <20160705170541.3f210675@pixies> <20160709090020.GB2067@breakpoint.cc> <20160709153017.791f2607@halley> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160709153017.791f2607@halley> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Shmulik Ladkani wrote: > I'd appreciate any suggestion how to determine traffic is local OTHER > THAN testing IPSKB_FORWARDED; If we have such a way, there wouldn't be an > impact on local traffic. > > > What about setting IPCB FORWARD flag in iptunnel_xmit if > > skb->skb_iif != 0... instead? > > Can you please elaborate? [ not even compile tested ] diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c @@ -65,6 +65,7 @@ void iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb, struct net_device *dev = skb->dev; struct iphdr *iph; int err; + bool fwd = skb->skb_iif > 0; skb_scrub_packet(skb, xnet); @@ -72,6 +73,9 @@ void iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb, skb_dst_set(skb, &rt->dst); memset(IPCB(skb), 0, sizeof(*IPCB(skb))); + if (fwd) + IPCB(skb)->flags = IPSKB_FORWARDED; + /* Push down and install the IP header. */ skb_push(skb, sizeof(struct iphdr)); skb_reset_network_header(skb);