* user-to-kernel shared memory with net_device
@ 2009-10-19 21:28 Chris Ross
2009-10-20 6:47 ` Rémi Denis-Courmont
0 siblings, 1 reply; 2+ messages in thread
From: Chris Ross @ 2009-10-19 21:28 UTC (permalink / raw)
To: netdev
I have a net_device driver that has a fairly large (1-2MB) set of
stats that a user space process needs to read from time to time. I had
assumed the optimal ipc mechanism would be shared memory. Now that I'm
getting around to implementation of this side of the project I'm
getting a bit stuck.
All of the mmap examples I can find seem to be for character devices.
Do I need a character device that implements mmap and proxies access
to the net_device's stats, or is there a way to mmap directly to a
net_device structure? Also, is this the excepted method when a
userspace process needs to read large tables from a driver?
thanks,
-chris
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: user-to-kernel shared memory with net_device
2009-10-19 21:28 user-to-kernel shared memory with net_device Chris Ross
@ 2009-10-20 6:47 ` Rémi Denis-Courmont
0 siblings, 0 replies; 2+ messages in thread
From: Rémi Denis-Courmont @ 2009-10-20 6:47 UTC (permalink / raw)
To: Chris Ross; +Cc: netdev
On Mon, 19 Oct 2009 16:28:42 -0500, Chris Ross <chris@compilednetworks.com>
wrote:
> All of the mmap examples I can find seem to be for character devices.
> Do I need a character device that implements mmap and proxies access
> to the net_device's stats, or is there a way to mmap directly to a
> net_device structure? Also, is this the excepted method when a
> userspace process needs to read large tables from a driver?
You cannot use mmap() directly on a network device as there are no file
descriptors to network devices. In principle, you can still initiate a
memory mapping using a network device ioctl(), but this is probably not
such a great idea.
--
Rémi Denis-Courmont
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-20 6:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-19 21:28 user-to-kernel shared memory with net_device Chris Ross
2009-10-20 6:47 ` Rémi Denis-Courmont
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox