From: David Ahern <dsahern@gmail.com>
To: Martin Lau <kafai@fb.com>, David Ahern <dsahern@kernel.org>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"idosch@mellanox.com" <idosch@mellanox.com>
Subject: Re: [PATCH v2 net-next 5/5] ipv6: Flip to fib_nexthop_info
Date: Mon, 1 Apr 2019 14:20:01 -0600 [thread overview]
Message-ID: <b0b2c3ad-3901-7d5c-4a85-62b656b167c2@gmail.com> (raw)
In-Reply-To: <20190401201551.zacssf7a3ws3u772@kafai-mbp.dhcp.thefacebook.com>
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 <net/nexthop.h>
>> #include <net/lwtunnel.h>
>> #include <net/fib_notifier.h>
>> +#include <net/addrconf.h>
>>
>> #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.
prev parent reply other threads:[~2019-04-01 20:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-01 16:25 [PATCH v2 net-next 0/5] net: More movement to fib_nh_common David Ahern
2019-04-01 16:25 ` [PATCH v2 net-next 1/5] ipv4: Update fib_table_lookup tracepoint to take common nexthop David Ahern
2019-04-01 16:26 ` [PATCH v2 net-next 2/5] ipv4: Add fib_nh_common to fib_result David Ahern
2019-04-01 18:20 ` Martin Lau
2019-04-01 18:47 ` David Ahern
2019-04-01 16:26 ` [PATCH v2 net-next 3/5] ipv4: Refactor nexthop attributes in fib_dump_info David Ahern
2019-04-01 16:26 ` [PATCH v2 net-next 4/5] ipv4: Change fib_nexthop_info and fib_add_nexthop to take fib_nh_common David Ahern
2019-04-01 16:26 ` [PATCH v2 net-next 5/5] ipv6: Flip to fib_nexthop_info David Ahern
2019-04-01 20:15 ` Martin Lau
2019-04-01 20:20 ` David Ahern [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0b2c3ad-3901-7d5c-4a85-62b656b167c2@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=idosch@mellanox.com \
--cc=kafai@fb.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).