netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Ido Schimmel <idosch@nvidia.com>,
	Benjamin Poirier <bpoirier@nvidia.com>,
	Thomas Haller <thaller@redhat.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Eric Dumazet <edumazet@google.com>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Ido Schimmel <idosch@idosch.org>
Subject: Re: [PATCHv3 net 1/2] fib: convert fib_nh_is_v6 and nh_updated to use a single bit
Date: Thu, 21 Sep 2023 19:51:01 -0600	[thread overview]
Message-ID: <e49bcbc4-b7ae-66b1-4964-957983688426@kernel.org> (raw)
In-Reply-To: <ZQzuB00CJpr51C+N@Laptop-X1>

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.


  reply	other threads:[~2023-09-22  1:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21  3:14 [PATCHv3 net 0/2] IPv4: send notify when delete source address routes Hangbin Liu
2023-09-21  3:14 ` [PATCHv3 net 1/2] fib: convert fib_nh_is_v6 and nh_updated to use a single bit Hangbin Liu
2023-09-21 13:03   ` David Ahern
2023-09-22  1:29     ` Hangbin Liu
2023-09-22  1:51       ` David Ahern [this message]
2023-09-21  3:14 ` [PATCHv3 net 2/2] ipv4/fib: send notify when delete source address routes Hangbin Liu

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=e49bcbc4-b7ae-66b1-4964-957983688426@kernel.org \
    --to=dsahern@kernel.org \
    --cc=bpoirier@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idosch@idosch.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    --cc=stephen@networkplumber.org \
    --cc=thaller@redhat.com \
    /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).