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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED 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 6C424C10F13 for ; Thu, 11 Apr 2019 04:54:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3140F20818 for ; Thu, 11 Apr 2019 04:54:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qn7rw9oj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726705AbfDKEy1 (ORCPT ); Thu, 11 Apr 2019 00:54:27 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38796 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbfDKEy1 (ORCPT ); Thu, 11 Apr 2019 00:54:27 -0400 Received: by mail-pg1-f195.google.com with SMTP id j26so2887191pgl.5 for ; Wed, 10 Apr 2019 21:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tzLRhhK89BQPNjM3lqshrNbVAUlqIc1iOvErjlfeOdI=; b=qn7rw9oj5uyup9FwVyPtOK09GHkTpUuCH0a1dFFRZIK9lGpm1bpJbeyf8zwh+7NIi0 oEHpQzJbGaBV+QZvNhouM17IADzKQqxBQRSXYUUnB1mpiEe1gtBlV6n28mnXZODWYHYN dYsDjHrRYPaaNrX57JUVm88utRRqNrl9AbjjMKjUGHX5HZz7QdHrpInHi9qoi086fVZZ 3qBce/6f7bAOVqgqFGX63wIG2e7FkQWexkQPHZD1I7HF9YWxDQOdHg+udle3QobKmGK3 Papn4RcadQWcb20iFUwiOFE/oP649ZvDFaNMbzR5z3L+tVJMI90fRfSrldIKcNdWn0bF X8qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tzLRhhK89BQPNjM3lqshrNbVAUlqIc1iOvErjlfeOdI=; b=uTMWCB1ooq53/zz56HfVCCcauVJ1lI2QWR7es8Wlj5Tx4kWDe3Ts0xUd7hDW4DO5Dl sD4vWvOu00sU4wWrebBASkkmt6PCBhgBa3q8LPD/eeOoVmEUrWJwsnrtbgcWFkWhq+B8 WJchmwjxiifackm7DuhUCWpti64hxRLHWsyJI4hYYHaxS3V0aMRGP2sY7LmpbEOh9blX xqXYvP9jLYSZFBYQ+lshXwibwFunxgwIOG2Hbf8Pv0W93RyVo3IsyIN3boYAOn6djAQP 5/2tcfOzv4EWOYRsE8CDqvAZKtaKt9EFNQTgvaCyL1Q7diDCn8zc2JyEe+tCVSJU6aOa ggsA== X-Gm-Message-State: APjAAAUoNpmwuisuxatCvwjv3DCYnu6mNLPPbZmT/hV2rwBBBwjeEQgE 9EopF36cYIPdL7NwYFQUEGZ08TtV X-Google-Smtp-Source: APXvYqyfWuuH1S0Gco+o782IFo1mv30u/L97TEC7+f0d4GDe8ofjrOCl80qqX1rHiFO3+pR7wA9ThQ== X-Received: by 2002:a62:7591:: with SMTP id q139mr33958415pfc.14.1554958466927; Wed, 10 Apr 2019 21:54:26 -0700 (PDT) Received: from [172.27.227.142] ([216.129.126.118]) by smtp.googlemail.com with ESMTPSA id a10sm3722788pfc.21.2019.04.10.21.54.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 21:54:19 -0700 (PDT) Subject: Re: [PATCH net-next 10/10] ipv6: Refactor __ip6_route_redirect To: Martin Lau Cc: David Ahern , "davem@davemloft.net" , "netdev@vger.kernel.org" , "idosch@mellanox.com" References: <20190409214119.15258-1-dsahern@kernel.org> <20190409214119.15258-11-dsahern@kernel.org> <20190410173616.fzj5mkm5yq4nio67@kafai-mbp.dhcp.thefacebook.com> <20190410204525.i7qxxpepp6s3y5bv@kafai-mbp.dhcp.thefacebook.com> From: David Ahern Message-ID: <73cdd5f6-57ad-75a5-b9d7-75d61d784e48@gmail.com> Date: Wed, 10 Apr 2019 21:54:18 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190410204525.i7qxxpepp6s3y5bv@kafai-mbp.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 4/10/19 1:45 PM, Martin Lau wrote: > On Wed, Apr 10, 2019 at 11:45:04AM -0700, David Ahern wrote: >>>> @@ -2420,7 +2449,7 @@ static struct rt6_info *__ip6_route_redirect(struct net *net, >>>> int flags) >>>> { >>>> struct ip6rd_flowi *rdfl = (struct ip6rd_flowi *)fl6; >>>> - struct rt6_info *ret = NULL, *rt_cache; >>>> + struct rt6_info *ret = NULL; >>>> struct fib6_info *rt; >>> The "rt" naming is becoming hard to review. >>> It is fortunate that the type context is kept in this diff. >>> >>> In this local case, the s/rt/f6i/ rename is quite doable? >> >> I looked into it and I feel such a mass rename just causes noise: >> $ egrep -r 'fib6_info \*rt[,;]' net | wc -l >> 50 >> >> so that's 50 functions that need to be updated and then all rt >> references within the functions. A lot of noise which is why I have not >> sent a name change patch. > Agree that it is a bit noisy (but obvious) change. > I think it was a mistake to decide to postpone this name change while > introducing fib6_info back then. It would be easier to review if > they were done together: > https://marc.info/?l=linux-netdev&m=151968617902168&w=2 > > I think a few of us are still ok-ish because we know what > have been going on. For some, it will be confusing and > it should not be suprised to see this 'struct fib6_info *rt' > being copy-and-pasted to the future patch that makes it > even harder to read/maintain. > As I mentioned in that URL: "My thought is to follow up with another patch that does the rename of rt to f6i for all fib6_info. Given how large this change is already I did not want to add extra diffs for that. If there is agreement to fold that part in now, I can do it." That was the theory. The reality is that it is a non-trivial change that can not be done cleanly: 'rt' does not allow a clean search and replace and when you consider the related changes (e.g., fib6_info *rt_last). I am 80% through net/ipv6/route.c with ip6_fib.c to go. This is the current diff stat: $ git diff --stat include/net/if_inet6.h | 2 +- include/net/ip6_fib.h | 20 +-- net/ipv6/addrconf.c | 84 ++++----- net/ipv6/route.c | 674 ++++++++++++++++++++++++++++++++++----------------------------------- 4 files changed, 390 insertions(+), 390 deletions(-) and that assumes I have done this right (ie., a clean compile). By the time I am done that is going to be on the order of 500 insert / 500 delete of manual name changes. I see that as unnecessary churn with no benefit.