Re: [PATCH net-next 0/2] GCPS Spec Compliance Patch Set

From: Hari Kalavakunta
Date: Wed Apr 09 2025 - 12:39:57 EST


On 4/9/2025 2:08 AM, Paul Fertser wrote:
On Tue, Apr 08, 2025 at 04:23:43PM -0700, Hari Kalavakunta wrote:
On 4/8/2025 3:35 PM, Paul Fertser wrote:
Thank you for doing the right thing! Looking forward to your updated
patch (please do not forget to consider __be64 for the fields).

I had not previously considered using __be64 for the struct
ncsi_rsp_gcps_pkt, as it is an interface structure. I would like to seek
your input on whether it is a good idea to use __be64 for interface
messages. In my experience, I haven't come across implementations that
utilize __be64. I am unsure about the portability of this approach,
particularly with regards to the Management Controller (MC).

I do not see why not[0][1]. What makes MC special, do you imply it
doesn't have be64_to_cpu() (be64_to_cpup() for unaligned data) or
what? If the values you get from hardware are indeed 64-bit BE clearly
open-coding conversions from them is suboptimal.

[0] https://elixir.bootlin.com/linux/v6.13.7/A/ident/__be64
[1] https://elixir.bootlin.com/linux/v6.13.7/source/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h#L155
Thank you for providing the references. I will proceed with running a test on real hardware with be64_to_cpu() to verify that stat mediation works correctly all the way into the local driver structure. If everything looks correct, I will submit a revised patch.