Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-03-2020, 06:15 AM
|
#1
|
LQ Newbie
Registered: Apr 2020
Posts: 5
Rep: 
|
Measurement of actual pcie rate
Hi all.
I want to determine the pcie data transfer speed.
For definition of ns which will be used to calculate the pcie rate, I do so:
Code:
tStart = ktime_get_real();
memcpy(probPriv->memFromBar,dataToBar,1024 );
tStop = ktime_get_real();
tRes = ktime_to_ns(ktime_sub(tStop,tStart));
Is it correct?
PC with Debian 10.
Xilinx Artix7 as the pcie card.
Both PC and FPGA pcie are without dma.
Rest parts of the pcie kernel driver work correctly.
Last edited by drakonof; 04-03-2020 at 06:35 AM.
|
|
|
04-03-2020, 02:01 PM
|
#2
|
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,327
|
pcie data transfer speed can be determined from the lspci command. For example:
Code:
sudo lspci -vvv -s 02:00 |grep LnkCap
LnkCap: Port #3, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s
|
|
|
04-04-2020, 09:48 AM
|
#3
|
LQ Newbie
Registered: Apr 2020
Posts: 5
Original Poster
Rep: 
|
Quote:
Originally Posted by smallpond
pcie data transfer speed can be determined from the lspci command. For example:
Code:
sudo lspci -vvv -s 02:00 |grep LnkCap
LnkCap: Port #3, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s
|
Thank you for your reply.
I am sorry for my ambiguous question. I meant that I need to know the speed rate of a data transfer at this moment and in these conditions, but not a bandwidth of my pcie.
I thought that it will be clear from code that I had attached.
|
|
|
04-04-2020, 10:10 AM
|
#4
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
yeah Like windows does when its moving files, thunar does this too, you could get there source code and seek out that information to see how they are doing it. it is open source, a great source for learning by reading others code to see how they did it.
|
|
1 members found this post helpful.
|
04-04-2020, 07:40 PM
|
#5
|
LQ Guru
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,522
|
hdparm -tT /dev/nvme0nX won't do what you want?
|
|
|
04-05-2020, 01:18 AM
|
#6
|
LQ Newbie
Registered: Apr 2020
Posts: 5
Original Poster
Rep: 
|
Quote:
Originally Posted by BW-userx
yeah Like windows does when its moving files, thunar does this too, you could get there source code and seek out that information to see how they are doing it. it is open source, a great source for learning by reading others code to see how they did it.
|
Thank you. I am not a professional programmer since I develop FPGA devices and unfortunately have had a lack of experience in searching of answers in any code. I think it will be fixed with time.
|
|
|
04-05-2020, 07:40 AM
|
#7
|
LQ Newbie
Registered: Apr 2020
Posts: 5
Original Poster
Rep: 
|
Quote:
Originally Posted by mrmazda
hdparm -tT /dev/nvme0nX won't do what you want?
|
Thanks, but I am writing a pcie test in the kernel space, hence I need a C code for that.
|
|
|
All times are GMT -5. The time now is 01:31 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|