LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 02:13 AM   #1
lohith.nayak
LQ Newbie
 
Registered: Sep 2012
Posts: 12

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, 04:44 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,893

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

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, 03:20 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,893

Rep: Reputation: 163Reputation: 163
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-20-2013, 12:22 AM   #5
lohith.nayak
LQ Newbie
 
Registered: Sep 2012
Posts: 12

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, 03:16 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,893

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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:35 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration