ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language 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.
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.
i need to understand the functionality of a cavium ethernet driver. Can anybody please tell me if there any tool available (like gdb) using which i can get info of its working, like
what happens when the packet arrives ?
how it grabs/extracts a packets and sends up the stack ?
how its interfaced with the kernel ?
anyways, i have started from the base and trying to understand the code. Its been found that, in the recive routine, when the recieve routine gets the packet from NIC its checking some sort of receive error bit and (&&) a corrosponding error code. Its rejecting the packet right away if thats an error bit is set. Now at this stage even a packet sniffer is not able to show the packet as its not even entering the stack.
can any body please tell me how can i dump the packet or what is the option at my hand to see what is wrong in the received packet.
i thing i'd like to mention here is that the above problem is noticed only when the interface MTU is set < 1500 (its ethernet).
On 1500 there is not problem in recieving the packet.
Since you are looking at code running in kernel space, your options are few. Littering the driver with printk()'s dumping key information is one of them. You will be able to use dmesg to view the messages. I've done very little hacking at the kernel level, so I can't offer much more than that.
It does not seem unreasonable that if the interface is connected to a lve network, it will receive packets from other hosts that are at the 1500 byte payload size. Hard to say whether setting the MTU ends up having a direct effect on the ethernet hardware, or not. You haven't said what the problem actually is.
the actual problem is that when the interface MTU size is set to any value < 1500, the HTTP request is not getting serviced, i am not able to open any site at all. Though the ICMP still works and i can receive icmp echo-replies from the same site where my http fails(say google.com). On ethereal, i could see that the http requests are properly dispatched but no return packets from the destination. On changing the MTU size back to 1500 the issue disappears.
With value < 1500, when a http request is made i see these messuages reported by the driver:
Port 1 receive error code 2, packet dropped.
port 1 here is the interface (eth1) connected to external world.
but no such problem with ICMP.
I hope this elucidates the point to you. Please let me know if you need more input on this.
PS: Do you have any idea, if there are any kernel routines available to dump the packets at this place, just for debugging purposes.
Last edited by kapsikum; 06-06-2008 at 12:42 AM.
Reason: incorrect sentence
There are precious few places where the kernel *can* dump data. The message log facility where printk() messages go to is all I know of. Kernel mode programming & debugging isn't easy.
You could put the ethernet on a hub (not a switch), and use a second computer to sniff the traffic.
--- rod.
Do you have the documentation for the ethernet chip in question? This is the only way to know for sure what the normal behavior is. Just curious why you want to use a non-standard MTU, especially for HTTP over ethernet?
--- rod.
no , unfortunately i don't have any doc., though i tried finding it on cavium site. Its not that the MTU is specifically changed to non-standard size and that too for HTTP, but the problem is so far seen only in HTTP/HTTPS case.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.