Re: [PATCH net-next v01 1/1] hinic3: module initialization and tx/rx logic

From: Gur Stavi
Date: Sun Dec 22 2024 - 02:59:30 EST


> On Thu, 19 Dec 2024 11:21:55 +0200 Gur Stavi wrote:
> > +config HINIC3
> > + tristate "Huawei Intelligent Network Interface Card 3rd"
> > + # Fields of HW and management structures are little endian and will not
> > + # be explicitly converted
>
> This is a PCIe device, users may plug it into any platform.
> Please annotate the endian of the data structures and use appropriate
> conversion helpers.
>

This is basically saying that all drivers MUST support all architectures
which is not a currently documented requirement.
As I said before, both Amazon and Microsoft have this dependency.
They currently do not sell their HW so users cannot choose where to plug
it, but they could start selling it whenever they want and the driver will
remain the same.
The primary goal of this driver is for VMs in Huawei cloud, just like
Amazon and Microsoft. Whether users can actually buy it in the future is
unknown.

for the record, we did start at some point to change all integer members
in management structures to __leXX and use cpu_to_le and le_to_cpu.
There are hundreds of these and it made the code completely unreadable.

And since we do not plan to test the driver on POWER or ARM big endian I
really don't see the point.

> > + depends on 64BIT && !CPU_BIG_ENDIAN
> > + depends on PCI_MSI && (X86 || ARM64)
>
> Also allow COMPILE_TEST
>

Ack

> > + help
> > + This driver supports HiNIC PCIE Ethernet cards.
> > + To compile this driver as part of the kernel, choose Y here.
> > + If unsure, choose N.
> > + The default is N.