mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* finding kernel virtual addr from physical addr of a user buffer
@ 2009-11-30 10:42 yogeshwar sonawane
  0 siblings, 0 replies; only message in thread
From: yogeshwar sonawane @ 2009-11-30 10:42 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-30 10:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-30 10:42 finding kernel virtual addr from physical addr of a user buffer yogeshwar sonawane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®