netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] eth: fbnic: fix csr boundary for RPM RAM section
@ 2024-12-18 23:25 Mohsin Bashir
  2024-12-19  7:31 ` Michal Swiatkowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mohsin Bashir @ 2024-12-18 23:25 UTC (permalink / raw)
  To: netdev
  Cc: alexanderduyck, kuba, andrew, andrew+netdev, davem, edumazet,
	pabeni, kernel-team, mohsin.bashr

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=yes, Size: 1096 bytes --]

The CSR dump support leverages the FBNIC_BOUNDS macro, which pads the end
condition for each section by adding an offset of 1. However, the RPC RAM
section, which is dumped differently from other sections, does not rely
on this macro and instead directly uses end boundary address. Hence,
subtracting 1 from the end address results in skipping a register.

Fixes 3d12862b216d (“eth: fbnic: Add support to dump registers”)
Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
---
 drivers/net/ethernet/meta/fbnic/fbnic_csr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_csr.c b/drivers/net/ethernet/meta/fbnic/fbnic_csr.c
index 2118901b25e9..aeb9f333f4c7 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_csr.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_csr.c
@@ -64,7 +64,7 @@ static void fbnic_csr_get_regs_rpc_ram(struct fbnic_dev *fbd, u32 **data_p)
 	u32 i, j;
 
 	*(data++) = start;
-	*(data++) = end - 1;
+	*(data++) = end;
 
 	/* FBNIC_RPC_TCAM_ACT */
 	for (i = 0; i < FBNIC_RPC_TCAM_ACT_NUM_ENTRIES; i++) {
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] eth: fbnic: fix csr boundary for RPM RAM section
  2024-12-18 23:25 [PATCH net-next] eth: fbnic: fix csr boundary for RPM RAM section Mohsin Bashir
@ 2024-12-19  7:31 ` Michal Swiatkowski
  2024-12-19  8:25 ` Andrew Lunn
  2024-12-23 18:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Michal Swiatkowski @ 2024-12-19  7:31 UTC (permalink / raw)
  To: Mohsin Bashir
  Cc: netdev, alexanderduyck, kuba, andrew, andrew+netdev, davem,
	edumazet, pabeni, kernel-team

On Wed, Dec 18, 2024 at 03:25:58PM -0800, Mohsin Bashir wrote:
> The CSR dump support leverages the FBNIC_BOUNDS macro, which pads the end
> condition for each section by adding an offset of 1. However, the RPC RAM
> section, which is dumped differently from other sections, does not rely
> on this macro and instead directly uses end boundary address. Hence,
> subtracting 1 from the end address results in skipping a register.
> 
> Fixes 3d12862b216d (âeth: fbnic: Add support to dump registersâ)
> Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
> ---
>  drivers/net/ethernet/meta/fbnic/fbnic_csr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_csr.c b/drivers/net/ethernet/meta/fbnic/fbnic_csr.c
> index 2118901b25e9..aeb9f333f4c7 100644
> --- a/drivers/net/ethernet/meta/fbnic/fbnic_csr.c
> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_csr.c
> @@ -64,7 +64,7 @@ static void fbnic_csr_get_regs_rpc_ram(struct fbnic_dev *fbd, u32 **data_p)
>  	u32 i, j;
>  
>  	*(data++) = start;
> -	*(data++) = end - 1;
> +	*(data++) = end;
>  
>  	/* FBNIC_RPC_TCAM_ACT */
>  	for (i = 0; i < FBNIC_RPC_TCAM_ACT_NUM_ENTRIES; i++) {
> -- 

Thanks,
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

> 2.43.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] eth: fbnic: fix csr boundary for RPM RAM section
  2024-12-18 23:25 [PATCH net-next] eth: fbnic: fix csr boundary for RPM RAM section Mohsin Bashir
  2024-12-19  7:31 ` Michal Swiatkowski
@ 2024-12-19  8:25 ` Andrew Lunn
  2024-12-20 21:03   ` Jakub Kicinski
  2024-12-23 18:00 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2024-12-19  8:25 UTC (permalink / raw)
  To: Mohsin Bashir
  Cc: netdev, alexanderduyck, kuba, andrew+netdev, davem, edumazet,
	pabeni, kernel-team

On Wed, Dec 18, 2024 at 03:25:58PM -0800, Mohsin Bashir wrote:
> The CSR dump support leverages the FBNIC_BOUNDS macro, which pads the end
> condition for each section by adding an offset of 1. However, the RPC RAM
> section, which is dumped differently from other sections, does not rely
> on this macro and instead directly uses end boundary address. Hence,
> subtracting 1 from the end address results in skipping a register.

Maybe it would be better to actually use FBNIC_BOUNDS macro, to make
it the same as all the others, and so avoid errors like this because
it is special?

	Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] eth: fbnic: fix csr boundary for RPM RAM section
  2024-12-19  8:25 ` Andrew Lunn
@ 2024-12-20 21:03   ` Jakub Kicinski
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2024-12-20 21:03 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Mohsin Bashir, netdev, alexanderduyck, andrew+netdev, davem,
	edumazet, pabeni, kernel-team

On Thu, 19 Dec 2024 09:25:41 +0100 Andrew Lunn wrote:
> On Wed, Dec 18, 2024 at 03:25:58PM -0800, Mohsin Bashir wrote:
> > The CSR dump support leverages the FBNIC_BOUNDS macro, which pads the end
> > condition for each section by adding an offset of 1. However, the RPC RAM
> > section, which is dumped differently from other sections, does not rely
> > on this macro and instead directly uses end boundary address. Hence,
> > subtracting 1 from the end address results in skipping a register.  
> 
> Maybe it would be better to actually use FBNIC_BOUNDS macro, to make
> it the same as all the others, and so avoid errors like this because
> it is special?

That may require changing the format / contents of the dump a bit
to include unimplemented registers (which would read as ff).
Note that the subject is incorrect, the patch is for net, 
so the one-liner fix is more appealing at this stage.
But I may be biased...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] eth: fbnic: fix csr boundary for RPM RAM section
  2024-12-18 23:25 [PATCH net-next] eth: fbnic: fix csr boundary for RPM RAM section Mohsin Bashir
  2024-12-19  7:31 ` Michal Swiatkowski
  2024-12-19  8:25 ` Andrew Lunn
@ 2024-12-23 18:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-23 18:00 UTC (permalink / raw)
  To: Mohsin Bashir
  Cc: netdev, alexanderduyck, kuba, andrew, andrew+netdev, davem,
	edumazet, pabeni, kernel-team

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 18 Dec 2024 15:25:58 -0800 you wrote:
> The CSR dump support leverages the FBNIC_BOUNDS macro, which pads the end
> condition for each section by adding an offset of 1. However, the RPC RAM
> section, which is dumped differently from other sections, does not rely
> on this macro and instead directly uses end boundary address. Hence,
> subtracting 1 from the end address results in skipping a register.
> 
> Fixes 3d12862b216d (“eth: fbnic: Add support to dump registers”)
> Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net-next] eth: fbnic: fix csr boundary for RPM RAM section
    https://git.kernel.org/netdev/net/c/a072ffd896ef

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-23 18:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18 23:25 [PATCH net-next] eth: fbnic: fix csr boundary for RPM RAM section Mohsin Bashir
2024-12-19  7:31 ` Michal Swiatkowski
2024-12-19  8:25 ` Andrew Lunn
2024-12-20 21:03   ` Jakub Kicinski
2024-12-23 18:00 ` patchwork-bot+netdevbpf

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).