From: Dmitry Skorodumov <skorodumov.dmitry@huawei.com>
To: Eric Dumazet <edumazet@google.com>
Cc: Kuniyuki Iwashima <kuniyu@google.com>,
Dmitry Skorodumov <dskr99@gmail.com>, <netdev@vger.kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>,
Xiao Liang <shaw.leon@gmail.com>, <linux-kernel@vger.kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH v2 net-next 2/3] ipvlan: Common code from v6/v4 validator_event
Date: Tue, 27 Jan 2026 10:54:23 +0300 [thread overview]
Message-ID: <acb923ce-82f0-4a0a-bcfc-aadf00b746b6@huawei.com> (raw)
In-Reply-To: <CANn89iLQ2tDcWq-aLe-FhQU2cX8txF5L9SewiB1ssJh+7ds46Q@mail.gmail.com>
On 1/27/2026 10:37 AM, Eric Dumazet wrote:
> On Tue, Jan 27, 2026 at 6:56 AM Dmitry Skorodumov
> <skorodumov.dmitry@huawei.com> wrote:
>> It even might be a good idea to replace wherever possible preprocessor
>> checks with runtime checks. Use
>> if (IS_ENABLED(CONFIG_IPV6)) { ... }
>>
>> instead of #if IS_ENABLED(CONFIG_IPV6) ... #endif
>>
>> --
>>
>> I'm ok with both approaches (though i tend to like runtime checks) - but
>> unsure what is a common practice in bpf-net
>
> What you call runtime checks is in reality the same : C compiler is
> able to optimize constant boolean expressions
Should I fix patches to be something like
if (nblock == &ipvlan_addr4_vtor_notifier_block) {
} else if (IS_ENABLED(CONFIG_IPV6)) {
...
}
but still with __maybe_unused for ipvlan_addr6_vtor_notifier_block ?
I see that this __maybe_unused is used quite often in linux-kernel in
similar way
Dmitry
next prev parent reply other threads:[~2026-01-27 7:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260123170412.906280-1-skorodumov.dmitry@huawei.com>
2026-01-23 17:03 ` [PATCH v2 net-next 1/3] ipvlan: const-specifier for functions that use iaddr Dmitry Skorodumov
2026-01-23 17:03 ` [PATCH v2 net-next 2/3] ipvlan: Common code from v6/v4 validator_event Dmitry Skorodumov
2026-01-26 18:01 ` Kuniyuki Iwashima
2026-01-27 5:56 ` Dmitry Skorodumov
2026-01-27 7:37 ` Eric Dumazet
2026-01-27 7:54 ` Dmitry Skorodumov [this message]
2026-01-27 8:11 ` Kuniyuki Iwashima
2026-01-23 17:03 ` [PATCH v2 net-next 3/3] ipvlan: common code to handle ipv6/ipv4 address events Dmitry Skorodumov
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=acb923ce-82f0-4a0a-bcfc-aadf00b746b6@huawei.com \
--to=skorodumov.dmitry@huawei.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dskr99@gmail.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=shaw.leon@gmail.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
all inboxes | Powered by JetHome®