LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 11-27-2006, 03:57 AM   #1
Siva4Linux
Member
 
Registered: Sep 2006
Posts: 31
Blog Entries: 1

Rep: Reputation: 15
Communication between the Kernel- and User-Space


Dear All,

For my WiFi-based wireless networking experiments, I need to transfer some information such as the RSSI (Received Signal Strength Indicator) and MAC-level performance statistics from the Kernel- to the User-space as often as one node receives a packet from another. I can get the information that I need to transfer from my WiFi card driver module. Would you please let me know whether I need to use netlink sockets OR any other better mechanism to facilitate the communication from Kernel --> User space. Is there any tradeoff between how often I tranmit such information and the overall efficiency of the network card's performance. Do you think whether I need to write a separate kernel server module, which often communicates with a user-space client.

Please shed some light as much as you can.

Thanks in advance for taking your invaluable time to answer my question.

Best Regards,

Siva
 
Old 11-28-2006, 10:24 PM   #2
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,354

Rep: Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105
Don't whack the dispatcher. Don't force unnecessary overhead to occur with every packet or you will never get anything done.

Provide kernel-side code that will capture and accumulate the statistics, then provide a mechanism (i.e. a /proc pseudo-device) that allows those statistics to be read. Any user-side process can then read these statistics, say once per second, to get the answers that it needs.
 
Old 11-29-2006, 09:18 AM   #3
Siva4Linux
Member
 
Registered: Sep 2006
Posts: 31
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Then, what about sysfs/relayfs ? Are these APIs more efficients than the netlink ?
 
Old 11-30-2006, 03:54 PM   #4
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,354

Rep: Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105
I think that /proc would be the most appropriate place to put this. No, there's no difference which pseudo-directory you use.

Put it in an expected, reasonable place. Such as /proc/net/stat.

It should be done very simply. Perhaps a subfolder with individually named values. There are plenty of existing examples of that in the kernel now. If you, say, want to provide also the means to reset counters, perhaps a reset pseudo-file which resets the counters whenever you write an '0' to it.

What you are contemplating is very similar to other statistics mechanisms that already exist in the kernel, so, whenever possible, always try to imitate them. Any design that makes it into the production source-tree has gone through a lot of peer-review and is therefore probably well worth copying. Mind you, I say all of this with all due respect.

Last edited by sundialsvcs; 11-30-2006 at 03:58 PM.
 
  


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
notify user space application from the kernel space lordofring Linux - Software 2 06-22-2009 12:32 PM
kernel and user mode communication yhus Linux - Kernel 5 06-03-2006 10:00 AM
Sending packet from Kernel to User Space kaustubh_pict Linux - Networking 0 03-06-2006 07:52 AM
User/Kernel Space Comms under Redhat 9.0 snigglyfox Programming 3 09-07-2004 05:24 AM
User Space - Kernel Space basu_arani Programming 3 05-25-2004 11:46 AM


All times are GMT -5. The time now is 09:09 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration