netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Daniel Machon <daniel.machon@microchip.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Lars Povlsen <lars.povlsen@microchip.com>,
	Steen Hegelund <Steen.Hegelund@microchip.com>,
	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
Date: Wed, 9 Oct 2024 15:01:23 +0100	[thread overview]
Message-ID: <20241009140123.GB99782@kernel.org> (raw)
In-Reply-To: <20241009-mirroring-fix-v1-1-9ec962301989@microchip.com>

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 <daniel.machon@microchip.com>

Reviewed-by: Simon Horman <horms@kernel.org>

...

  reply	other threads:[~2024-10-09 14:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 12:49 [PATCH net] net: sparx5: fix source port register when mirroring Daniel Machon
2024-10-09 14:01 ` Simon Horman [this message]
2024-10-11 22:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241009140123.GB99782@kernel.org \
    --to=horms@kernel.org \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).