LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-06-2019, 09:46 AM   #1
jwprice100
LQ Newbie
 
Registered: Dec 2018
Posts: 4

Rep: Reputation: Disabled
PCI Peer to Peer Testing


With the 4.20 kernel, PCI-E peer to peer support has been added. I have a device that I'm using as a p2p memory buffer. I have complete visibility into this device in case that's relevant. I'm able to create p2p memory areas and everything looks good. Unfortunately I'm not very knowledgeable of many of the lower lever details in the kernel and kernel modules. What I want to do is take my p2p memory regions and use the NVME target driver to copy data from the p2p memory onto disk. I don't really have an opinion on the interface to accomplish this, just that the peer to peer path is exercised. I've looked for examples, but haven't really found anything. I tried a couple of things myself including:

1. Using kernel file IO (ugly I know) and opening a file directly to the nvme disk itself (/dev/nvme0n1) and passing in the p2pmem buffer this way. Unfortunately this just routes everything through the page cache and the CPU copies one word at a time into the page cache and then DMAs to the disk. I'm trying to bypass system memory.

2. Same as #1 above, but Tried using O_DIRECT. Unfortunately O_DIRECT really only works on userspace memory buffers near as I can tell so no luck there.

3. Tried the NVME userspace ioctls and passing mmaped memory from the PCI-E bar. Perhaps there's a way to mmap the p2pmem buffer itself? Not sure if that question even makes sense.

Any thoughts/articles/examples would be greatly appreciated.

Thank you!

Last edited by jwprice100; 01-06-2019 at 09:50 AM.
 
Old 01-10-2019, 12:29 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,141

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Until a standard kernel API for p2pmem is added you should take a look at SPDK.

https://www.flashmemorysummit.com/En...01-1_Bates.pdf
 
Old 01-13-2019, 01:53 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I think you can do it in both Linux and SPDK...

Your P2Pmem is in a NVMe drive or it is another type of device? Do you already have a P2PMem part of the driver for it?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
acx111 PCI card, peer-to-peer, host-unrecheable zowey Linux - Wireless Networking 3 06-14-2005 10:37 AM
Secure Peer to Peer X11 Linux - Security 2 04-05-2002 06:18 AM
Linux & Windows98 in a "PEER TO PEER" 'NON-LOGIN' Network mfsjas Linux - Networking 2 01-20-2002 08:33 PM
sharing resources on a LAN w/MS-Win98 & Linux (Peer-to-Peer) mfsjas Linux - Networking 1 12-20-2001 04:58 PM
Linux on a Peer-to-Peer oostevo Linux - Networking 1 09-05-2001 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration