LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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


Reply
  Search this Thread
Old 04-03-2020, 06:15 AM   #1
drakonof
LQ Newbie
 
Registered: Apr 2020
Posts: 5

Rep: Reputation: Disabled
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.
 
Old 04-03-2020, 02:01 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,327

Rep: Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331Reputation: 1331
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
 
Old 04-04-2020, 09:48 AM   #3
drakonof
LQ Newbie
 
Registered: Apr 2020
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
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.
 
Old 04-04-2020, 10:10 AM   #4
BW-userx
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

Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
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.
Old 04-04-2020, 07:40 PM   #5
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,522
Blog Entries: 1

Rep: Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239
hdparm -tT /dev/nvme0nX won't do what you want?
 
Old 04-05-2020, 01:18 AM   #6
drakonof
LQ Newbie
 
Registered: Apr 2020
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
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.
 
Old 04-05-2020, 07:40 AM   #7
drakonof
LQ Newbie
 
Registered: Apr 2020
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by mrmazda View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can PCIe device driver support to read a particlualr buffer in the PCIe device with mutiple buffers? cwang_sh Linux - Hardware 3 07-02-2018 09:17 AM
LXer: Skylake-U Mini-ITX features mini-PCIe and PCIe x4 LXer Syndicated Linux News 0 08-24-2017 01:25 AM
LXer: Compact, rugged box-PC expands via PCIe and Mini-PCIe LXer Syndicated Linux News 0 02-09-2014 02:10 PM
PCIe re-enumation in linux driver question (pcie hotplug doesn't work) blavo Programming 5 08-02-2012 02:12 PM
[SOLVED] Best PCIe 2.0 graphics card for for PCIe 1.1, Pentium Dual Core system. ags1 Linux - Hardware 12 04-27-2012 03:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:31 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