aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriel Ehrenberg <aehrenberg@nvidia.com>2026-06-08 10:56:04 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-07-07 11:25:15 +0000
commit80902b8b7cd409ade11048dc78212e7d43475c65 (patch)
tree828ff9ac4c80ed7511811611047c2f3330707b75
parent631e57d54c137e9393c47075db09a6c7fb84c6ed (diff)
mlx5ib: advertise write-combining support for dynamic BlueFlame UARs
Import Linux upstream commit 1f3db161881b7e21efb149e0ae8152b79a571a8f. dev->wc_support was never set, so it was always false and the UAR ioctl refused BlueFlame (write-combining) UAR allocations with EOPNOTSUPP. That breaks QP creation in pure dynamic-UAR mode, where user space asks for a BF doorbell UAR. Reviewed by: kib Tested by: Wafa Hamzah <wafah@nvidia.com> Sponsored by: Nvidia networking MFC after: 1 month
-rw-r--r--sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
index 66d8d511f2f0..ee5288c07b35 100644
--- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
@@ -3551,6 +3551,16 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
dev->mdev = mdev;
+ /*
+ * Write-combining is required to expose BlueFlame (WC) UARs through the
+ * dynamic MLX5_IB_OBJECT_UAR ioctl path. The legacy static UAR path
+ * already maps doorbell pages with pgprot_writecombine(), so advertise
+ * WC support whenever the platform actually provides it.
+ */
+#if defined(VM_MEMATTR_WRITE_COMBINING)
+ dev->wc_support = true;
+#endif
+
dev->port = kcalloc(MLX5_CAP_GEN(mdev, num_ports), sizeof(*dev->port),
GFP_KERNEL);
if (!dev->port)