Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751610AbdILXnU (ORCPT ); Tue, 12 Sep 2017 19:43:20 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:33466 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125AbdILXnS (ORCPT ); Tue, 12 Sep 2017 19:43:18 -0400 X-Originating-IP: 74.125.82.53 X-Google-Smtp-Source: AOwi7QBgB6GdTTv2EbUz8FwGZuJPKnmrswIgOFsEwEMdA7tctck60VK6xBbceNauv50inpaaSCt0EePxVJ8P9jUtthI= MIME-Version: 1.0 In-Reply-To: <1505199911-21153-1-git-send-email-yanhaishuang@cmss.chinamobile.com> References: <1505199911-21153-1-git-send-email-yanhaishuang@cmss.chinamobile.com> From: Pravin Shelar Date: Tue, 12 Sep 2017 16:43:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] geneve: Fix setting ttl value in collect metadata mode To: Haishuang Yan Cc: "David S. Miller" , Girish Moodalbail , Linux Kernel Network Developers , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1361 Lines: 32 On Tue, Sep 12, 2017 at 12:05 AM, Haishuang Yan wrote: > Similar to vxlan/ipip tunnel, if key->tos is zero in collect metadata > mode, tos should also fallback to ip{4,6}_dst_hoplimit. > > Signed-off-by: Haishuang Yan > > --- > Changes since v2: > * Make the commit message more clearer. > --- > drivers/net/geneve.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c > index f640407..d52a65f 100644 > --- a/drivers/net/geneve.c > +++ b/drivers/net/geneve.c > @@ -834,11 +834,10 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev, > sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true); > if (geneve->collect_md) { > tos = ip_tunnel_ecn_encap(key->tos, ip_hdr(skb), skb); > - ttl = key->ttl; > } else { > tos = ip_tunnel_ecn_encap(fl4.flowi4_tos, ip_hdr(skb), skb); > - ttl = key->ttl ? : ip4_dst_hoplimit(&rt->dst); > } > + ttl = key->ttl ? : ip4_dst_hoplimit(&rt->dst); > df = key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0; > This changes user API of Geneve collect-metadata mode. I do not see good reason for this. Why user can not set right TTL for the flow?