Metadata integrity, single segment and peer-to-peer
Hi Keith,
I'm looking on the nvme_pci_setup_meta_mptr() implementation [1] and don't see is_pci_p2pdma_page() which exists in nvme_pci_setup_data_simple() [2]. Is it intentionally? Can single segment be p2p transfer?
Thanks
[1] https://elixir.bootlin.com/linux/v6.18-rc1/source/drivers/nvme/host/pci.c#L1111
[2] https://elixir.bootlin.com/linux/v6.18-rc1/source/drivers/nvme/host/pci.c#L989
Keith Busch
maintainerQuoted 6 lines · Leon Romanovsky
Hi Keith,
I'm looking on the
nvme_pci_setup_meta_mptr()implementation [1] and don't seeis_pci_p2pdma_page()which exists innvme_pci_setup_data_simple()[2]. Is it intentionally? Can single segment be p2p transfer?
We may be calling unnecessarily dma_unmap_page in that case for mptr, but I think that still works anyway.
Quoted 10 lines · Keith Busch
Quoted 6 lines · Leon Romanovsky
Hi Keith,
I'm looking on the
nvme_pci_setup_meta_mptr()implementation [1] and don't seeis_pci_p2pdma_page()which exists innvme_pci_setup_data_simple()[2]. Is it intentionally? Can single segment be p2p transfer?We may be calling unnecessarily
dma_unmap_pagein that case for mptr, but I think that still works anyway.
How? dma_map_bvec() is actually dma_map_page_attrs() and that function doesn't handle PCI_P2PDMA_MAP_BUS_ADDR and PCI_P2PDMA_MAP_THRU_HOST_BRIDGE states.
Thanks
Keith Busch
maintainerQuoted 9 lines · Leon Romanovsky
Quoted 8 lines · Keith Busch
Quoted 6 lines · Leon Romanovsky
Hi Keith,
I'm looking on the
nvme_pci_setup_meta_mptr()implementation [1] and don't seeis_pci_p2pdma_page()which exists innvme_pci_setup_data_simple()[2]. Is it intentionally? Can single segment be p2p transfer?
Quoted 4 lines
Quoted 2 lines
We may be calling unnecessarily
dma_unmap_pagein that case for mptr, but I think that still works anyway.How?
dma_map_bvec()is actuallydma_map_page_attrs()and that function doesn't handlePCI_P2PDMA_MAP_BUS_ADDRandPCI_P2PDMA_MAP_THRU_HOST_BRIDGEstates.
Oh, I guess I'm mistaken. In that case, it wouldn't work. I'll get a patch out to just always use blk_dma_iter instead.