All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net/mlx5: Declare no DMA segment boundary restriction
@ 2026-11-20  8:18 Tariq Toukan
  2026-11-20  8:18 ` [PATCH net-next 1/2] " Tariq Toukan
  2026-11-20  8:18 ` [PATCH net-next 2/2] net/mlx5: Declare no DMA segment boundary for data direct device Tariq Toukan
  0 siblings, 2 replies; 5+ messages in thread
From: Tariq Toukan @ 2026-11-20  8:18 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni
  Cc: Gal Pressman, Leon Romanovsky, linux-rdma, Mark Bloch,
	Moshe Shemesh, Saeed Mahameed, Tariq Toukan, Yishai Hadas

Hi,

This series by Yishai declares that the mlx5 devices have no DMA segment
boundary restriction.

Regards,
Tariq

Yishai Hadas (2):
  net/mlx5: Declare no DMA segment boundary restriction
  net/mlx5: Declare no DMA segment boundary for data direct device

 drivers/net/ethernet/mellanox/mlx5/core/data_direct.c | 1 +
 drivers/net/ethernet/mellanox/mlx5/core/main.c        | 1 +
 2 files changed, 2 insertions(+)


base-commit: 2208ab00f4f213ade91ab775e7f8c4dacdcc856e
-- 
2.44.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next 1/2] net/mlx5: Declare no DMA segment boundary restriction
  2026-11-20  8:18 [PATCH net-next 0/2] net/mlx5: Declare no DMA segment boundary restriction Tariq Toukan
@ 2026-11-20  8:18 ` Tariq Toukan
  2026-11-20  8:30   ` sashiko-bot
  2026-11-20  8:18 ` [PATCH net-next 2/2] net/mlx5: Declare no DMA segment boundary for data direct device Tariq Toukan
  1 sibling, 1 reply; 5+ messages in thread
From: Tariq Toukan @ 2026-11-20  8:18 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni
  Cc: Gal Pressman, Leon Romanovsky, linux-rdma, Mark Bloch,
	Moshe Shemesh, Saeed Mahameed, Tariq Toukan, Yishai Hadas

From: Yishai Hadas <yishaih@nvidia.com>

The PCI core initialises every PCI device with a DMA segment boundary
mask of 0xffffffff in pci_device_add(), which forbids any segment from
crossing a 4GB-aligned address regardless of its length. mlx5_core
raises the default maximum segment size to 2GB but never overrides the
boundary, although the device has no such limitation.

Consumers such as ib_umem_get() coalesce physically contiguous pages up
to the maximum segment size without consulting the boundary mask.
Registering a large MR can therefore produce a segment that crosses a
4GB-aligned address, which the DMA API debug checker reports:

  DMA-API: mlx5_core 0000:08:00.0: mapping sg segment across boundary
  [start=0x00000002ffe27000] [end=0x000000030020efff]
  [boundary=0x00000000ffffffff]

The segment is about 4MB long, well below the 2GB maximum, but it spans
the 12GB (0x300000000) boundary: the upper halves of start and end are
0x2 and 0x3.

Set the segment boundary mask to ULONG_MAX so the DMA constraints
declared for the device match what the hardware supports.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 079e91c98041..b3f4d319d29e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -190,6 +190,7 @@ static int set_dma_caps(struct pci_dev *pdev)
 	}
 
 	dma_set_max_seg_size(&pdev->dev, 2u * 1024 * 1024 * 1024);
+	dma_set_seg_boundary(&pdev->dev, ULONG_MAX);
 	return err;
 }
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next 2/2] net/mlx5: Declare no DMA segment boundary for data direct device
  2026-11-20  8:18 [PATCH net-next 0/2] net/mlx5: Declare no DMA segment boundary restriction Tariq Toukan
  2026-11-20  8:18 ` [PATCH net-next 1/2] " Tariq Toukan
@ 2026-11-20  8:18 ` Tariq Toukan
  2026-11-20  8:30   ` sashiko-bot
  1 sibling, 1 reply; 5+ messages in thread
From: Tariq Toukan @ 2026-11-20  8:18 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni
  Cc: Gal Pressman, Leon Romanovsky, linux-rdma, Mark Bloch,
	Moshe Shemesh, Saeed Mahameed, Tariq Toukan, Yishai Hadas

From: Yishai Hadas <yishaih@nvidia.com>

The PCI core initialises every PCI device with a DMA segment boundary
mask of 0xffffffff in pci_device_add(), which forbids any segment from
crossing a 4GB-aligned address regardless of its length. The data direct
device raises the default maximum segment size to 2GB but keeps that
boundary, although it has no such limitation.

Declare that explicitly, in line with mlx5_core, to avoid a mismatch
between the declared constraints and the hardware capabilities.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/data_direct.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/data_direct.c b/drivers/net/ethernet/mellanox/mlx5/core/data_direct.c
index 5afb11a2a9f0..73eef8bbc327 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/data_direct.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/data_direct.c
@@ -103,6 +103,7 @@ static int mlx5_data_direct_set_dma_caps(struct pci_dev *pdev)
 	}
 
 	dma_set_max_seg_size(&pdev->dev, SZ_2G);
+	dma_set_seg_boundary(&pdev->dev, ULONG_MAX);
 	return 0;
 }
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 1/2] net/mlx5: Declare no DMA segment boundary restriction
  2026-11-20  8:18 ` [PATCH net-next 1/2] " Tariq Toukan
@ 2026-11-20  8:30   ` sashiko-bot
  0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-20  8:30 UTC (permalink / raw)
  To: Tariq Toukan; +Cc: linux-rdma

> From: Yishai Hadas <yishaih@nvidia.com>
> 
> The PCI core initialises every PCI device with a DMA segment boundary
> mask of 0xffffffff in pci_device_add(), which forbids any segment from
> crossing a 4GB-aligned address regardless of its length. mlx5_core
> raises the default maximum segment size to 2GB but never overrides the
> boundary, although the device has no such limitation.
> 
> Consumers such as ib_umem_get() coalesce physically contiguous pages up
> to the maximum segment size without consulting the boundary mask.
> Registering a large MR can therefore produce a segment that crosses a
> 4GB-aligned address, which the DMA API debug checker reports:
> 
>   DMA-API: mlx5_core 0000:08:00.0: mapping sg segment across boundary
>   [start=0x00000002ffe27000] [end=0x000000030020efff]
>   [boundary=0x00000000ffffffff]
> 
> The segment is about 4MB long, well below the 2GB maximum, but it spans
> the 12GB (0x300000000) boundary: the upper halves of start and end are
> 0x2 and 0x3.
> 
> Set the segment boundary mask to ULONG_MAX so the DMA constraints
> declared for the device match what the hardware supports.
> 
> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
> Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120081819.2538191-1-tariqt@nvidia.com?part=1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 2/2] net/mlx5: Declare no DMA segment boundary for data direct device
  2026-11-20  8:18 ` [PATCH net-next 2/2] net/mlx5: Declare no DMA segment boundary for data direct device Tariq Toukan
@ 2026-11-20  8:30   ` sashiko-bot
  0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-20  8:30 UTC (permalink / raw)
  To: Tariq Toukan; +Cc: linux-rdma

> From: Yishai Hadas <yishaih@nvidia.com>
> 
> The PCI core initialises every PCI device with a DMA segment boundary
> mask of 0xffffffff in pci_device_add(), which forbids any segment from
> crossing a 4GB-aligned address regardless of its length. The data direct
> device raises the default maximum segment size to 2GB but keeps that
> boundary, although it has no such limitation.
> 
> Declare that explicitly, in line with mlx5_core, to avoid a mismatch
> between the declared constraints and the hardware capabilities.
> 
> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
> Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120081819.2538191-1-tariqt@nvidia.com?part=2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-20  8:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20  8:18 [PATCH net-next 0/2] net/mlx5: Declare no DMA segment boundary restriction Tariq Toukan
2026-11-20  8:18 ` [PATCH net-next 1/2] " Tariq Toukan
2026-11-20  8:30   ` sashiko-bot
2026-11-20  8:18 ` [PATCH net-next 2/2] net/mlx5: Declare no DMA segment boundary for data direct device Tariq Toukan
2026-11-20  8:30   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.