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=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,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 DA05BC43381 for ; Mon, 1 Apr 2019 20:20:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 951E320880 for ; Mon, 1 Apr 2019 20:20:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X3aoR1fi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726685AbfDAUUE (ORCPT ); Mon, 1 Apr 2019 16:20:04 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40277 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726284AbfDAUUD (ORCPT ); Mon, 1 Apr 2019 16:20:03 -0400 Received: by mail-pf1-f194.google.com with SMTP id c207so5127290pfc.7 for ; Mon, 01 Apr 2019 13:20:03 -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=bEMVhHRT5O8O9xXLswzzHd2fWcfOgLjX3gsR8fI3c34=; b=X3aoR1fiiv/Vw72HXRJbxqFR+xsSis2yBBU1MyzH5QnLxqUXWCVOoBeX5EnNd1EUVP Tbl0DJxRWJ02+w4qT+wA4CTaf0MPxjQLpB32sI54tFVxPXwQVkA4bUVf6jThTmYVxNZ8 Q/KIWQikaTN7uTPAbmrTrY7lKhj8q/UWp34How/grNnWm9H3q0iLI+6h7169rP2Gju5b eY1DZfXFjqQ+E9F2S0ET0W/6NFWQDOWKo2R/TWy/hFZLtvN+6qIIDEjwVBq/aTAMhL5L 4VydYhiT0tbD2YZ3zTKPzSIBGZVHfpyo56a9NmErj+96MW05BYjnyOSK3O2p+bhUpLPz doww== 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=bEMVhHRT5O8O9xXLswzzHd2fWcfOgLjX3gsR8fI3c34=; b=jy4pEEbgPBzhrtI2p15j85gC3Eab2ZubfKkiK6B2Cq9jP4h6TYkMAe5bcxXqtzX8I0 873mN6OIcrrIVCg+ih3Mt9CIZUJfUeNaGStP16R6WjncbaItJRlR+4A0udbciox094Ag 5mpfYZJrn/IpXY1iV++2jaWp1rMZgXUcBrfTxu1jwXoZ6L9WMxwllAbi+fTgsaGT7XYR OdQmYDv6cYF2LcgtDB1cy2tmpJO1PtRZ0nHYlgmVFjNCLKFys7Md9qTPzC/DJTI3EUqx O2BVqSDx1UOvz5seDmMLbpbSJJMg7ZQE3eh+EW1iwRSgkMBivTXUMFpPde+5zm9Rssuq 9Y6A== X-Gm-Message-State: APjAAAXq2kdfvS7FeOvJI1ebVc1iceBy5pNfL26e3eyTUF+W7bfvCUSv ybEAlkB2BpmXtoJzTGggj2Q= X-Google-Smtp-Source: APXvYqzLAXchwR4+eZG8mykY1OplbfHqyf3xx2EcRqSm2ekjrvgoY/9B8R87Y+iDrauw+SP1xIpqAQ== X-Received: by 2002:a63:c242:: with SMTP id l2mr62809562pgg.138.1554150003250; Mon, 01 Apr 2019 13:20:03 -0700 (PDT) Received: from ?IPv6:2601:282:800:fd80:e4e1:a8b:a839:26ca? ([2601:282:800:fd80:e4e1:a8b:a839:26ca]) by smtp.googlemail.com with ESMTPSA id t3sm12950136pgv.39.2019.04.01.13.20.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 13:20:02 -0700 (PDT) Subject: Re: [PATCH v2 net-next 5/5] ipv6: Flip to fib_nexthop_info To: Martin Lau , David Ahern Cc: "davem@davemloft.net" , "netdev@vger.kernel.org" , "idosch@mellanox.com" References: <20190401162603.26914-1-dsahern@kernel.org> <20190401162603.26914-6-dsahern@kernel.org> <20190401201551.zacssf7a3ws3u772@kafai-mbp.dhcp.thefacebook.com> From: David Ahern Message-ID: Date: Mon, 1 Apr 2019 14:20:01 -0600 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: <20190401201551.zacssf7a3ws3u772@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/1/19 2:15 PM, Martin Lau wrote: >> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c >> index 6a8f8cd4d6db..7e8d5ed116fe 100644 >> --- a/net/ipv4/fib_semantics.c >> +++ b/net/ipv4/fib_semantics.c >> @@ -45,6 +45,7 @@ >> #include >> #include >> #include >> +#include >> >> #include "fib_lookup.h" >> >> @@ -1320,8 +1321,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg, >> return ERR_PTR(err); >> } >> >> -static int fib_nexthop_info(struct sk_buff *skb, const struct fib_nh_common *nh, >> - unsigned int *flags, bool skip_oif) >> +int fib_nexthop_info(struct sk_buff *skb, const struct fib_nh_common *nh, > nh should be renamed to nhc in Patch 4? for consistency it should. Will fix. > >> + unsigned int *flags, bool skip_oif, bool for_ipv4) > I assume "bool for_ipv4" will be used in a later patch also, can it be > removed from the current patch? yes, will remove. > >> { >> if (nh->nhc_flags & RTNH_F_DEAD) >> *flags |= RTNH_F_DEAD; >> @@ -1335,6 +1336,10 @@ static int fib_nexthop_info(struct sk_buff *skb, const struct fib_nh_common *nh, >> if (ip_ignore_linkdown(nh->nhc_dev)) >> *flags |= RTNH_F_DEAD; >> break; >> + case AF_INET6: >> + if (ip6_ignore_linkdown(nh->nhc_dev)) >> + *flags |= RTNH_F_DEAD; >> + break; >> } >> rcu_read_unlock(); >> } >> @@ -1345,6 +1350,11 @@ static int fib_nexthop_info(struct sk_buff *skb, const struct fib_nh_common *nh, >> if (nla_put_in_addr(skb, RTA_GATEWAY, nh->nhc_gw.ipv4)) >> goto nla_put_failure; >> break; >> + case AF_INET6: >> + if (nla_put_in6_addr(skb, RTA_GATEWAY, >> + &nh->nhc_gw.ipv6) < 0) >> + goto nla_put_failure; >> + break; >> } >> } >> > > [ ... ] > >> -/* add multipath next hop */ >> -static int rt6_add_nexthop(struct sk_buff *skb, const struct fib6_nh *fib6_nh) >> -{ >> - const struct net_device *dev = fib6_nh->fib_nh_dev; >> - struct rtnexthop *rtnh; >> - unsigned int flags = 0; >> - >> - rtnh = nla_reserve_nohdr(skb, sizeof(*rtnh)); >> - if (!rtnh) >> - goto nla_put_failure; >> - >> - rtnh->rtnh_hops = fib6_nh->fib_nh_weight - 1; >> - rtnh->rtnh_ifindex = dev ? dev->ifindex : 0; >> - >> - if (rt6_nexthop_info(skb, fib6_nh, &flags, true) < 0) >> - goto nla_put_failure; >> - >> - rtnh->rtnh_flags = flags; >> - >> - /* length of rtnetlink header + attributes */ >> - rtnh->rtnh_len = nlmsg_get_pos(skb) - (void *)rtnh; >> - >> - return 0; >> - >> -nla_put_failure: >> - return -EMSGSIZE; >> -} >> - >> static int rt6_fill_node(struct net *net, struct sk_buff *skb, >> struct fib6_info *rt, struct dst_entry *dst, > Off topic question question, > > After "net/ipv6: Flip FIB entries to fib6_info" (which was a great step forward), > any update on the followup in renaming "struct fib6_info *rt" to > "struct fib6_info *f6i"? > There are still places that use rt instead of f6i. I could do a sweep of the code. I have been trying to fix as I go whenever it makes sense - e.g., the name change does not distract from the goal of the patch.