pci_p2pdma_distance_many(9)
π pci_p2pdma_distance_many(9)
okay so bestie, welcome to the pci_p2pdma_distance_many(9) page from the Kernel API Manual β this is the one that figures out how far apart your p2pdma provider is from all its clients π«Ά like a little vibe check but for PCI topology.
β¨ NAME β¨
pci_p2pdma_distance_many β determine the cumulative distance between a p2pdma provider and the clients in use πΈ
π SYNOPSIS π
int pci_p2pdma_distance_many (struct pci_dev *provider , struct device
**clients , int num_clients , bool verbose );
π ARGUMENTS π
providerβ the p2pdma provider we're checking against the client list πclientsβ an array of devices to check, and yes it'sNULL-terminated, don't forget that part πnum_clientsβ how many clients are actually in that array, count them fr frverboseβ iftrue, it prints warnings for devices when we return-1π (helpful!! use it!!)
π¦ DESCRIPTION π¦
So here's the tea: this function returns -1 if any of the clients are not compatible, periodt. Otherwise it returns a positive number, and lower is better β that's the preferable choice. (And if there's one client that's the same as the provider it will return 0, which is literally the best choice, no cap π
)
Now what does "compatible" even mean? It means the provider and the clients are either all behind the same PCI root port, or the host bridges connected to each of the devices are listed in the 'pci_p2pdma_whitelist'. That's it, that's the whole vibe check β¨
β SEE ALSO β
Kernel file ./drivers/pci/p2pdma.c π plus all these besties:
pcim_p2pdma_init(9)pcim_p2pdma_provider(9)pci_p2pdma_add_resource(9)pci_has_p2pmem(9)pci_p2pmem_find_many(9)pci_alloc_p2pmem(9)pci_free_p2pmem(9)pci_p2pmem_virt_to_bus(9)pci_p2pmem_alloc_sgl(9)pci_p2pmem_free_sgl(9)pci_p2pmem_publish(9)pci_p2pdma_map_type(9)pci_p2pdma_enable_store(9)pci_p2pdma_enable_show(9)
π mwah, that's the page!! it lives in ./drivers/pci, it's dated October 2026, and this has been your girl signing off β go compute some distances bestie, you got this ππ§π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms