From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C4171EEE6 for ; Sun, 28 Dec 2025 09:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766915211; cv=none; b=FrFT8uZGLb4m4HA8w63kVPGGPDEXrEUHUKr7KhuxTBY4XsRGCQiMyL6pRizg+7VzZ0i9i6lagZIXCQhcngUg9yly6lRSyGe76C4ysAAeD7nrXODFgUCUeg83MOCJspFLJmiTLhBTIoatbQ1wqN2LQQbrCztzjbUmwml364BCJvc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766915211; c=relaxed/simple; bh=OodS2yAnBIFA852Zv5YiSE+wbMBAqvugwCjE7HunCII=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hn9SxdvZuKDwXRax/oGrsrM/6049KFRrXNN5rIYLgvTQPhQpRdUqpUKvluI4s3WKWbDrBBInnLhYlCXhJtDjKF8qVwm6W+eQtb9u4maheX0CH6lHAttJvxjX69ymB270REDq1ZvnDtQfHDAZvyzVLq/V2kw52JF5mLCiHUjIZEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VyQ3rf/M; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=rugiwqoI; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VyQ3rf/M"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="rugiwqoI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766915206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ge5SdlXBdYhEP4en3o5QRhcTOGiZL41XI4QQuSQIjgI=; b=VyQ3rf/MnQccTfwWdL8e+jPFHXhPwCM5NZhz6kdOpmaVHymWGhYeVK+4BKtXoGjV31ZEsZ ark27N2wFMOewebRsusuZGtsT3QzIkONapqXnQbAKmSbjG/yXF66ZIRCs8RRC4UoY5FSM3 xNFwbYg3C29VR348lSw/HZzXfi/aOFs= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-rsa7dE7ZN1q61usLbSvZqA-1; Sun, 28 Dec 2025 04:46:42 -0500 X-MC-Unique: rsa7dE7ZN1q61usLbSvZqA-1 X-Mimecast-MFC-AGG-ID: rsa7dE7ZN1q61usLbSvZqA_1766915202 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-430fe16b481so4346627f8f.3 for ; Sun, 28 Dec 2025 01:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1766915201; x=1767520001; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ge5SdlXBdYhEP4en3o5QRhcTOGiZL41XI4QQuSQIjgI=; b=rugiwqoIe/si8swmHLw1Xal4PMMfzsrSpfJoaKRAtC1wJtMCWSGpF2W5p/8clA+PTo 9sDpWlZome38EKPeresS6iQpDm4mavWDAVkBeTQh1ib48e/bOjtX9VmKXoB+WKyWwd6k exKYWOaYEgWUHhHpqjoI7kNEjugo7/z867qfOsQXDqgy8ym6gWhUqgoKMc9YhXFK0Xux QTYAvjGxKknsMkKJNEnRPRpzh4UTJ+X65OQv0ZoA5pE0BshH6O7xlFiL1n/irSrmhjE3 QJMpVAogA6SGi6IR+x5T+zH1QvclbFNfFDwciKa1izjdTLiMrKAri1C8oVfu/VSNKR9P pggw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766915201; x=1767520001; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ge5SdlXBdYhEP4en3o5QRhcTOGiZL41XI4QQuSQIjgI=; b=KTiGPvsp+q4QMvHDupLGCjKG6t9pQJYsg7nOV/Yk5qybSpCO7wAERcWXl7Nf27pynL erkfgShl00qiP2yp3/6n8IZ4m0Vi8PJUfEuKGj0ghoFrbr5Wn/tBiHe5qIRgTj5U+UTY neCUPZV+vmyDF1jklzmn8xqmrV9S16DEm32Z60jKOPNWbRaLNgbmDabSNroDLZMxU0QB CTo1t6kvOdS3Ar85gIM232/bpYaypUUQYII6972fi3nH3K2sH4LTzXu2doPk6ILZSVRL v6nLD3DiUXY0mrKq6l03JnhVqRvz/2+yMEaE+dfApSAZBvIJdqz+AiVRBe6IWXaRBaWO /rpw== X-Forwarded-Encrypted: i=1; AJvYcCVLrDdrBjG/8uXXcZLAfGghAaZKs6nLIqtl5BsIhcHpmQ7c0IXmvktGuuGA7quJ8/XNLUdRfym0Ob4mrK4=@vger.kernel.org X-Gm-Message-State: AOJu0YwUoWoFDH7EcQx/w4GkZclUqcggDWsW3RX7mgrKwgLY4KC4hd0u jsHXnO2H62oi5TYf0mvQZNjxLQNvNoCCKG0EVdvtUq3+cCWzrkyQ7AOsBcbrqi8ZPV4S4aAQNWp uEjf/nWRlMmfFUxrCU0rT1Va94BEEnbGF885NP6NOsL4fZ8HLYAMQXOfhZk2Vo3sAIw== X-Gm-Gg: AY/fxX4zStFnh4KI5zJlU6Te9U1o1cGY6pL6Pcvm7+GjQmo8Qd7449zuoPH4m9EMKsP ZBAiaea705bVaLcm50h4Gfd0U6j/FPVl2zS6p8BF+AyDEvBjJI7EGqk5KvBFwBhIA+l8p6VwBPO xVvrroaMNBt+TA/s3mblVIPO84mT08Kf5Z6iBUHqJw1XKLsgRpwDxpntpM/AJA0cFquzd1ab6tE vrJbtsKiu42ciysSe4TLKrzF6juFt7iVl8F7bcLcv7kXHmw1yzGDjldv7AIcMY+y3UuPIKbw6v1 KEzIh8/ZiPWU8Ua2bndOo4nP6FFUD68lk2K3kUOFOie15+J2Gl7n2sfcB/KAWQRLXxSzE/TYB0x YPPtNiZbm8cFNtA== X-Received: by 2002:a5d:588a:0:b0:431:266:d132 with SMTP id ffacd0b85a97d-4324e50e072mr32720672f8f.46.1766915201547; Sun, 28 Dec 2025 01:46:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5g2n2Aco1N9BsfglndZJfK1etXD5OPcu22hlHIV94p7V2/oelZwGloC2kMyE0ipuuTsdQRg== X-Received: by 2002:a5d:588a:0:b0:431:266:d132 with SMTP id ffacd0b85a97d-4324e50e072mr32720644f8f.46.1766915201068; Sun, 28 Dec 2025 01:46:41 -0800 (PST) Received: from [192.168.88.32] ([169.155.232.231]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4324eaa64cesm56516824f8f.35.2025.12.28.01.46.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 28 Dec 2025 01:46:40 -0800 (PST) Message-ID: Date: Sun, 28 Dec 2025 10:46:39 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net 1/2] ipvlan: Make the addrs_lock be per port To: Dmitry Skorodumov , netdev@vger.kernel.org, Jakub Kicinski , Dmitry Skorodumov , Xiao Liang , Kuniyuki Iwashima , Julian Vetter , Guillaume Nault , Ido Schimmel , Eric Dumazet , Stanislav Fomichev , Etienne Champetier , "David S. Miller" , linux-kernel@vger.kernel.org Cc: Andrew Lunn References: <20251225185543.1459044-1-skorodumov.dmitry@huawei.com> <20251225185543.1459044-2-skorodumov.dmitry@huawei.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20251225185543.1459044-2-skorodumov.dmitry@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/25/25 7:55 PM, Dmitry Skorodumov wrote: > Make the addrs_lock be per port, not per ipvlan dev. > > Initial code seems to be written in the assumption, > that any address change must occur under RTNL. > But it is not so for the case of IPv6. So > > 1) Introduce per-port addrs_lock. > > 2) It was needed to fix places where it was forgotten > to take lock (ipvlan_open/ipvlan_close) > > 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 could 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 taken on fast > paths. > > Fixes: 8230819494b3 ("ipvlan: use per device spinlock to protect addrs list updates") > Signed-off-by: Dmitry Skorodumov > CC: Paolo Abeni Not so minor process nits: you should include the revision number in the subj prefix, and you should include the main changes vs the previous revision (and possibly even link to the previous revisions after the '---' separator, it will help reviewers greatly. Patch contents LGTM. /P