Skip to content

Fix breakage caused by the NTB multi-port patchset

Logan Gunthorpe lkml ntb 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 3 repliesIn review
  2. v28 patches 8 repliesSuperseded
  3. v18 patches 21 repliesSuperseded

Changes in v3 from the cover letter

- Rebased on v5.0-rc1
- Modify Patch 2 to revert back to using the PCI struct device instead of the NTB struct device in DMA calls
- Collected Allen's Acks
- Collected Alexander's Tested-By

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8NTB: ntb_tool: reading the link file should not end in a NULL bytedrivers/ntb/test/ntb_tool.c+1 -20 replies
2/8NTB: Revert the change to use the NTB device dev for DMA allocationsdrivers/ntb/hw/amd/ntb_hw_amd.c drivers/ntb/hw/idt/ntb_hw_idt.c drivers/ntb/hw/intel/ntb_hw_gen1.c +3 more+6 -220 replies
3/8NTB: Fix the default port and peer numbers for legacy driversdrivers/ntb/ntb.c+2 -60 replies
4/8NTB: ntb_pingpong: Choose doorbells based on port numberdrivers/ntb/test/ntb_pingpong.c+6 -80 replies
5/8NTB: perf: Don't require one more memory window than number of peersdrivers/ntb/test/ntb_perf.c+1 -10 replies
6/8NTB: perf: Fix support for hardware that doesn't have port numbersdrivers/ntb/test/ntb_perf.c+10 -00 replies
7/8NTB: perf: Fix race condition when run with ntb_testdrivers/ntb/test/ntb_perf.c+8 -20 replies
8/8NTB: ntb_test: Fix bug when counting remote filestools/testing/selftests/ntb/ntb_test.sh+1 -10 replies

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchAllen HubbeAlexander Fomichev
1/8A-b T-b
2/8T-b
3/8A-b T-b
4/8A-b T-b
5/8A-b T-b
6/8A-b T-b
7/8A-b T-b
8/8A-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/8] Fix breakage caused by the NTB multi-port patchset

Hey,

I'm resending this because I've recently found out that the change we made to use the NTB struct device in DMA allocations is wrong and needs to be reverted. Turns out that, when running with an IOMMU, dma_alloc_coherent() will always fail if you pass it the NTB struct device. This is because the device has not been assigned an IOMMU group and the Intel IOMMU at least expect the devices to be on the PCI bus and be able to find a proper bus-dev-fn number through a struct pci device. Therefore, we must revert the change and I've changed patch 2 to do this and remove the no longer necessary DMA mask adjustments.

I'm not sure if we can get past the impass in getting this series merged:
I still maintain every patch in this series is necessary to fix a regression and there's no way to add port numbers to switchtec in the crosslink configuration so it can't be fixed in the other way that was suggested.

Logan

--

Changes since v2:
- Rebased on v5.0-rc1
- Modify Patch 2 to revert back to using the PCI struct device instead of the NTB struct device in DMA calls
- Collected Allen's Acks
- Collected Alexander's Tested-By

Changes since v1:
- Rebased onto ntb-next (there was a minor conflict in a recent change to the intel driver)
- Collected Dave's Ack

--

Logan Gunthorpe (8):
NTB: ntb_tool: reading the link file should not end in a NULL byte
NTB: Revert the change to use the NTB device dev for DMA allocations
NTB: Fix the default port and peer numbers for legacy drivers
NTB: ntb_pingpong: Choose doorbells based on port number
NTB: perf: Don't require one more memory window than number of peers
NTB: perf: Fix support for hardware that doesn't have port numbers
NTB: perf: Fix race condition when run with ntb_test
NTB: ntb_test: Fix bug when counting remote files

 drivers/ntb/hw/amd/ntb_hw_amd.c         |  4 ----
 drivers/ntb/hw/idt/ntb_hw_idt.c         |  6 -----
 drivers/ntb/hw/intel/ntb_hw_gen1.c      |  4 ----
 drivers/ntb/ntb.c                       |  9 ++------
 drivers/ntb/test/ntb_perf.c             | 29 +++++++++++++++++++------
 drivers/ntb/test/ntb_pingpong.c         | 14 +++++-------
 drivers/ntb/test/ntb_tool.c             |  9 ++++----
 tools/testing/selftests/ntb/ntb_test.sh |  2 +-
 8 files changed, 35 insertions(+), 42 deletions(-)

--
2.19.0