From: Paolo Abeni <pabeni@redhat.com>
To: Dmitry Skorodumov <skorodumov.dmitry@huawei.com>,
netdev@vger.kernel.org, Kuniyuki Iwashima <kuniyu@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Xiao Liang <shaw.leon@gmail.com>,
Eric Dumazet <edumazet@google.com>,
Guillaume Nault <gnault@redhat.com>,
Julian Vetter <julian@outer-limits.org>,
Stanislav Fomichev <sdf@fomichev.me>,
Etienne Champetier <champetier.etienne@gmail.com>,
linux-kernel@vger.kernel.org
Cc: andrey.bokhanko@huawei.com, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net-next 05/12] ipvlan: Make the addrs_lock be per port
Date: Tue, 25 Nov 2025 15:16:10 +0100 [thread overview]
Message-ID: <106cc1c2-3e7a-438f-a7c3-7d8804665cb5@redhat.com> (raw)
In-Reply-To: <20251120174949.3827500-6-skorodumov.dmitry@huawei.com>
On 11/20/25 6:49 PM, Dmitry Skorodumov wrote:
> Make the addrs_lock be per port, not per ipvlan dev.
>
> This appears to be a very minor problem though.
> Since it's highly unlikely that ipvlan_add_addr() will
> be called on 2 CPU simultaneously. But nevertheless,
> this may cause:
>
> 1. False-negative of ipvlan_addr_busy(): one interface
> iterated through all port->ipvlans + ipvlan->addrs
> under some ipvlan spinlock, and another added IP
> under its own lock. Though this is only possible
> for IPv6, since looks like only ipvlan_addr6_event() can be
> called without rtnl_lock.
>
> 2. Race since ipvlan_ht_addr_add(port) is called under
> different ipvlan->addrs_lock locks
>
> This should not affect performance, since add/remove IP
> is a rare situation and spinlock is not locked on fast
> paths.
>
> Also, it's quite convenient to have addrs_lock on
> ipvl_port, to dynamically prevent conflict of IPs
> with addresses on main port.
>
> CC: Paolo Abeni <pabeni@redhat.com>
> Signed-off-by: Dmitry Skorodumov <skorodumov.dmitry@huawei.com>
This really looks like a fix, that should go via the 'net' tree with a
suitable fixes tag.
/P
next prev parent reply other threads:[~2025-11-25 14:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 17:49 [PATCH v5 net-next 00/12] ipvlan: support mac-nat mode Dmitry Skorodumov
2025-11-20 17:49 ` [PATCH net-next 01/12] ipvlan: Support MACNAT mode Dmitry Skorodumov
2025-11-25 12:58 ` Paolo Abeni
2025-11-27 8:13 ` Dmitry Skorodumov
2025-11-27 8:24 ` Paolo Abeni
2025-11-20 17:49 ` [PATCH net-next 02/12] ipvlan: macnat: Handle rx mcast-ip and unicast eth Dmitry Skorodumov
2025-11-20 17:49 ` [PATCH net-next 03/12] ipvlan: Forget all IP when device goes down Dmitry Skorodumov
2025-11-20 17:49 ` [PATCH net-next 04/12] ipvlan: Support IPv6 in macnat mode Dmitry Skorodumov
2025-11-20 17:49 ` [PATCH net-next 05/12] ipvlan: Make the addrs_lock be per port Dmitry Skorodumov
2025-11-25 14:16 ` Paolo Abeni [this message]
2025-11-20 17:49 ` [PATCH net-next 06/12] ipvlan: Take addr_lock in ipvlan_open() Dmitry Skorodumov
2025-11-25 14:17 ` Paolo Abeni
2025-11-20 17:49 ` [PATCH net-next 07/12] ipvlan: Don't allow children to use IPs of main Dmitry Skorodumov
2025-11-25 14:26 ` Paolo Abeni
2025-11-27 11:42 ` Dmitry Skorodumov
2025-11-20 17:49 ` [PATCH net-next 08/12] ipvlan: const-specifier for functions that use iaddr Dmitry Skorodumov
2025-11-20 17:49 ` [PATCH net-next 09/12] ipvlan: Common code from v6/v4 validator_event Dmitry Skorodumov
2025-11-20 17:49 ` [PATCH net-next 10/12] ipvlan: common code to handle ipv6/ipv4 address events Dmitry Skorodumov
2025-11-20 17:49 ` [PATCH net-next 11/12] ipvlan: Ignore PACKET_LOOPBACK in handle_mode_l2() Dmitry Skorodumov
2025-11-25 14:30 ` Paolo Abeni
2025-12-02 10:08 ` Dmitry Skorodumov
2025-11-20 17:49 ` [PATCH net-next 12/12] selftests: net: selftest for ipvlan-macnat mode Dmitry Skorodumov
2025-11-25 14:40 ` Paolo Abeni
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=106cc1c2-3e7a-438f-a7c3-7d8804665cb5@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrey.bokhanko@huawei.com \
--cc=champetier.etienne@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gnault@redhat.com \
--cc=idosch@nvidia.com \
--cc=julian@outer-limits.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sdf@fomichev.me \
--cc=shaw.leon@gmail.com \
--cc=skorodumov.dmitry@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.