lkml.org 
[lkml]   [2009]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Subjectfinding kernel virtual addr from physical addr of a user buffer
From
Hi all,

I want to see/monitor/check/read the data of a user buffer. The idea
is like this :-

There is a network card which is sending/receiving the data. Many
applications are using that card.
Sometimes i am getting an application level error saying received data
is corrupt. I want to see/print send and receive buffer.
Having application level changes for printing is out of scope as there
can be multiple applications running simultaneous.

We have modified our card's firmware so that it will dump the Physical
addresses of user buffers which are sent or received.
After reading the dumped PA, we will pass a single PA to a driver
through sysfs file. Then we will cat the sysfs file which should show
the one page buffer contents corresponding to passed PA.

For this to work, the driver has to have access to the PA. First, i am
finding page frame no. (pfn) by right-shifting PA. Then kmap() is
called using pfn_to_page().
This will give kernel virtual address which can be used to print/show
data during "cat sysfs file" command.

1) Whether the above mentioned steps are correct ? Kindly comment.

2) In the driver store() function, i have modified the contents by
using kernel virtual address. But sometimes i am not able to see the
modified contents at user level.
Kindly suggest what can be the problem ?

3) Kindly suggest any other way to see/check user buffer contents when
PA is available ?

Thanking you,
Yogeshwar


\
 
 \ /
  Last update: 2009-11-30 11:45    [W:0.031 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site