From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37A95270552 for ; Sat, 28 Feb 2026 07:16:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772262979; cv=none; b=JMFANKyZoLXNAUZNek9Dea1VVEfOtnrvnHyr5TliNhZcjAaeeYVvh63IimlWXyUxv6odkcoNdUfo0EBsFmHIAckh7Uo7yPAdyi9Sx9AFxrexcW5gl9JZy2NjS8B06GM9IuTv2jyWok24fH24YTU6Eovp7WiMXNPrQRmT4QLMb1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772262979; c=relaxed/simple; bh=tsmXhSYjLmgpDRPS50ph8Bcl+qptHNtwzbcyb/W7mCU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VtVIWKJWnXivUZWR5RYvs6ZCJhT1aaEiJY74Qhaqhyi8nfCyybk6vyA5svHo7i7dQln1xLihhogr9cx1ii/IkhkmuM4MDuCXradnToHlLg4WC7HqQfEL/bE9Do5yQ2qwm0/zpH6jDyGVXBlS7eF2nUb2rEfsEis9wuKio/Ki/wU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nQTBVLCZ; arc=none smtp.client-ip=209.85.215.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nQTBVLCZ" Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-c648bc907ebso1763265a12.3 for ; Fri, 27 Feb 2026 23:16:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772262977; x=1772867777; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qe0K2hcCTdrZQJvsxYDudUKfsrBK0GJvioISkwHtwEU=; b=nQTBVLCZ94m7xy9zr0+M00lLKIzvKcRhU+rvek/Ntd68/7P9KmPaZkcnJn988bf9Li Bq1xaZ/LR8NgBVjx+td/7XM/n1P0iyYilK0YEpWOBM90BmochlzHBOFx7VzaMvQecvZW bwR5gih3RQW6pXEULNO7SMTRrG6MY0s5RR/eXnuWoscC4ioJm02/IQSvRXXrr6128vbD v0hXuag34QLKytnfJFDtCa59C31j3mtL6v2xjA8hDpiwuFYZFsi7TWvJlrj9wGU4w+38 NRtGK3P3hyopMWZQsMgUmh7jlEdAj1jykT+BgcBKqlrtfPURDMuF6e+yLBUuYIX5LJXb ILtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772262977; x=1772867777; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qe0K2hcCTdrZQJvsxYDudUKfsrBK0GJvioISkwHtwEU=; b=m2yZAVgJ9c4tdLvhPT1bQ/fpnWK50m/n1c2bVnhd4NekyglqJYuXmGaos6X3aqGODf livjgPSy54QcNbeZ9Mismi6hB49l4t6RZqfxRkgg0RskTumA/pouqoc9tCOoJxptPsjm pwVQCXf8SaT+KRMCochsGhgo1FoIP5Wocwd1Bqy51oVwRpEWh1iUPMDTFUhjR89ZyKFf 853Mj1DtIZFluxjXVbbdfN5C3MCHHSSDy3/034eO4arq2jmymhfl/IwOPpy1e0KHbpGy PpYZe0zhTv2uoQ1dkm1OBrKIRR19t/OZtZyrZMuo/AKmL/31Mfz9zUK7It55e0rhrfp4 xyeA== X-Forwarded-Encrypted: i=1; AJvYcCXekGL5aB89FUdxK2pM4MJwdTsFW7erOBtFHJAlZqdko8wT4yNJ19XEteoF2LZk4ME81Og78dn+B4JGG4s=@vger.kernel.org X-Gm-Message-State: AOJu0YxcxGsqO0HxEG2EECqE29F6ZTbhqMYo0iG3Cb89q8NDY2frSU0H rk+hPaUD5iAE2Epzw+CdN+iazYhurGeT7QBKx2fx96t6nZOftwNSlCtR X-Gm-Gg: ATEYQzzThaln3303aRL+mrpD2m4zeycGwCIIHxtpYUbX3fE51l2vFAxXk168pif8kbI +dtUytw3ojuqXoUnQyRqwZ7LWz1w6mJT9jR/88xUfyMRUwMGx5V2iGRP8rmIsnV2DJd3Gd5PTcX 609Wp+WS2vCYTxryxanQcUA3fXkYj33NaW81+z9STk+UZwsdICIvAS6bklhqZV6BMwHuSrOFeUl Z5AmMVV7uXlAPWGs9YdYdFUT+drnKEZYSXv6kdfNiHTG+nAVn3T1xh/5Kt2gIuLNP5I7hB+QGcR OchnsZSleph8kT8+gsE9bBVNkJOMW7Ks4PtxxoqT4u54Uu91v4wUaauycjNCEDm39/MoOKaNm2z WmF5vfkRBmVjqs6yWVz+HGoNhtB7dA20tDH9kJYbKd03OKBnPTIYxiYlFobufCgne+pLKT9jZG2 nla2V8IRQv9mE3JNe6ibuH60cYnwB0mZRLxSXsq6fw+ZMe+T4= X-Received: by 2002:a17:903:320b:b0:2ad:e02b:4611 with SMTP id d9443c01a7336-2ae2e3e72d5mr52324385ad.1.1772262977455; Fri, 27 Feb 2026 23:16:17 -0800 (PST) Received: from localhost.localdomain ([183.96.230.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2adfb5b4535sm72004075ad.17.2026.02.27.23.16.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 27 Feb 2026 23:16:17 -0800 (PST) From: Kibaek Yoo To: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kibaek Yoo Subject: [PATCH v2 1/2] net: macvlan: support multicast rx for bridge ports with shared source MAC Date: Sat, 28 Feb 2026 16:16:12 +0900 Message-ID: <20260228071613.4360-1-psykibaek@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260225100024.38937-1-psykibaek@gmail.com> References: <20260225100024.38937-1-psykibaek@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Macvlan bridge mode currently does not handle the case where an external source shares its MAC address with a local macvlan interface. When such a frame arrives, macvlan_hash_lookup() matches the source MAC to the local macvlan, and macvlan_multicast_rx() assumes bridge ports already received the frame during local transmission. Since the frame actually originated externally, bridge ports never saw it. This situation arises with protocols like VRRP, where multiple hosts use the same virtual MAC address. Support this by passing NULL as the source device and including MACVLAN_MODE_BRIDGE in the mode mask for the else branch of macvlan_multicast_rx(). This ensures all VEPA and bridge mode macvlan interfaces receive incoming multicast regardless of source MAC matching. The trade-off is that looped-back locally-originated multicasts may be delivered to bridge ports a second time, but multicast consumers already handle duplicate frames. Signed-off-by: Kibaek Yoo --- drivers/net/macvlan.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index a71f058eceef0..ea22909cb09de 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -313,11 +313,15 @@ static void macvlan_multicast_rx(const struct macvlan_port *port, MACVLAN_MODE_BRIDGE); else /* - * flood only to VEPA ports, bridge ports - * already saw the frame on the way out. + * Flood to VEPA and bridge ports. We cannot distinguish + * a looped-back locally-originated multicast from one + * sent by an external source sharing the same source MAC + * (e.g., VRRP virtual MAC), so deliver to bridge ports + * as well to ensure correct reception in all cases. */ - macvlan_broadcast(skb, port, src->dev, - MACVLAN_MODE_VEPA); + macvlan_broadcast(skb, port, NULL, + MACVLAN_MODE_VEPA | + MACVLAN_MODE_BRIDGE); } static void macvlan_process_broadcast(struct work_struct *w) -- 2.50.1 (Apple Git-155)