Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp487405lqp; Sat, 13 Apr 2024 06:03:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3hd80PfC9V1gzdJkvxg+fYviAnVX1nksSXh+Rnh2MAyzJTfEiHPz7N4JGCS1MwYDGkqF7euh9sfW0wtJcjKfY7vJPdGUccTcy3aQXUg== X-Google-Smtp-Source: AGHT+IH8lIiM7uTYtYSGtHH0Jo3j9pPrrzdN0ZPBJU7ty2gSrmroVL3/ayYHb8TQoSKukHzUbLcU X-Received: by 2002:a05:6122:1d86:b0:4d8:797b:94d5 with SMTP id gg6-20020a0561221d8600b004d8797b94d5mr4505182vkb.3.1713013386551; Sat, 13 Apr 2024 06:03:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713013386; cv=pass; d=google.com; s=arc-20160816; b=hkO45R8BLkDxr/PAmO3uCewlAqin7G3utfytKZGa3qhFBxPIUXIcOKJyV1/SrLd+2e eruIoubvYY6mT35FJWhCgY7tWvUTHMHu0ZQ1/56yqcNxb0JWwHnCi0BCWQ97mEKPRtg1 I23yCBkA1ujPIOQs4qba1Huvmhhmz80lvuHD3QpkbDsnKju9BihTykVj7atZbgu0nyis v5wKHcyEbpVWZifeTNXqpZYrZjEG3MQjw2qd/ttf/hfzuwD2793uXUm6ialmF30glgZI IXuRnAxd0yPhMJCTZC9kpSDv2lVvrKzFygzO9cPqcutelL6SV4kI9Ns/eWSy3/EEpQHY BGJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=RZR/pKJYJf3lo5Bgm5VExqDACFtbqNxQ8/shvtLJMlg=; fh=qFHvatm1RaNYc317LxXKg+KJ2ufLmoLyZz12mwvPuTQ=; b=JI8MA4s3ptG8DuXbpXbhYxBgIA+09qlf/I2WeQvUSVtL6IJrVEJg7LXoOBH+nz9HBG L4lzBDRut+SgcCsyr6ZT4eakEcalhqkFKSaHUx984sqmWA3rl3kM2H1xorl2t/LFLFpg EjCPSKGPGu/kabd3ZylMbAIBwYrF2UZhMcpR6d/STMtvSmEqG6YiMVLLZoLVGXB9QdWs +VF1q+vsocV+3O/Gx8NJTcIZrnAzRQdoXfJA3T2Z5sBfM4fW7hpYc3WVun9LUv5Q/v7p SxhBghsmnDGG9PFl8pD+5/6F5YQvxg4xwY+zAQPSKTbP/WofqHtSqYblCLzvjfsPShyN RWOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CCQPqIA0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-143732-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143732-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i16-20020a05610220d000b004783c67881fsi903023vsr.267.2024.04.13.06.03.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 06:03:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143732-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CCQPqIA0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-143732-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143732-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4484D1C20D68 for ; Sat, 13 Apr 2024 13:03:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1996F45036; Sat, 13 Apr 2024 13:02:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CCQPqIA0" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 383B43F8C7; Sat, 13 Apr 2024 13:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713013362; cv=none; b=lyFsH6tSa6xEyviOc3Kf5bKzM7q8gVGLbzexWuaOX5VljObs1ff72N78VwvDbKf5Mxh0iWQFwkL0y2uQ4+LrsSqDPD+e9mZWAYdxbXD1+SvGbHjbwKiTJenfY3+2jq58VqEiAPZ8/xiv/EaXCiMJC6arNzX8JIn8sSeGd88sWO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713013362; c=relaxed/simple; bh=1hfFJpbVy+jRqc4NBcjfKebyqWZeLEI6ADFhHCGKzT4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FsTt7uu8RMFB0nOjFFW+nvJwpMzzI7HfhimcCIzN6C5kTQCSq8UMe7OXDm173ZuE0pFeUv4R4TbLPRulATcpZPIiGMfK/ocdkamfz3KxH+4oNYDaavbs1HGKS/DEw2YKAf3c4G2sBoCC9pf4JA2LdyxCa1LTB4Jxq2UBUMwP1Xo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CCQPqIA0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id A3EB9C2BBFC; Sat, 13 Apr 2024 13:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713013361; bh=1hfFJpbVy+jRqc4NBcjfKebyqWZeLEI6ADFhHCGKzT4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=CCQPqIA06KHZZ/+XG8gQbIoK5NvuyjL91mRzOaJYMlENGMi4mzkudX8VdVSe/EAep Q5aUgzhl3cl1L3gowy5Hw3YE35ElF+LyYQ+r3Zld2CofPeD4Lr5TvL1b5LARxXcQnD HmAKjbHSYTFOzQxax7D2mniLZoS9fW7vPWoCIY7bFbXcVLol3W1uHc5Uu9I3+p+tHQ isds+FcGceR080wyqyyBb4UhGgpU3N008ZJ1pBcWAFUcUt+T9SOApBMJhLR+2gsHyO bq1UZHae8A4WP/sY9MKbN8yqda2ZHOQtatWVH4IIjrX0Yc689WKyqPBc+NmWtlrm5K Z2Q9+ZRE7BiFw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B0BBC04FFF; Sat, 13 Apr 2024 13:02:41 +0000 (UTC) From: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL_via_B4_Relay?= Date: Sat, 13 Apr 2024 16:01:40 +0300 Subject: [PATCH net 2/2] net: dsa: mt7530: fix port mirroring for MT7988 SoC switch Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240413-b4-for-net-mt7530-fix-mirroring-to-local-port-and-mt7988-v1-2-476deff8cc06@arinc9.com> References: <20240413-b4-for-net-mt7530-fix-mirroring-to-local-port-and-mt7988-v1-0-476deff8cc06@arinc9.com> In-Reply-To: <20240413-b4-for-net-mt7530-fix-mirroring-to-local-port-and-mt7988-v1-0-476deff8cc06@arinc9.com> To: Daniel Golle , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno Cc: Holger Stadali , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713013352; l=1595; i=arinc.unal@arinc9.com; s=arinc9-patatt; h=from:subject:message-id; bh=J5sBZDEYQ2MZhOw2PxMAD+gQryIOB3G0EIw5h33fGKY=; b=1ey++0YizyHi3vcP2NlwKUdn8ZXxyN89dYXm/TAlv6xdycNAjjkoeViF08Xq34iWLaB/yBlgs 7aq3qAX1yCuA5RcztQ1SxOoidtaDCWL3nktMXq4ac2BoLg8BcYRTy5I X-Developer-Key: i=arinc.unal@arinc9.com; a=ed25519; pk=VmvgMWwm73yVIrlyJYvGtnXkQJy9CvbaeEqPQO9Z4kA= X-Endpoint-Received: by B4 Relay for arinc.unal@arinc9.com/arinc9-patatt with auth_id=115 X-Original-From: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= Reply-To: arinc.unal@arinc9.com From: Arınç ÜNAL The "MT7988A Wi-Fi 7 Generation Router Platform: Datasheet (Open Version) v0.1" document shows bits 16 to 18 as the MIRROR_PORT field of the CPU forward control register. Currently, the MT7530 DSA subdriver configures bits 0 to 2 of the CPU forward control register which breaks the port mirroring feature for the MT7988 SoC switch. Fix this by using the MT7531_MIRROR_PORT_GET() and MT7531_MIRROR_PORT_SET() macros which utilise the correct bits. Fixes: 110c18bfed41 ("net: dsa: mt7530: introduce driver for MT7988 built-in switch") Signed-off-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index b84e1845fa02..8090390edaf9 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -1883,14 +1883,16 @@ mt7530_port_vlan_del(struct dsa_switch *ds, int port, static int mt753x_mirror_port_get(unsigned int id, u32 val) { - return (id == ID_MT7531) ? MT7531_MIRROR_PORT_GET(val) : - MIRROR_PORT(val); + return (id == ID_MT7531 || id == ID_MT7988) ? + MT7531_MIRROR_PORT_GET(val) : + MIRROR_PORT(val); } static int mt753x_mirror_port_set(unsigned int id, u32 val) { - return (id == ID_MT7531) ? MT7531_MIRROR_PORT_SET(val) : - MIRROR_PORT(val); + return (id == ID_MT7531 || id == ID_MT7988) ? + MT7531_MIRROR_PORT_SET(val) : + MIRROR_PORT(val); } static int mt753x_port_mirror_add(struct dsa_switch *ds, int port, -- 2.40.1