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 BD701CEDD9A for ; Wed, 9 Oct 2024 14:11:20 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6DjegW7LeZhU+ngBxjXf8N0tuidVCNlkqI9kxq+5JXo=; b=uYMu+RDgPVdVuUgBVrFLZ8B/T6 RtdUkgGs56mb7YI+804wz0PUD1Pl+ZwCi0MO6+ehDMThLWE4RGbagcm4yheh7JQpw7Cf0LyO4pMSe xuYHLMREoVAuowanK0uc/gggXw1+HGRfvNEKVL6MPUqc37S8ni+YUb8S8eRKZTommTgCZrzF+Ne4P sNYGD2w9ugfp0yNkyokd/bb5buP6WkuI60KlcZaOJme5rMlKomcO5DVFmXwxiCD8YZ8clarJ8vmVZ wW+zSr5jIouKK1S0PtXhFEiReXw+Y7R/Pl0HM8/pbKiCYOnVopi/7RQhmFn9jGWV67zaTDOZXiGNz LR+vI8jA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syXP8-00000009XLp-35Er; Wed, 09 Oct 2024 14:11:06 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syXFp-00000009VQo-3MpR for linux-arm-kernel@lists.infradead.org; Wed, 09 Oct 2024 14:01:31 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 8C6EAA44026; Wed, 9 Oct 2024 14:01:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 988B8C4CEC3; Wed, 9 Oct 2024 14:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728482487; bh=2JbLa20JN/3ywK6IVx4oCdQ05OVI4F87l8ogZWYm4b8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WE0ZyA1FKozwqrzhRTUbwsoHEoDe/V4nqQsAYDl4Sjg/M2hsCLi2UxgSJ46HKdR2X MCNy9HoWCH5g23SBcYbtLWfR49guY+tXkN0wTcdQxEowBgjFLEd9xpsgqHiPb+sEwu x/BH5Uk8qHRTqDkITI53DsX8ptgRZCNmGW+aIySnuig/05u0C4D823o+l9OrUp9aTj VfsUetTdUzYCnGiPV/LQHGWv4aAZFpayRDvPXR34HoiMPPw5LKm2bTsfTCtDwNXDEY gyO9yoL2xXruXJf9LmJ7hpBNJ0W5R3UuRz6VcQ35gkz7e+jOKekKsgQuEo8K6pFTTe abZCif0mdttHQ== Date: Wed, 9 Oct 2024 15:01:23 +0100 From: Simon Horman To: Daniel Machon Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: sparx5: fix source port register when mirroring Message-ID: <20241009140123.GB99782@kernel.org> References: <20241009-mirroring-fix-v1-1-9ec962301989@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241009-mirroring-fix-v1-1-9ec962301989@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241009_070129_945282_3A7E37F4 X-CRM114-Status: GOOD ( 15.59 ) 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 On Wed, Oct 09, 2024 at 02:49:56PM +0200, Daniel Machon wrote: > When port mirroring is added to a port, the bit position of the source > port, needs to be written to the register ANA_AC_PROBE_PORT_CFG. This > register is replicated for n_ports > 32, and therefore we need to derive > the correct register from the port number. > > Before this patch, we wrongly calculate the register from portno / > BITS_PER_BYTE, where the divisor ought to be 32, causing any port >=8 to > be written to the wrong register. We fix this, by using do_div(), where > the dividend is the register, the remainder is the bit position and the > divisor is now 32. > > Fixes: 4e50d72b3b95 ("net: sparx5: add port mirroring implementation") > Signed-off-by: Daniel Machon Reviewed-by: Simon Horman ...