Subject: Re: [PATCH] net: ip_finish_output_gso: If skb_gso_network_seglen exceeds MTU, do segmentation even for non IPSKB_FORWARDED skbs

From: Shmulik Ladkani <[email-masked]>
Date: Sun, 10 Jul 2016 10:51:20 +0300

On Sat, 9 Jul 2016 15:22:30 +0200, [email-masked] wrote:
> Shmulik Ladkani <[email-masked]> 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?
> 
> 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;
> +

Thanks.

OK with the general idea; However I don't want to abuse IPSKB_FORWARDED
as the skb is not really "ip forwarded", and it might have undesirable
affects, such as in 'ip_skb_dst_mtu' which follows.

How about a new IPSKB bit flag, say IPSKB_TUNNEL_FORWARDED, or a
different way of marking?

Regards,
Shmulik