All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 00/11] dma-mapping: add dma_alloc_attrs_node() and dma_alloc_coherent_node()
@ 2026-10-27  2:25 Jakub Kicinski
  2026-10-27  2:25 ` [RFC 01/11] dma-contiguous: pass the NUMA node to dma_alloc_contiguous() Jakub Kicinski
                   ` (11 more replies)
  0 siblings, 12 replies; 24+ messages in thread
From: Jakub Kicinski @ 2026-10-27  2:25 UTC (permalink / raw)
  To: robin.murphy, m.szyprowski
  Cc: tglx, dave.hansen, x86, joro, will, leon, mbloch, iommu, netdev,
	Jakub Kicinski

Hi!

I want to add NUMA-awareness to a networking driver (bnxt) and
I run into the inexistence of dma_alloc_coherent_node().

On NUMA systems networking drivers want to allocate rings
and buffers close to the NAPI-handling core rather than
allocating all from where the device is connected.

Looks like we have accumulated 6 drivers which do:

       set_dev_node(dma_dev, numa_node);
       va = dma_alloc_coherent(...);
       set_dev_node(dma_dev, old_node);

IMHO this looks like an ugly hack. Can we add an API
with the Node ID explicitly passed in?


In the unlikely case anyone feels the urgent need to merge
this please pull (so that we can also pull this into net-next):

  git://git.kernel.org/pub/scm/linux/kernel/git/kuba/linux.git tags/dma_alloc_coherent_node

Jakub Kicinski (11):
  dma-contiguous: pass the NUMA node to dma_alloc_contiguous()
  dma-direct: pass the NUMA node to dma_direct_alloc()
  iommu/dma: pass the NUMA node to iommu_dma_alloc()
  dma-mapping: add dma_alloc_attrs_node() and dma_alloc_coherent_node()
  eth: libwx: restore the device's NUMA node after ring allocation
  eth: libwx: use dma_alloc_coherent_node()
  eth: ixgbe: use dma_alloc_coherent_node()
  eth: xgbe: use dma_alloc_coherent_node()
  eth: fungible: use dma_alloc_coherent_node()
  eth: mlx5: use dma_alloc_coherent_node()
  eth: mlx4: use dma_alloc_coherent_node()

 Documentation/core-api/dma-api.rst            | 15 ++++++++
 include/linux/dma-direct.h                    |  2 +-
 include/linux/dma-map-ops.h                   |  5 +--
 include/linux/dma-mapping.h                   | 14 ++++++++
 include/linux/iommu-dma.h                     |  2 +-
 include/linux/mlx4/device.h                   |  2 +-
 include/linux/mlx5/driver.h                   |  2 --
 arch/x86/kernel/amd_gart_64.c                 |  3 +-
 drivers/iommu/dma-iommu.c                     | 30 +++++++++-------
 drivers/net/ethernet/amd/xgbe/xgbe-desc.c     |  6 +---
 .../net/ethernet/fungible/funcore/fun_queue.c |  8 ++---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 20 ++++-------
 drivers/net/ethernet/mellanox/mlx4/alloc.c    | 12 +++----
 drivers/net/ethernet/mellanox/mlx4/en_cq.c    |  9 ++---
 .../net/ethernet/mellanox/mlx4/en_netdev.c    |  2 +-
 drivers/net/ethernet/mellanox/mlx4/en_rx.c    |  5 ++-
 drivers/net/ethernet/mellanox/mlx4/en_tx.c    |  5 ++-
 .../net/ethernet/mellanox/mlx5/core/alloc.c   | 24 ++-----------
 .../net/ethernet/mellanox/mlx5/core/main.c    |  4 ---
 drivers/net/ethernet/wangxun/libwx/wx_lib.c   | 22 +++++-------
 kernel/dma/contiguous.c                       | 12 +++----
 kernel/dma/direct.c                           | 20 ++++++-----
 kernel/dma/mapping.c                          | 34 ++++++++++++++++---
 kernel/dma/ops_helpers.c                      |  5 +--
 24 files changed, 137 insertions(+), 126 deletions(-)

-- 
2.56.0


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

end of thread, other threads:[~2026-10-29  9:17 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-27  2:25 [RFC 00/11] dma-mapping: add dma_alloc_attrs_node() and dma_alloc_coherent_node() Jakub Kicinski
2026-10-27  2:25 ` [RFC 01/11] dma-contiguous: pass the NUMA node to dma_alloc_contiguous() Jakub Kicinski
2026-10-27  2:25 ` [RFC 02/11] dma-direct: pass the NUMA node to dma_direct_alloc() Jakub Kicinski
2026-10-27  2:25 ` [RFC 03/11] iommu/dma: pass the NUMA node to iommu_dma_alloc() Jakub Kicinski
2026-10-27  2:25 ` [RFC 04/11] dma-mapping: add dma_alloc_attrs_node() and dma_alloc_coherent_node() Jakub Kicinski
2026-10-27  9:03   ` Björn Töpel
2026-10-27 15:53     ` Jakub Kicinski
2026-10-27 15:24   ` Marek Szyprowski
2026-10-27 17:52     ` Jakub Kicinski
2026-10-28  9:00       ` Marek Szyprowski
2026-10-27  2:25 ` [RFC 05/11] eth: libwx: restore the device's NUMA node after ring allocation Jakub Kicinski
2026-10-27  2:25 ` [RFC 06/11] eth: libwx: use dma_alloc_coherent_node() Jakub Kicinski
2026-10-27  2:25 ` [RFC 07/11] eth: ixgbe: " Jakub Kicinski
2026-10-27  9:06   ` Björn Töpel
2026-10-27 15:51     ` Jakub Kicinski
2026-10-27 16:06       ` Björn Töpel
2026-10-27 18:20         ` Jakub Kicinski
2026-10-29  8:47           ` Björn Töpel
2026-10-29  9:17             ` Marek Szyprowski
2026-10-27  2:25 ` [RFC 08/11] eth: xgbe: " Jakub Kicinski
2026-10-27  2:25 ` [RFC 09/11] eth: fungible: " Jakub Kicinski
2026-10-27  2:25 ` [RFC 10/11] eth: mlx5: " Jakub Kicinski
2026-10-27  2:25 ` [RFC 11/11] eth: mlx4: " Jakub Kicinski
2026-10-27  9:03 ` [RFC 00/11] dma-mapping: add dma_alloc_attrs_node() and dma_alloc_coherent_node() Björn Töpel

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.