Re: [PATCH net-next v06 6/8] hinic3: Mailbox framework

From: Fan Gong
Date: Tue Jul 01 2025 - 02:51:59 EST


> > +void hinic3_mbox_func_aeqe_handler(struct hinic3_hwdev *hwdev, u8 *header,
> > + u8 size)
> > +{
> > + u64 mbox_header = *((u64 *)header);
>
> The question here is how will it work with different endianess? AFAIU,
> u8 *header is a buffer filled in by FW with device's endianess, which
> you directly convert into host's endianess into u64 value. If the
> endianess doesn't match, this conversion will fail.

The mbox data filled by HW is little-endian and our driver is currently supported
on little endian. So they work with the same endianess and header's conversion
will success.

> I cannot find any code which calls hinic3_mbox_func_aeqe_handler(),
> neither in this patch, nor further in the patchset. What is the reason
> to have it in this series?

Besides hinic3_mbox_func_aeqe_handler, hinic3_init_mbox and hinic3_free_mbox
are not called in this patchset because of LoC limit. They will be called in
next patchset which includes HW capabilities probing and initialization.
The reason why we place them in this patch is that these three functions are
basic funcions of mbox framework, representing initialization, release and
firmware-triggered callbacks. A complete mbox framework requires these three
parts of code logic.