RE: [PATCH net] net: dpaa_eth: print FD status in CPU endianness in dpaa_eth_fd tracepoint
From: Madalin Bucur (OSS)
Date: Wed Oct 30 2024 - 09:34:43 EST
> -----Original Message-----
> From: Vladimir Oltean <vladimir.oltean@xxxxxxx>
> Sent: Tuesday, October 29, 2024 6:31 PM
> To: netdev@xxxxxxxxxxxxxxx; Radu-Andrei Bulie <radu-andrei.bulie@xxxxxxx>
> Cc: David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet
> <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni
> <pabeni@xxxxxxxxxx>; Breno Leitao <leitao@xxxxxxxxxx>; Madalin Bucur
> <madalin.bucur@xxxxxxx>; Ioana Ciornei <ioana.ciornei@xxxxxxx>; Christophe
> Leroy <christophe.leroy@xxxxxxxxxx>; Sean Anderson
> <sean.anderson@xxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; linuxppc-
> dev@xxxxxxxxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> 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@xxxxxxx>
> ---
> Context: https://lore.kernel.org/oe-kbuild-all/20241028-sticky-refined-lionfish-
> b06c0c@leitao/
Acked-by: Madalin Bucur <madalin.bucur@xxxxxxxxxxx>