From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7C399C5DF97 for ; Wed, 26 Aug 2026 14:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fQMkcPMV7Pc6LQCfAGg8QeshWvzbYRluiKAsXmZpmVA=; b=kV2U2XKp84xNsnvnE7O1B8LlMv h2nCaYB7GcKST50mRzSPIr8POOyQzW0Y3AxCn0C9wsbuhIPYygXayvURMB6IpBk0ydcT83ZrRVs2+ lQF+BbI2QfBER6WECQTf3B5V9D5FlnktGsfgAkl/l0+Ui0Pp7PUtRi6Tsj/IlgWppiPOURmcf0zI4 iEmU/R2ykv6VC74TTS4nvt0rYNiHtibJspb8PU25V4UymmfrUnsoKCywbtppdNMsckxKrUyIKBi9/ yxuwbp/DLHS6TxE/FqZTlfR80nmlLB7fox4FTGjLo4xCYBc54wbhIIZ+ytdLi9CsjSlLb3z+uQKd0 +rn2uClQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wzEGu-00000002ZGC-0Hp6; Wed, 26 Aug 2026 14:06:32 +0000 Received: from smtpout-03.galae.net ([185.246.85.4]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wzEG6-00000002Z0Q-2AXw for linux-arm-kernel@lists.infradead.org; Wed, 26 Aug 2026 14:05:44 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 085AB4E413AA; Wed, 26 Aug 2026 14:05:41 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id CF529604EC; Wed, 26 Aug 2026 14:05:40 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 324CE11C781D1; Wed, 26 Aug 2026 16:05:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1787753135; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=fQMkcPMV7Pc6LQCfAGg8QeshWvzbYRluiKAsXmZpmVA=; b=egoBnJPX8pVGNGJ/3jf09wwDrVpQYmxE6gK6/QaJtlZeKxJ+WJAIfQF2YrJLC7f6piN0F5 lcV6WcOe6YGx1W0NDNsgFcATRifpBB4muA99d4y93wdedN1Z+S76KZ2v0ciqIZZJ+Up1EW CFyhdymQ9roAP6C9WeoMK1wWJkGzEF/QAm0DjnKJQelv5Bnpf2W4/jllHqX7LCtqs5EkhK tCiP4dpfIbxyS4XVAJPWmiHBpHzvFNN0UwDtKi4+BdRj5bRu140TDpuekylvhauMyqifwN fVL3P5dEpIFZUgT/EQFCs8dBcqGqwfgx5etPpsiVUzBHUcsXTymZbGPbe/ET8Q== From: Maxime Chevallier To: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , Heiner Kallweit , =?UTF-8?q?Alexis=20Lothor=C3=A9?= , Maxime Coquelin , Alexandre Torgue , Emil Renner Berthing , Minda Chen , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Jan Petrous , Ovidiu Panait , Jose.Abreu@synopsys.com Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH net 4/6] net: stmmac: dwxgmac: Account for the primary MAC address for UC filtering Date: Wed, 26 Aug 2026 16:04:56 +0200 Message-ID: <20260826140500.616466-5-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260826140500.616466-1-maxime.chevallier@bootlin.com> References: <20260826140500.616466-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260826_070542_791902_7769D9C7 X-CRM114-Status: GOOD ( 12.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The same filter slots are used to store the main MAC address as well as the address for the unicast filter. Let's account for that when deciding whether or not to use promisc when programming the UC list in hardware. Fixes: 0efedbf11f07 ("net: stmmac: xgmac: Fix XGMAC selftests") Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index 52054f31376d..fc6ddb51c682 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -532,7 +532,7 @@ static void dwxgmac2_set_filter(struct mac_device_info *hw, dwxgmac2_set_mchash(ioaddr, mc_filter, mcbitslog2); /* Handle multiple unicast addresses */ - if (netdev_uc_count(dev) > hw->unicast_filter_entries) { + if (netdev_uc_count(dev) + 1 > hw->unicast_filter_entries) { value |= XGMAC_FILTER_PR; } else { struct netdev_hw_addr *ha; -- 2.55.0