Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-18-2013, 02:13 AM
|
#1
|
LQ Newbie
Registered: Sep 2012
Posts: 12
Rep:
|
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
|
|
|
09-18-2013, 04:44 PM
|
#2
|
Senior Member
Registered: Apr 2009
Posts: 1,893
Rep:
|
What kind of error information do you want, error or drop counter and so on?
|
|
|
09-18-2013, 11:34 PM
|
#3
|
LQ Newbie
Registered: Sep 2012
Posts: 12
Original Poster
Rep:
|
@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?
|
|
|
09-19-2013, 03:20 PM
|
#4
|
Senior Member
Registered: Apr 2009
Posts: 1,893
Rep:
|
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.
|
|
|
09-20-2013, 12:22 AM
|
#5
|
LQ Newbie
Registered: Sep 2012
Posts: 12
Original Poster
Rep:
|
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
|
|
|
09-20-2013, 03:16 PM
|
#6
|
Senior Member
Registered: Apr 2009
Posts: 1,893
Rep:
|
No easy way.
|
|
|
All times are GMT -5. The time now is 05:35 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|