[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e49bcbc4-b7ae-66b1-4964-957983688426@kernel.org>
Date: Thu, 21 Sep 2023 19:51:01 -0600
From: David Ahern <dsahern@...nel.org>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Ido Schimmel <idosch@...dia.com>, Benjamin Poirier <bpoirier@...dia.com>,
Thomas Haller <thaller@...hat.com>,
Stephen Hemminger <stephen@...workplumber.org>,
Eric Dumazet <edumazet@...gle.com>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>, Ido Schimmel <idosch@...sch.org>
Subject: Re: [PATCHv3 net 1/2] fib: convert fib_nh_is_v6 and nh_updated to use
a single bit
On 9/21/23 7:29 PM, Hangbin Liu wrote:
> On Thu, Sep 21, 2023 at 07:03:20AM -0600, David Ahern wrote:
>> On 9/20/23 9:14 PM, Hangbin Liu wrote:
>>> The FIB info structure currently looks like this:
>>> struct fib_info {
>>> struct hlist_node fib_hash; /* 0 16 */
>>> [...]
>>> u32 fib_priority; /* 80 4 */
>>>
>>> /* XXX 4 bytes hole, try to pack */
>>>
>>> struct dst_metrics * fib_metrics; /* 88 8 */
>>> int fib_nhs; /* 96 4 */
>>> bool fib_nh_is_v6; /* 100 1 */
>>> bool nh_updated; /* 101 1 */
>>>
>>> /* XXX 2 bytes hole, try to pack */
>>
>> 2B hole here and you want to add a single flag so another bool. I would
>> prefer the delay to a bitfield until all holes are consumed.
>>
>
> OK, just in case I didn't misunderstand. I should add a `bool pfsrc_removed`
> here and drop the first patch, right?
yes.
The bitfield has higher overhead. Let's reserve that overhead to when
there are no more holes and a new field pushes the struct over 128B.
Powered by blists - more mailing lists