linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] UIO_MEM_DMA_COHERENT for cnic/bnx2/bnx2x
@ 2024-01-09 12:14 Nilesh Javali
  2024-01-09 12:14 ` [PATCH v3 1/3] uio: introduce UIO_MEM_DMA_COHERENT type Nilesh Javali
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Nilesh Javali @ 2024-01-09 12:14 UTC (permalink / raw)
  To: martin.petersen, lduncan, cleech
  Cc: linux-scsi, GR-QLogic-Storage-Upstream, jmeneghi

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.

In order to fix these drivers to be able to mmap dma coherent memory via
a uio device, without resorting to hacks and working with an iommu
enabled, introduce a new uio mmap type backed by dma_mmap_coherent.

While converting the uio interface, I also noticed that not all of these
allocations were PAGE_SIZE aligned. Particularly the bnx2/bnx2x status
block mapping was much smaller than any architecture page size, and I
was concerned that it could be unintentionally exposing kernel memory.

v3:
- fix warnings reported by kernel test robot
  and added base commit
v2:
- expose only the dma_addr within uio and cnic.
- Cleanup newly added unions comprising virtual_addr
  and struct device

Chris Leech (3):
  uio: introduce UIO_MEM_DMA_COHERENT type
  cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT
  cnic,bnx2,bnx2x: page align uio mmap allocations

 drivers/net/ethernet/broadcom/bnx2.c          |  2 +
 .../net/ethernet/broadcom/bnx2x/bnx2x_main.c  | 10 +++--
 drivers/net/ethernet/broadcom/cnic.c          | 20 +++++++---
 drivers/net/ethernet/broadcom/cnic.h          |  1 +
 drivers/net/ethernet/broadcom/cnic_if.h       |  1 +
 drivers/uio/uio.c                             | 40 +++++++++++++++++++
 include/linux/uio_driver.h                    |  2 +
 7 files changed, 66 insertions(+), 10 deletions(-)


base-commit: ed340d13aa1db6773667ed4bf907738df203fbda
-- 
2.23.1


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

end of thread, other threads:[~2024-01-25 22:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09 12:14 [PATCH v3 0/3] UIO_MEM_DMA_COHERENT for cnic/bnx2/bnx2x Nilesh Javali
2024-01-09 12:14 ` [PATCH v3 1/3] uio: introduce UIO_MEM_DMA_COHERENT type Nilesh Javali
2024-01-24 23:14   ` Chris Leech
2024-01-25 22:43     ` Greg Kroah-Hartman
2024-01-24 23:36   ` Chris Leech
2024-01-25 10:49     ` [EXT] " Nilesh Javali
2024-01-25 19:16       ` Chris Leech
2024-01-09 12:14 ` [PATCH v3 2/3] cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT Nilesh Javali
2024-01-09 12:14 ` [PATCH v3 3/3] cnic,bnx2,bnx2x: page align uio mmap allocations Nilesh Javali
2024-01-17  7:59 ` [PATCH v3 0/3] UIO_MEM_DMA_COHERENT for cnic/bnx2/bnx2x Nilesh Javali

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).