linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: dpaa_eth: print FD status in CPU endianness in dpaa_eth_fd tracepoint
@ 2024-10-29 16:31 Vladimir Oltean
  2024-10-30 13:34 ` Madalin Bucur (OSS)
  2024-11-01  2:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Vladimir Oltean @ 2024-10-29 16:31 UTC (permalink / raw)
  To: netdev, Radu Bulie
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Breno Leitao, Madalin Bucur, Ioana Ciornei, Christophe Leroy,
	Sean Anderson, linux-kernel, linuxppc-dev, linux-arm-kernel

Sparse warns:

note: in included file (through ../include/trace/trace_events.h,
../include/trace/define_trace.h,
../drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h):
warning: incorrect type in assignment (different base types)
   expected unsigned int [usertype] fd_status
   got restricted __be32 const [usertype] status

We take struct qm_fd :: status, store it and print it as an u32,
though it is a big endian field. We should print the FD status in
CPU endianness for ease of debug and consistency between PowerPC and
Arm systems.

Though it is a not often used debug feature, it is best to treat it as
a bug and backport the format change to all supported stable kernels,
for consistency.

Fixes: eb11ddf36eb8 ("dpaa_eth: add trace points")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
Context: https://lore.kernel.org/oe-kbuild-all/20241028-sticky-refined-lionfish-b06c0c@leitao/

 drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h
index 6f0e58a2a58a..9e1d44ae92cc 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h
@@ -56,7 +56,7 @@ DECLARE_EVENT_CLASS(dpaa_eth_fd,
 		__entry->fd_format = qm_fd_get_format(fd);
 		__entry->fd_offset = qm_fd_get_offset(fd);
 		__entry->fd_length = qm_fd_get_length(fd);
-		__entry->fd_status = fd->status;
+		__entry->fd_status = __be32_to_cpu(fd->status);
 		__assign_str(name);
 	),
 
-- 
2.34.1



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

* RE: [PATCH net] net: dpaa_eth: print FD status in CPU endianness in dpaa_eth_fd tracepoint
  2024-10-29 16:31 [PATCH net] net: dpaa_eth: print FD status in CPU endianness in dpaa_eth_fd tracepoint Vladimir Oltean
@ 2024-10-30 13:34 ` Madalin Bucur (OSS)
  2024-11-01  2:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Madalin Bucur (OSS) @ 2024-10-30 13:34 UTC (permalink / raw)
  To: Vladimir Oltean, netdev@vger.kernel.org, Radu-Andrei Bulie
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Breno Leitao, Ioana Ciornei, Christophe Leroy, Sean Anderson,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org

> -----Original Message-----
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> Sent: Tuesday, October 29, 2024 6:31 PM
> To: netdev@vger.kernel.org; Radu-Andrei Bulie <radu-andrei.bulie@nxp.com>
> Cc: David S. Miller <davem@davemloft.net>; Eric Dumazet
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Breno Leitao <leitao@debian.org>; Madalin Bucur
> <madalin.bucur@nxp.com>; Ioana Ciornei <ioana.ciornei@nxp.com>; Christophe
> Leroy <christophe.leroy@csgroup.eu>; Sean Anderson
> <sean.anderson@linux.dev>; linux-kernel@vger.kernel.org; linuxppc-
> dev@lists.ozlabs.org; linux-arm-kernel@lists.infradead.org
> Subject: [PATCH net] net: dpaa_eth: print FD status in CPU endianness in
> dpaa_eth_fd tracepoint
> 
> Sparse warns:
> 
> note: in included file (through ../include/trace/trace_events.h,
> ../include/trace/define_trace.h,
> ../drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h):
> warning: incorrect type in assignment (different base types)
>    expected unsigned int [usertype] fd_status
>    got restricted __be32 const [usertype] status
> 
> We take struct qm_fd :: status, store it and print it as an u32,
> though it is a big endian field. We should print the FD status in
> CPU endianness for ease of debug and consistency between PowerPC and
> Arm systems.
> 
> Though it is a not often used debug feature, it is best to treat it as
> a bug and backport the format change to all supported stable kernels,
> for consistency.
> 
> Fixes: eb11ddf36eb8 ("dpaa_eth: add trace points")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
> Context: https://lore.kernel.org/oe-kbuild-all/20241028-sticky-refined-lionfish-
> b06c0c@leitao/

Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>


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

* Re: [PATCH net] net: dpaa_eth: print FD status in CPU endianness in dpaa_eth_fd tracepoint
  2024-10-29 16:31 [PATCH net] net: dpaa_eth: print FD status in CPU endianness in dpaa_eth_fd tracepoint Vladimir Oltean
  2024-10-30 13:34 ` Madalin Bucur (OSS)
@ 2024-11-01  2:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-01  2:40 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: netdev, radu-andrei.bulie, davem, edumazet, kuba, pabeni, leitao,
	madalin.bucur, ioana.ciornei, christophe.leroy, sean.anderson,
	linux-kernel, linuxppc-dev, linux-arm-kernel

Hello:

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

On Tue, 29 Oct 2024 18:31:05 +0200 you wrote:
> Sparse warns:
> 
> note: in included file (through ../include/trace/trace_events.h,
> ../include/trace/define_trace.h,
> ../drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h):
> warning: incorrect type in assignment (different base types)
>    expected unsigned int [usertype] fd_status
>    got restricted __be32 const [usertype] status
> 
> [...]

Here is the summary with links:
  - [net] net: dpaa_eth: print FD status in CPU endianness in dpaa_eth_fd tracepoint
    https://git.kernel.org/netdev/net/c/0144c06c5890

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] 3+ messages in thread

end of thread, other threads:[~2024-11-01  2:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-29 16:31 [PATCH net] net: dpaa_eth: print FD status in CPU endianness in dpaa_eth_fd tracepoint Vladimir Oltean
2024-10-30 13:34 ` Madalin Bucur (OSS)
2024-11-01  2:40 ` 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).