Re: [PATCH 8/9] Remove most checks of __BYTE_ORDER

Yishai Hadas
2016-10-05T15:16:45Z

On 9/30/2016 3:08 AM, Jason Gunthorpe wrote:
> On Thu, Sep 29, 2016 at 06:46:02PM -0500, Steve Wise wrote:
>>> I added the comment because cxgb* was the only provider that seemed to
>>> be obviously byte swapping MMIO.
>>>
>>> Since htole32 is a NOP on x86 and ARM64 the driver would work fine
>>> with or without it. Do you know this driver works on big endian
>>> powerpc? That would help answer the question for sure.
>>
>> Yes, PowerPC and arm.
>
> Okay great. Maybe Yishai can explain what mlx drivers are doing..

MLX drivers use BE format for QPN as part of writing a door bell in both
X86 and PPC BE as their NICs expect to get, code is certified to work
fine on both.

Specifically,
Upon QP creation the code uses htonl for setting qp->doorbell_qpn (see
mlx4_create_qp_ex), later on this value is used without any change upon
writing a door bell. (see mmio_writel). No PCI swap is expected.