From nobody Sat Feb 7 15:22:20 2026 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 DEFFE1CC160 for ; Thu, 22 Aug 2024 15:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724341287; cv=none; b=Z9ruZGSvcYOeBJFWZH1ie1k44LH2J8p51rfLRrG8i3US6tTBrdDXYppR+ZrdZjDVLQ59pxis7npo1C/9yeNGf7etwwk/tvB95jL+v+B49VIukoAO+J01SdgeeN++3oVu62XZNeyj8ot/d6Yux6OudWL1bY1mQofM15n637xHFGw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724341287; c=relaxed/simple; bh=dzCXGaFReauwOK1YthHIV8ZrILBfMiz1n2GhKtNfezI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CYAaGMlxd4XmMyB7267ppGn/1Z9UDEG+P75AOSUYw+tXDqmQNLGOlUldmRBoTTT2tdOm4mldMrAWH23xfq/jSffCM5twwtDdaVyXWwVyMiSNkT3vUii1vxNgzSLFwRbGk3eWvCevDorY64kw336numeGen58Ag3Au74L8dXatQs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=cpyg94nP; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="cpyg94nP" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1724341281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Swnhdbla4FFcBOXmANTpBJTCNvMqxhSTYkB1DquWAZQ=; b=cpyg94nPbPW0BA/TdsKmBx18YBoIKViU7/9NMB3UYey6CtoMEuaGQDwVLvUh9m0HxAO8AI wuGOcUveW/Eagx467n269MXAx0AaGreqPRVEqqsuHii626gpcyPSanI6Q23r51ZPY0NkCW Uqr7jiRPYzDNXwRbL8mASrDqjKjIC6k= From: Sean Anderson To: Radhey Shyam Pandey , netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Eric Dumazet , Michal Simek , Andrew Lunn , Daniel Borkmann , "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, Paolo Abeni , Sean Anderson , Simon Horman Subject: [PATCH net-next v3 1/5] net: xilinx: axienet: Always disable promiscuous mode Date: Thu, 22 Aug 2024 11:40:55 -0400 Message-Id: <20240822154059.1066595-2-sean.anderson@linux.dev> In-Reply-To: <20240822154059.1066595-1-sean.anderson@linux.dev> References: <20240822154059.1066595-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" If promiscuous mode is disabled when there are fewer than four multicast addresses, then it will not be reflected in the hardware. Fix this by always clearing the promiscuous mode flag even when we program multicast addresses. Fixes: 8a3b7a252dca ("drivers/net/ethernet/xilinx: added Xilinx AXI Etherne= t driver") Signed-off-by: Sean Anderson Reviewed-by: Simon Horman --- (no changes since v1) drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_main.c index 38f7b764fe66..6fad473a937b 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -451,6 +451,10 @@ static void axienet_set_multicast_list(struct net_devi= ce *ndev) } else if (!netdev_mc_empty(ndev)) { struct netdev_hw_addr *ha; =20 + reg =3D axienet_ior(lp, XAE_FMI_OFFSET); + reg &=3D ~XAE_FMI_PM_MASK; + axienet_iow(lp, XAE_FMI_OFFSET, reg); + i =3D 0; netdev_for_each_mc_addr(ha, ndev) { if (i >=3D XAE_MULTICAST_CAM_TABLE_NUM) --=20 2.35.1.1320.gc452695387.dirty From nobody Sat Feb 7 15:22:20 2026 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (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 AE0531CCB39 for ; Thu, 22 Aug 2024 15:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724341289; cv=none; b=a5LdVNPtwpCzIod0iQ1yLjIdZRxZ7TvmUMrTp0uMON41oQNwUJSSLbpLitCTSYi2g9/hEplraRZaVm6iFccAy9sxRcLrChSOnquTEUKCsS44i0r7pfPefkKKDRDmoBC4uD8OO3xhnYcnOYSioR4EjQdAY0beAoE25xu8Ma917O4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724341289; c=relaxed/simple; bh=ohfgIxeTRkOynqIzCgEfaM2k2evnvYdBi/1XB5KwvYk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bR0FsMyVeRLtz4O4peUuqoqeIffkxB3bUzosnSLPhH8PhaFB2OuYnHTVRNhDSpiOopPPphd4kswNJBUauSPhdCsCjBJnwWnaQimcqe/h8nDi+pPQk7K+jTzw9V8zGG9AfZWg2gN1jPKzHeERCsr3HHmTDhVTUqNY3D6AaFu5ET8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=wpbdy4IR; arc=none smtp.client-ip=91.218.175.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="wpbdy4IR" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1724341284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K3Ul9dr4s0FV4zx4bC150nxiBfsOJmq4YQc7DzBJrag=; b=wpbdy4IRMQLwHZGkL61ND+PvbrxOcqyS662/tmiXVD+QeQB39rXooWX7QebrpvPnFoWHi/ yiw1SofstlxTF0MYmi6eS+LZDdZfu3AxARN6rLTAUcUUNrqaUsRzSV20vEGLd9KWiSNrQB g7xWp8fFeZUZHXs9WL+9HqCYzLHJOcw= From: Sean Anderson To: Radhey Shyam Pandey , netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Eric Dumazet , Michal Simek , Andrew Lunn , Daniel Borkmann , "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, Paolo Abeni , Sean Anderson , Simon Horman Subject: [PATCH net-next v3 2/5] net: xilinx: axienet: Fix dangling multicast addresses Date: Thu, 22 Aug 2024 11:40:56 -0400 Message-Id: <20240822154059.1066595-3-sean.anderson@linux.dev> In-Reply-To: <20240822154059.1066595-1-sean.anderson@linux.dev> References: <20240822154059.1066595-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" If a multicast address is removed but there are still some multicast addresses, that address would remain programmed into the frame filter. Fix this by explicitly setting the enable bit for each filter. Fixes: 8a3b7a252dca ("drivers/net/ethernet/xilinx: added Xilinx AXI Etherne= t driver") Signed-off-by: Sean Anderson Reviewed-by: Simon Horman --- (no changes since v1) drivers/net/ethernet/xilinx/xilinx_axienet.h | 1 + .../net/ethernet/xilinx/xilinx_axienet_main.c | 21 ++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/eth= ernet/xilinx/xilinx_axienet.h index 8165f5f271ff..5a7d6b872f5d 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h @@ -172,6 +172,7 @@ #define XAE_UAW0_OFFSET 0x00000700 /* Unicast address word 0 */ #define XAE_UAW1_OFFSET 0x00000704 /* Unicast address word 1 */ #define XAE_FMI_OFFSET 0x00000708 /* Frame Filter Control */ +#define XAE_FFE_OFFSET 0x0000070C /* Frame Filter Enable */ #define XAE_AF0_OFFSET 0x00000710 /* Address Filter 0 */ #define XAE_AF1_OFFSET 0x00000714 /* Address Filter 1 */ =20 diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_main.c index 6fad473a937b..88ff82c52d0c 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -433,7 +433,7 @@ static int netdev_set_mac_address(struct net_device *nd= ev, void *p) */ static void axienet_set_multicast_list(struct net_device *ndev) { - int i; + int i =3D 0; u32 reg, af0reg, af1reg; struct axienet_local *lp =3D netdev_priv(ndev); =20 @@ -455,7 +455,6 @@ static void axienet_set_multicast_list(struct net_devic= e *ndev) reg &=3D ~XAE_FMI_PM_MASK; axienet_iow(lp, XAE_FMI_OFFSET, reg); =20 - i =3D 0; netdev_for_each_mc_addr(ha, ndev) { if (i >=3D XAE_MULTICAST_CAM_TABLE_NUM) break; @@ -474,6 +473,7 @@ static void axienet_set_multicast_list(struct net_devic= e *ndev) axienet_iow(lp, XAE_FMI_OFFSET, reg); axienet_iow(lp, XAE_AF0_OFFSET, af0reg); axienet_iow(lp, XAE_AF1_OFFSET, af1reg); + axienet_iow(lp, XAE_FFE_OFFSET, 1); i++; } } else { @@ -481,18 +481,15 @@ static void axienet_set_multicast_list(struct net_dev= ice *ndev) reg &=3D ~XAE_FMI_PM_MASK; =20 axienet_iow(lp, XAE_FMI_OFFSET, reg); - - for (i =3D 0; i < XAE_MULTICAST_CAM_TABLE_NUM; i++) { - reg =3D axienet_ior(lp, XAE_FMI_OFFSET) & 0xFFFFFF00; - reg |=3D i; - - axienet_iow(lp, XAE_FMI_OFFSET, reg); - axienet_iow(lp, XAE_AF0_OFFSET, 0); - axienet_iow(lp, XAE_AF1_OFFSET, 0); - } - dev_info(&ndev->dev, "Promiscuous mode disabled.\n"); } + + for (; i < XAE_MULTICAST_CAM_TABLE_NUM; i++) { + reg =3D axienet_ior(lp, XAE_FMI_OFFSET) & 0xFFFFFF00; + reg |=3D i; + axienet_iow(lp, XAE_FMI_OFFSET, reg); + axienet_iow(lp, XAE_FFE_OFFSET, 0); + } } =20 /** --=20 2.35.1.1320.gc452695387.dirty From nobody Sat Feb 7 15:22:20 2026 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 3A9311CCEC4 for ; Thu, 22 Aug 2024 15:41:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724341290; cv=none; b=fTJMIMRP3pEjDrwj8i6ct9qyJ/mNrSJbRhz+zWIA0E3QTNG895Ii9iZpAxpfnIq7se5kb8yZ9HtTGNO+PcPY3ks2Mrghf9LU79EDM5HkIrd+pGx/pNXJ3f1HqvLv9dbRJGGvUztmk9xw73mD+4+In2z0S+SXudlR/eUn6vQYR2E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724341290; c=relaxed/simple; bh=Ze4hmZ31kbNNIFYUn/vNQZ3JN5wL90sfLeN9bE2VJkY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aHO3T35g+C/tzocyaHyo1YTLzDgkcqeOqqswsNZ6sxeZ2SyHpvS3lTLkjKA0u4O0A0Jm41zYTilyeksXrOHZ+wPzlmB0wSgILaX11c+IZQ3CoqGPsNHOuE+aLVhTWuBeKu1fA7qh9MJjtzyTpLgcfP3QFUyq9U6uRKvYigQcDRM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=dnNEq5Mu; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="dnNEq5Mu" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1724341286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WrVWUSGAi65g2KGYwS084DcxvQZ1Z3a88yLyeu+WdHE=; b=dnNEq5MubHTWTpg/iJjWqZPAMYW39Bt1K0dhA+YrbCeve7VJX6nTkj8fSpMLA6QTJ7CUPm XlUcnYOihpkJAU5iFQ5z3670De/TpykOAzYrFH5KKmcdFhhueyIhvD7bpQ85gXo4yYCmhn pGKMQ3KrTKdZXMQgmEM3V+Eohi+iqTs= From: Sean Anderson To: Radhey Shyam Pandey , netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Eric Dumazet , Michal Simek , Andrew Lunn , Daniel Borkmann , "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, Paolo Abeni , Sean Anderson , Simon Horman Subject: [PATCH net-next v3 3/5] net: xilinx: axienet: Don't print if we go into promiscuous mode Date: Thu, 22 Aug 2024 11:40:57 -0400 Message-Id: <20240822154059.1066595-4-sean.anderson@linux.dev> In-Reply-To: <20240822154059.1066595-1-sean.anderson@linux.dev> References: <20240822154059.1066595-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" A message about being in promiscuous mode is printed every time each additional multicast address beyond four is added. Suppress this message like is done in other drivers. Signed-off-by: Sean Anderson Reviewed-by: Simon Horman --- (no changes since v2) Changes in v2: - Split off IFF_PROMISC change drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_main.c index 88ff82c52d0c..f612adb07a25 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -447,7 +447,6 @@ static void axienet_set_multicast_list(struct net_devic= e *ndev) reg =3D axienet_ior(lp, XAE_FMI_OFFSET); reg |=3D XAE_FMI_PM_MASK; axienet_iow(lp, XAE_FMI_OFFSET, reg); - dev_info(&ndev->dev, "Promiscuous mode enabled.\n"); } else if (!netdev_mc_empty(ndev)) { struct netdev_hw_addr *ha; =20 @@ -481,7 +480,6 @@ static void axienet_set_multicast_list(struct net_devic= e *ndev) reg &=3D ~XAE_FMI_PM_MASK; =20 axienet_iow(lp, XAE_FMI_OFFSET, reg); - dev_info(&ndev->dev, "Promiscuous mode disabled.\n"); } =20 for (; i < XAE_MULTICAST_CAM_TABLE_NUM; i++) { --=20 2.35.1.1320.gc452695387.dirty From nobody Sat Feb 7 15:22:20 2026 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 BA1881C693 for ; Thu, 22 Aug 2024 15:41:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724341291; cv=none; b=NAnCod2GT6lIT4AUrQVuqK6cWUm+5AFBLZ5q3OpwtRHnFdKSD8hAjXL/fngJhMLlIGIkwsPFNOofQ9dnpuqFhk6U0W1aqVcz+X/5H3Q2XuE2R14VryNAB1T/+leonr2mOluBC/kB2QIDa+1d0v5UmiM3W4BHSxk+eIyamTOeNqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724341291; c=relaxed/simple; bh=t7Xgw5NCVuK76Fz/E17ZKV8gj8CWvvXKXFCDS1nYvac=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=E8usjzNyIb+Q0bPTh3YSVW3UIo4H2GGY4r3ka//OmW/YkDudc6pRHDE8Ui+1cI1HCuxrK3yP7o1MivjWP77HOLItDKBxDyiin+tAVhwH4WCAUl1hJDx1T1Qx/FGf1B2abGVXaqiW1PZ73Y1Ynmog4REt/UVHWXyeRUqOZ0ulTV4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=r2dEk7DT; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="r2dEk7DT" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1724341288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4y1OuMckJ3uTXKaUmgng1b/Utw2qqR8UebmEH8zDxio=; b=r2dEk7DTgH7boJ7IQiCxQoBkZAH+lrVePjlZ84P9uN3Ysm+E/uTV3k3oxbBgEuowf0kfjj XhQbKSi8twLwFkTKlwJNzyQxIH+4EKOkgGqmuYeUTFZkGkq44j85L4BSjgnLzrSzF9lg5z aHvICp3mzETUCdpzutJGWQsR1zvlKV8= From: Sean Anderson To: Radhey Shyam Pandey , netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Eric Dumazet , Michal Simek , Andrew Lunn , Daniel Borkmann , "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, Paolo Abeni , Sean Anderson , Simon Horman Subject: [PATCH net-next v3 4/5] net: xilinx: axienet: Don't set IFF_PROMISC in ndev->flags Date: Thu, 22 Aug 2024 11:40:58 -0400 Message-Id: <20240822154059.1066595-5-sean.anderson@linux.dev> In-Reply-To: <20240822154059.1066595-1-sean.anderson@linux.dev> References: <20240822154059.1066595-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Contrary to the comment, we don't have to inform the net subsystem. Signed-off-by: Sean Anderson Reviewed-by: Simon Horman --- (no changes since v2) Changes in v2: - Split off from printing changes drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_main.c index f612adb07a25..5c4a5949a021 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -439,11 +439,6 @@ static void axienet_set_multicast_list(struct net_devi= ce *ndev) =20 if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) || netdev_mc_count(ndev) > XAE_MULTICAST_CAM_TABLE_NUM) { - /* We must make the kernel realize we had to move into - * promiscuous mode. If it was a promiscuous mode request - * the flag is already set. If not we set it. - */ - ndev->flags |=3D IFF_PROMISC; reg =3D axienet_ior(lp, XAE_FMI_OFFSET); reg |=3D XAE_FMI_PM_MASK; axienet_iow(lp, XAE_FMI_OFFSET, reg); --=20 2.35.1.1320.gc452695387.dirty From nobody Sat Feb 7 15:22:20 2026 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 A6BC61CDFD4 for ; Thu, 22 Aug 2024 15:41:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724341293; cv=none; b=SMFA0xktSPJPtojUdrNWOX/xm8+K7VkInox42JcyuYOOwmy9Ph3dedqMgEEHQ2oCAFUWfH8807Fxe5LKG5HFmJwNll5b9kmNWRKTSK+3dNUhPSYzxvXr7Cd0qAFz0mfrSfXofas137RX7xvn0Uu1N25C00HFGrBI+deCWTof1tY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724341293; c=relaxed/simple; bh=8/XFPh25xGSUZ1P8YK1SABWsinsK0clgjIwNTRAEvUY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=azL4TAMb6mohlk5OZ2oW2VWDf0m0RkzJWQlx+GxIhbayBV8DWgJ4uBAkbGedWJBjK1c0Tjij72HbbMkeAhDg6NJ6iVzrpplGTAVpue2dAeCHD3O+1NLmFZf54njCmst94/lm3mb7/VTT+FPQ9cj8e+cgLK9lI8+NYdsDcpvaXDQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=xrOW7BOI; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xrOW7BOI" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1724341290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6XRAKJklo9vBktdRNWOH6AnRZImaO00oA0lmHQ28GKY=; b=xrOW7BOICT3ZrLBwTKvk8/GDpheqAjKRKpfd4DQuOyY/9hRd4HODr+fhUFtTcfofIiPOBe 6HRXugEyX/D8XI3SC0FjP4pPcGOS3/hNyA5GKzGKaKomNbOVHQCVJCmGK3Bb5HoTFWg54e IRFuzu8h4XY7bmXzoVyxqoxFqbakPM8= From: Sean Anderson To: Radhey Shyam Pandey , netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Eric Dumazet , Michal Simek , Andrew Lunn , Daniel Borkmann , "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, Paolo Abeni , Sean Anderson , Simon Horman Subject: [PATCH net-next v3 5/5] net: xilinx: axienet: Support IFF_ALLMULTI Date: Thu, 22 Aug 2024 11:40:59 -0400 Message-Id: <20240822154059.1066595-6-sean.anderson@linux.dev> In-Reply-To: <20240822154059.1066595-1-sean.anderson@linux.dev> References: <20240822154059.1066595-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Add support for IFF_ALLMULTI by configuring a single filter to match the multicast address bit. This allows us to keep promiscuous mode disabled, even when we have more than four multicast addresses. An even better solution would be to "pack" addresses into the available CAM registers, but that can wait for a future series. Signed-off-by: Sean Anderson Reviewed-by: Simon Horman --- (no changes since v1) drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 ++ .../net/ethernet/xilinx/xilinx_axienet_main.c | 34 +++++++++++-------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/eth= ernet/xilinx/xilinx_axienet.h index 5a7d6b872f5d..c301dd2ee083 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h @@ -175,6 +175,8 @@ #define XAE_FFE_OFFSET 0x0000070C /* Frame Filter Enable */ #define XAE_AF0_OFFSET 0x00000710 /* Address Filter 0 */ #define XAE_AF1_OFFSET 0x00000714 /* Address Filter 1 */ +#define XAE_AM0_OFFSET 0x00000750 /* Frame Filter Mask Value Bytes 3-0 */ +#define XAE_AM1_OFFSET 0x00000754 /* Frame Filter Mask Value Bytes 7-4 */ =20 #define XAE_TX_VLAN_DATA_OFFSET 0x00004000 /* TX VLAN data table address */ #define XAE_RX_VLAN_DATA_OFFSET 0x00008000 /* RX VLAN data table address */ diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_main.c index 5c4a5949a021..fe6a0e2e463f 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -437,18 +437,27 @@ static void axienet_set_multicast_list(struct net_dev= ice *ndev) u32 reg, af0reg, af1reg; struct axienet_local *lp =3D netdev_priv(ndev); =20 - if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) || - netdev_mc_count(ndev) > XAE_MULTICAST_CAM_TABLE_NUM) { - reg =3D axienet_ior(lp, XAE_FMI_OFFSET); + reg =3D axienet_ior(lp, XAE_FMI_OFFSET); + reg &=3D ~XAE_FMI_PM_MASK; + if (ndev->flags & IFF_PROMISC) reg |=3D XAE_FMI_PM_MASK; + else + reg &=3D ~XAE_FMI_PM_MASK; + axienet_iow(lp, XAE_FMI_OFFSET, reg); + + if (ndev->flags & IFF_ALLMULTI || + netdev_mc_count(ndev) > XAE_MULTICAST_CAM_TABLE_NUM) { + reg &=3D 0xFFFFFF00; axienet_iow(lp, XAE_FMI_OFFSET, reg); + axienet_iow(lp, XAE_AF0_OFFSET, 1); /* Multicast bit */ + axienet_iow(lp, XAE_AF1_OFFSET, 0); + axienet_iow(lp, XAE_AM0_OFFSET, 1); /* ditto */ + axienet_iow(lp, XAE_AM1_OFFSET, 0); + axienet_iow(lp, XAE_FFE_OFFSET, 1); + i =3D 1; } else if (!netdev_mc_empty(ndev)) { struct netdev_hw_addr *ha; =20 - reg =3D axienet_ior(lp, XAE_FMI_OFFSET); - reg &=3D ~XAE_FMI_PM_MASK; - axienet_iow(lp, XAE_FMI_OFFSET, reg); - netdev_for_each_mc_addr(ha, ndev) { if (i >=3D XAE_MULTICAST_CAM_TABLE_NUM) break; @@ -461,24 +470,21 @@ static void axienet_set_multicast_list(struct net_dev= ice *ndev) af1reg =3D (ha->addr[4]); af1reg |=3D (ha->addr[5] << 8); =20 - reg =3D axienet_ior(lp, XAE_FMI_OFFSET) & 0xFFFFFF00; + reg &=3D 0xFFFFFF00; reg |=3D i; =20 axienet_iow(lp, XAE_FMI_OFFSET, reg); axienet_iow(lp, XAE_AF0_OFFSET, af0reg); axienet_iow(lp, XAE_AF1_OFFSET, af1reg); + axienet_iow(lp, XAE_AM0_OFFSET, 0xffffffff); + axienet_iow(lp, XAE_AM1_OFFSET, 0x0000ffff); axienet_iow(lp, XAE_FFE_OFFSET, 1); i++; } - } else { - reg =3D axienet_ior(lp, XAE_FMI_OFFSET); - reg &=3D ~XAE_FMI_PM_MASK; - - axienet_iow(lp, XAE_FMI_OFFSET, reg); } =20 for (; i < XAE_MULTICAST_CAM_TABLE_NUM; i++) { - reg =3D axienet_ior(lp, XAE_FMI_OFFSET) & 0xFFFFFF00; + reg &=3D 0xFFFFFF00; reg |=3D i; axienet_iow(lp, XAE_FMI_OFFSET, reg); axienet_iow(lp, XAE_FFE_OFFSET, 0); --=20 2.35.1.1320.gc452695387.dirty