LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 09-18-2013, 01:13 AM   #1
lohith.nayak
LQ Newbie
 
Registered: Sep 2012
Posts: 11

Rep: Reputation: Disabled
Driver information along with the packet


I am new to Linux networking field.
I have a driver code which is called when eth packet arrives to the hardware.
After receiving it, driver information is updated and packet is given to linux network stack by calling netif_rx function.

I want to send some driver error information along with the packet to the userspace.

I have a socket to receive regular packet.
But how can I get the driver information along with the packet?

I thought of appending driver error information to the packet and send it. But I am afraid that packet flow might get in to toss. Another reason is I might overload the system looking for driver error information when there is no error.

Is there any other mechanism where I can fill some buffer with length information along with skb and receive the same in userspace using socket?


Thanks,
regards,
Lohith Nayak
 
Old 09-18-2013, 03:44 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,029

Rep: Reputation: 75
What kind of error information do you want, error or drop counter and so on?
 
Old 09-18-2013, 10:34 PM   #3
lohith.nayak
LQ Newbie
 
Registered: Sep 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
@nini09

I am doing packet analysis (IPsec SPD) and run some timers, packet counts, seq number checks.
If there are errors have to generate event through stack.
Was thinking in the skb buffer, can I reserve first 0-N-1 bytes for this and from N being skb->head starts having ethernet frame and send to network stack by calling netif_rx and receive in userspace as a RAW socket?
 
Old 09-19-2013, 02:20 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,029

Rep: Reputation: 75
ifconfig command already provide traffic statistics of interface, such as number of bytes, packets, drop and so on.
For other things, such as timer and checks, your own code can take care of it and provide an API to access it from userspace.
In general, you can't reserve first N bytes in skb to save your own information.
 
Old 09-19-2013, 11:22 PM   #5
lohith.nayak
LQ Newbie
 
Registered: Sep 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
There is an API to copy the information from driver to userspace.
But customer wants to get these information from socket application along with the packet.
Does that mean it is not possible to send driver information trough skb
 
Old 09-20-2013, 02:16 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,029

Rep: Reputation: 75
No easy way.
 
  


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
Virtual network driver packet reception j-osh Linux - Kernel 1 02-13-2010 05:08 AM
[SOLVED] very high packet loss on kernel driver, fedora 10 ShadyCraig Linux - Networking 5 07-09-2009 05:27 PM
Understanding Linux SLL cooked capture encapsulation packet information evilfish Programming 1 10-23-2008 06:04 AM
Extracting Packet Information exl75 Linux - Networking 15 04-03-2007 02:59 PM
How to find Packet driver interrupt for ethernet cards palanisaravanan Linux - Hardware 0 12-29-2003 08:25 AM


All times are GMT -5. The time now is 01:20 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