* [PATCH rdma-next] RDMA/erdma: restrict the driver to little-endian systems
@ 2026-08-06 8:48 Leon Romanovsky
2026-08-06 8:54 ` Cheng Xu
2026-08-06 11:34 ` Leon Romanovsky
0 siblings, 2 replies; 3+ messages in thread
From: Leon Romanovsky @ 2026-08-06 8:48 UTC (permalink / raw)
To: Cheng Xu, Kai Shen, Jason Gunthorpe, Leon Romanovsky
Cc: linux-rdma, linux-kernel
From: Leon Romanovsky <leonro@nvidia.com>
The eRDMA device interface requires explicit byte ordering, but several
DMA-visible values that should be little-endian remain native-endian.
Command request payloads are copied verbatim, data-path SQE headers are
written without cpu_to_le64(), and kernel doorbell records are assigned
plain u64 values. The command completion path also reads a little-endian
SQE header without conversion.
These paths are byte-swapped on big-endian kernels and can break command
processing during probe. Since complete big-endian support requires
converting every device-visible structure, depend on !CPU_BIG_ENDIAN.
Fixes: ca7fd6cff3b8 ("RDMA/erdma: Add driver to kernel build environment")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
RDMA/erdma: restrict the driver to little-endian systems
---
drivers/infiniband/hw/erdma/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/erdma/Kconfig b/drivers/infiniband/hw/erdma/Kconfig
index 267fc1f3c42a..745e5551773f 100644
--- a/drivers/infiniband/hw/erdma/Kconfig
+++ b/drivers/infiniband/hw/erdma/Kconfig
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
config INFINIBAND_ERDMA
tristate "Alibaba Elastic RDMA Adapter (ERDMA) support"
- depends on PCI_MSI && 64BIT
+ depends on PCI_MSI && 64BIT && !CPU_BIG_ENDIAN
depends on INFINIBAND_ADDR_TRANS
depends on INFINIBAND_USER_ACCESS
help
---
base-commit: 961ac0f0c5e414abdd6b33fae84b311d9fde0bd0
change-id: 20260806-missing-endianness-conversion-for-64-f0af69246071
Best regards,
--
Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH rdma-next] RDMA/erdma: restrict the driver to little-endian systems
2026-08-06 8:48 [PATCH rdma-next] RDMA/erdma: restrict the driver to little-endian systems Leon Romanovsky
@ 2026-08-06 8:54 ` Cheng Xu
2026-08-06 11:34 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: Cheng Xu @ 2026-08-06 8:54 UTC (permalink / raw)
To: Leon Romanovsky, Kai Shen, Jason Gunthorpe; +Cc: linux-rdma, linux-kernel
On 8/6/26 4:48 PM, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
>
> The eRDMA device interface requires explicit byte ordering, but several
> DMA-visible values that should be little-endian remain native-endian.
> Command request payloads are copied verbatim, data-path SQE headers are
> written without cpu_to_le64(), and kernel doorbell records are assigned
> plain u64 values. The command completion path also reads a little-endian
> SQE header without conversion.
>
> These paths are byte-swapped on big-endian kernels and can break command
> processing during probe. Since complete big-endian support requires
> converting every device-visible structure, depend on !CPU_BIG_ENDIAN.
>
> Fixes: ca7fd6cff3b8 ("RDMA/erdma: Add driver to kernel build environment")
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
> RDMA/erdma: restrict the driver to little-endian systems
> ---
> drivers/infiniband/hw/erdma/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Acked-by: Cheng Xu <chengyou@linux.alibaba.com>
> diff --git a/drivers/infiniband/hw/erdma/Kconfig b/drivers/infiniband/hw/erdma/Kconfig
> index 267fc1f3c42a..745e5551773f 100644
> --- a/drivers/infiniband/hw/erdma/Kconfig
> +++ b/drivers/infiniband/hw/erdma/Kconfig
> @@ -1,7 +1,7 @@
> # SPDX-License-Identifier: GPL-2.0-only
> config INFINIBAND_ERDMA
> tristate "Alibaba Elastic RDMA Adapter (ERDMA) support"
> - depends on PCI_MSI && 64BIT
> + depends on PCI_MSI && 64BIT && !CPU_BIG_ENDIAN
> depends on INFINIBAND_ADDR_TRANS
> depends on INFINIBAND_USER_ACCESS
> help
>
> ---
> base-commit: 961ac0f0c5e414abdd6b33fae84b311d9fde0bd0
> change-id: 20260806-missing-endianness-conversion-for-64-f0af69246071
>
> Best regards,
> --
> Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH rdma-next] RDMA/erdma: restrict the driver to little-endian systems
2026-08-06 8:48 [PATCH rdma-next] RDMA/erdma: restrict the driver to little-endian systems Leon Romanovsky
2026-08-06 8:54 ` Cheng Xu
@ 2026-08-06 11:34 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2026-08-06 11:34 UTC (permalink / raw)
To: Cheng Xu, Kai Shen, Jason Gunthorpe, Leon Romanovsky
Cc: linux-rdma, linux-kernel
On Thu, 06 Aug 2026 11:48:56 +0300, Leon Romanovsky wrote:
> The eRDMA device interface requires explicit byte ordering, but several
> DMA-visible values that should be little-endian remain native-endian.
> Command request payloads are copied verbatim, data-path SQE headers are
> written without cpu_to_le64(), and kernel doorbell records are assigned
> plain u64 values. The command completion path also reads a little-endian
> SQE header without conversion.
>
> [...]
Applied, thanks!
[1/1] RDMA/erdma: restrict the driver to little-endian systems
https://git.kernel.org/rdma/rdma/c/a12d9145145b21
Best regards,
--
Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-06 11:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-06 8:48 [PATCH rdma-next] RDMA/erdma: restrict the driver to little-endian systems Leon Romanovsky
2026-08-06 8:54 ` Cheng Xu
2026-08-06 11:34 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®