netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/4] UIO_MEM_DMA_COHERENT for cnic/bnx2/bnx2x
@ 2024-02-01 23:33 Chris Leech
  2024-02-01 23:33 ` [PATCH v5 1/4] uio: introduce UIO_MEM_DMA_COHERENT type Chris Leech
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Chris Leech @ 2024-02-01 23:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Nilesh Javali
  Cc: Christoph Hellwig, John Meneghini, Lee Duncan, Mike Christie,
	Hannes Reinecke, netdev, linux-kernel, linux-scsi,
	GR-QLogic-Storage-Upstream

During bnx2i iSCSI testing we ran into page refcounting issues in the
uio mmaps exported from cnic to the iscsiuio process, and bisected back
to the removal of the __GFP_COMP flag from dma_alloc_coherent calls.

The cnic uio interface also has issues running with an iommu enabled,
which these changes correct.

In order to fix these drivers to be able to mmap dma coherent memory via
a uio device, introduce a new uio mmap type backed by dma_mmap_coherent.

While I understand some complaints about how these drivers have been
structured, I also don't like letting support bitrot when there's a
reasonable alternative to re-architecting an existing driver. I believe
this to be the most sane way to restore these drivers to functioning
properly.

There are two other uio drivers which are mmaping dma_alloc_coherent
memory as UIO_MEM_PHYS, uio_dmem_genirq and uio_pruss.
These drivers are converted in the later patches of this series.

v5:
- convert uio_pruss and uio_dmem_genirq
- added dev_warn and comment about not adding more users
- put some PAGE_ALIGNs back in cnic to keep checks in
  uio_mmap_dma_coherent matched with uio_mmap_physical.
- dropped the Fixes trailer
v4:
- re-introduce the dma_device member to uio_map,
  it needs to be passed to dma_mmap_coherent somehow
- drop patch 3 to focus only on the uio interface,
  explicit page alignment isn't needed
- re-add the v1 mail recipients,
  this isn't something to be handled through linux-scsi
v3 (Nilesh Javali <njavali@marvell.com>):
- fix warnings reported by kernel test robot
  and added base commit
v2 (Nilesh Javali <njavali@marvell.com>):
- expose only the dma_addr within uio and cnic.
- Cleanup newly added unions comprising virtual_addr
  and struct device

previous threads:
v1: https://lore.kernel.org/all/20230929170023.1020032-1-cleech@redhat.com/
attempt at an alternative change: https://lore.kernel.org/all/20231219055514.12324-1-njavali@marvell.com/
v2: https://lore.kernel.org/all/20240103091137.27142-1-njavali@marvell.com/
v3: https://lore.kernel.org/all/20240109121458.26475-1-njavali@marvell.com/
v4: https://lore.kernel.org/all/20240131191732.3247996-1-cleech@redhat.com/

Chris Leech (4):
  uio: introduce UIO_MEM_DMA_COHERENT type
  cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT
  uio_pruss: UIO_MEM_DMA_COHERENT conversion
  uio_dmem_genirq: UIO_MEM_DMA_COHERENT conversion

 drivers/net/ethernet/broadcom/bnx2.c          |  1 +
 .../net/ethernet/broadcom/bnx2x/bnx2x_main.c  |  2 +
 drivers/net/ethernet/broadcom/cnic.c          | 25 ++++++----
 drivers/net/ethernet/broadcom/cnic.h          |  1 +
 drivers/net/ethernet/broadcom/cnic_if.h       |  1 +
 drivers/uio/uio.c                             | 47 +++++++++++++++++++
 drivers/uio/uio_dmem_genirq.c                 | 22 ++++-----
 drivers/uio/uio_pruss.c                       |  6 ++-
 include/linux/uio_driver.h                    |  8 ++++
 9 files changed, 89 insertions(+), 24 deletions(-)


base-commit: 861c0981648f5b64c86fd028ee622096eb7af05a
-- 
2.43.0


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

end of thread, other threads:[~2024-03-22 15:23 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-01 23:33 [PATCH v5 0/4] UIO_MEM_DMA_COHERENT for cnic/bnx2/bnx2x Chris Leech
2024-02-01 23:33 ` [PATCH v5 1/4] uio: introduce UIO_MEM_DMA_COHERENT type Chris Leech
2024-02-04 10:20   ` Simon Horman
2024-02-05 20:01   ` [PATCH v6 " Chris Leech
2024-02-12  6:56     ` Christoph Hellwig
2024-03-22 14:16     ` Guenter Roeck
2024-03-22 14:30       ` Greg Kroah-Hartman
2024-03-22 15:23         ` Guenter Roeck
2024-02-01 23:33 ` [PATCH v5 2/4] cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT Chris Leech
2024-02-02 19:08   ` Jakub Kicinski
2024-02-01 23:33 ` [PATCH v5 3/4] uio_pruss: UIO_MEM_DMA_COHERENT conversion Chris Leech
2024-02-01 23:34 ` [PATCH v5 4/4] uio_dmem_genirq: " Chris Leech
2024-02-04 10:19   ` Simon Horman
2024-02-05 19:53     ` Chris Leech
2024-02-05 20:02   ` [PATCH v6 " Chris Leech
2024-02-05 16:57 ` [PATCH v5 0/4] UIO_MEM_DMA_COHERENT for cnic/bnx2/bnx2x Alexander Lobakin
2024-02-05 19:51   ` Chris Leech
2024-02-06 15:54     ` Jakub Kicinski
2024-02-06 20:16       ` Lee Duncan
2024-02-21 18:28 ` Chris Leech
2024-02-28 18:20 ` Lee Duncan
2024-02-29  6:10   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).