[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210119183506.21a2da79@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Tue, 19 Jan 2021 18:35:06 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: David Ahern <dsahern@...il.com>
Cc: Petr Machata <petrm@...dia.com>, netdev@...r.kernel.org,
David Ahern <dsahern@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Ido Schimmel <idosch@...dia.com>
Subject: Re: [PATCH net-next 1/3] nexthop: Use a dedicated policy for
nh_valid_get_del_req()
On Tue, 19 Jan 2021 19:28:40 -0700 David Ahern wrote:
> On 1/19/21 1:55 PM, Jakub Kicinski wrote:
> >> diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
> >> index e53e43aef785..d5d88f7c5c11 100644
> >> --- a/net/ipv4/nexthop.c
> >> +++ b/net/ipv4/nexthop.c
> >> @@ -36,6 +36,10 @@ static const struct nla_policy rtm_nh_policy[NHA_MAX + 1] = {
> >> [NHA_FDB] = { .type = NLA_FLAG },
> >> };
> >>
> >> +static const struct nla_policy rtm_nh_policy_get[NHA_MAX + 1] = {
> >
> > This is an unnecessary waste of memory if you ask me.
> >
> > NHA_ID is 1, so we're creating an array of 10 extra NULL elements.
> >
> > Can you leave the size to the compiler and use ARRAY_SIZE() below?
>
> interesting suggestion in general for netlink attributes.
According to tags on commit ff419afa4310 ("ethtool: trim policy
tables") the credit goes to Johannes :)
Powered by blists - more mailing lists