netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] UIO_MEM_DMA_COHERENT for cnic/bnx2/bnx2x
@ 2023-09-29 17:00 Chris Leech
  2023-09-29 17:00 ` [PATCH 1/3] uio: introduce UIO_DMA_COHERENT type Chris Leech
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Chris Leech @ 2023-09-29 17:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Christoph Hellwig, Rasesh Mody, Ariel Elior,
	Sudarsana Kalluru, Manish Chopra
  Cc: Nilesh Javali, Manish Rangankar, Jerry Snitselaar, John Meneghini,
	Lee Duncan, Mike Christie, Hannes Reinecke, netdev, linux-kernel

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.

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

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

-- 
2.41.0


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

end of thread, other threads:[~2023-10-05 14:42 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-29 17:00 [PATCH 0/3] UIO_MEM_DMA_COHERENT for cnic/bnx2/bnx2x Chris Leech
2023-09-29 17:00 ` [PATCH 1/3] uio: introduce UIO_DMA_COHERENT type Chris Leech
2023-09-30  7:10   ` Greg Kroah-Hartman
2023-09-30 18:08     ` Chris Leech
2023-10-02  6:09   ` Christoph Hellwig
2023-09-29 17:00 ` [PATCH 2/3] cnic,bnx2,bnx2x: page align uio mmap allocations Chris Leech
2023-09-29 17:18   ` Jacob Keller
2023-10-02  6:11   ` Christoph Hellwig
2023-09-29 17:00 ` [PATCH 3/3] cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT Chris Leech
2023-09-29 17:19   ` Jacob Keller
2023-09-30  7:06   ` Greg Kroah-Hartman
2023-09-30  9:10     ` Jerry Snitselaar
2023-09-30 18:29       ` Greg Kroah-Hartman
2023-09-30 18:19     ` Chris Leech
2023-09-30 18:28       ` Greg Kroah-Hartman
2023-10-01 10:44         ` Hannes Reinecke
2023-10-01 11:57           ` Greg Kroah-Hartman
2023-10-01 14:22             ` Jerry Snitselaar
2023-10-02  6:04               ` Christoph Hellwig
2023-10-02  7:50                 ` Jerry Snitselaar
2023-10-02  8:46                   ` Greg Kroah-Hartman
2023-10-02  8:59                     ` Hannes Reinecke
2023-10-05 10:39                       ` Paolo Abeni

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