accessing a PCIe register from userspace through kmem or other ways ?
Luigi Rizzo
rizzo at iet.unipi.it
Fri Apr 1 11:07:57 UTC 2016
On Thu, Mar 31, 2016 at 11:55 PM, Ryan Stone <rysto32 at gmail.com> wrote:
> On Thu, Mar 31, 2016 at 4:39 PM, John Baldwin <jhb at freebsd.org> wrote:
>
>> On Wednesday, March 30, 2016 11:20:51 AM Jim Harris wrote:
>> > On Wed, Mar 30, 2016 at 10:47 AM, Luigi Rizzo <rizzo at iet.unipi.it>
>> wrote:
>> >
>> > > Hi,
>> > > I'd like to test the rate at which I can access device registers
>> > > on a PCIe card, and was wondering whether I need to patch a device
>> > > driver, or perhaps I can use /dev/kmem once I figure out where
>> > > the registers are mapped ?
>> > >
>> >
>> > You do not need to patch a device driver. Have you looked at
>> > libpciaccess? This should give you everything you need.
>>
>> You can also look at what pciconf uses. (It has a read_config() method
>> that uses an ioctl on an fd of /dev/pci).
>>
>
> pciconf can only access the configuration space, right? I believe that
> Luigi is more interested in measuring the latency to a register mapped from
> a BAR.
>
Thank you all for you answers, I will look at libpciaccess.
Yes my goal is to look at the rate and latency for accessing
BAR-mapped registers
cheers
luigi
--
-----------------------------------------+-------------------------------
Prof. Luigi RIZZO, rizzo at iet.unipi.it . Dip. di Ing. dell'Informazione
http://www.iet.unipi.it/~luigi/ . Universita` di Pisa
TEL +39-050-2217533 . via Diotisalvi 2
Mobile +39-338-6809875 . 56122 PISA (Italy)
-----------------------------------------+-------------------------------
More information about the freebsd-current
mailing list