Network connection is going down after some packet is received in rx_handler
Linux - NetworkingThis 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.
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.
Network connection is going down after some packet is received in rx_handler
Hi,
I am using one VM. Here I have written one simple module (actually for L2 forwarding but for time being for testing purpose to check is the all packets are reeving in the handler or not )which will steal the packet.
unregister_device_handler();
printk(KERN_INFO "sagar : Cleaning up module....\n");
}
============PROBLEM=======================
I am running tail -f /var/log/syslog to check the log
So the problem I am facing is After inserting the module after receiving some initial packet(8-9 packet) the VM is going down mean the network connection is going down.But there is no Crash have seen from the /var/log/syslog
========Below is the log============
Aug 27 19:55:01 ctuser-virtual-machine CRON[5184]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Aug 27 19:58:29 ctuser-virtual-machine systemd[1]: Started Session 372 of user ctuser.
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512109] driver_skel: loading out-of-tree module taints kernel.
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512166] driver_skel: module verification failed: signature and/or required key missing - tainting kernel
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512502] DEVICE:ens160 is registered
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512503] DEV INDEX:2 is registered
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512503] In register_device_handler DEV:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512506] sagar : Module insertion completed successfully!
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.531822] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.531823] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.555102] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.555107] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.614526] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.614530] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.651453] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.651457] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.670905] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.670909] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.690207] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.690212] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.709182] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.709187] DEVICE:ens160
What may be the problem!!Please help me here.
Thanks!!
Last edited by SAGARSINGHA; 08-27-2017 at 11:33 AM.
Hi,
I am using one VM. Here I have written one simple module (actually for L2 forwarding but for time being for testing purpose to check is the all packets are reeving in the handler or not )which will steal the packet. The code is as below:
============PROBLEM=======================
I am running tail -f /var/log/syslog to check the log
So the problem I am facing is After inserting the module after receiving some initial packet(8-9 packet) the VM is going down mean the network connection is going down.But there is no Crash have seen from the /var/log/syslog
========Below is the log============
Code:
Aug 27 19:55:01 ctuser-virtual-machine CRON[5184]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Aug 27 19:58:29 ctuser-virtual-machine systemd[1]: Started Session 372 of user ctuser.
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512109] driver_skel: loading out-of-tree module taints kernel.
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512166] driver_skel: module verification failed: signature and/or required key missing - tainting kernel
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512502] DEVICE:ens160 is registered
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512503] DEV INDEX:2 is registered
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512503] In register_device_handler DEV:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.512506] sagar : Module insertion completed successfully!
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.531822] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.531823] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.555102] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.555107] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.614526] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.614530] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.651453] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.651457] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.670905] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.670909] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.690207] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.690212] DEVICE:ens160
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.709182] In sagar_rx_handler
Aug 27 20:02:29 ctuser-virtual-machine kernel: [181579.709187] DEVICE:ens160
What may be the problem!!Please help me here.
Please use CODE tags when posting such things...very hard to read otherwise. And based on what you posted, it's impossible to tell...you don't tell us what version/distro of Linux you're using, but your syslog shows that your module got inserted. Past that...all we can tell you is that you have a problem in your code.
Are you asking us to debug your kernel module that you wrote, for you?
Please use CODE tags when posting such things...very hard to read otherwise. And based on what you posted, it's impossible to tell...you don't tell us what version/distro of Linux you're using, but your syslog shows that your module got inserted. Past that...all we can tell you is that you have a problem in your code.
Are you asking us to debug your kernel module that you wrote, for you?
Thanks for your response!!
I am using UBUNTU16.04 of linux.
I am not able to find out the mistake I have done in code.
Simply I have register one packet handler through netdev_rx_handler_register in register_device_handler() function with a specific interface.
Thanks for your response!!
I am using UBUNTU16.04 of linux. I am not able to find out the mistake I have done in code. Simply I have register one packet handler through netdev_rx_handler_register in register_device_handler() function with a specific interface.
Please cheeck once the Code!!!
We understand what you want...but we are not going to debug your code for you.
We understand what you want...but we are not going to debug your code for you.
Thats fine!!
I am able to receive the packet. The next thing when I am forwarding I am facing problem.
And regarding Code understanding you replied in other thread,I am have only written The code. I just want to know the other approach like DPDK or ODP type of things.
If you dont want to help thats fine!I will do it my self!!
Thats fine!!
I am able to receive the packet. The next thing when I am forwarding I am facing problem.
Ok...so since you wrote this code, what did you base it on? What debugging efforts have you done/tried??? Because all you've done here is post your code, and essentially ask us to debug it for you.
Quote:
And regarding Code understanding you replied in other thread,I am have only written The code. I just want to know the other approach like DPDK or ODP type of things. If you dont want to help thats fine!I will do it my self!!
We are happy to help...but we aren't going to write code for you, or debug code that you've written. If you're stuck, then show us your efforts and we will be happy to assist. And you need to read the "Question Guidelines" link in my posting signature...doing basic research first before posting should be the first thing you do. Putting "l2 forwarding c code" into Google pulls up many examples, with code and explanations. The first two: http://dpdk.org/doc/guides/sample_ap...l_virtual.html http://dpdk.readthedocs.io/en/v17.02...rward_cat.html
Ok...so since you wrote this code, what did you base it on? What debugging efforts have you done/tried??? Because all you've done here is post your code, and essentially ask us to debug it for you.
We are happy to help...but we aren't going to write code for you, or debug code that you've written. If you're stuck, then show us your efforts and we will be happy to assist. And you need to read the "Question Guidelines" link in my posting signature...doing basic research first before posting should be the first thing you do. Putting "l2 forwarding c code" into Google pulls up many examples, with code and explanations. The first two: http://dpdk.org/doc/guides/sample_ap...l_virtual.html http://dpdk.readthedocs.io/en/v17.02...rward_cat.html
I am not telling debug. Just want to know if this is any known issue for anyone.I have resolved the problem. The problem was the return value from rx_handler.Instead of RX_HANDLER_CONSUMED I have t return RX_HANDLER_PASS.
And about the code, I have already mentioned at initial phase only.Please find in below---
1.It is simply one packet handler I have registered with the help of netdev_rx_handler_register with a specific interface.
2.I am stealing packet from that interface.
3.Now I have forward the same packet (sk_buff) to the another interface.
4.So I am changing the "dev" member of sk_buf with the output interface.It is not crashing but after some time the system is going down. No packet is coming.have checked in /var/log/syslog
I am not telling debug. Just want to know if this is any known issue for anyone.
How would anyone else, anywhere, have a 'known issue' with code that YOU wrote for testing something?
Quote:
I have resolved the problem. The problem was the return value from rx_handler.Instead of RX_HANDLER_CONSUMED I have t return RX_HANDLER_PASS. And about the code, I have already mentioned at initial phase only.Please find in below---
1.It is simply one packet handler I have registered with the help of netdev_rx_handler_register with a specific interface.
2.I am stealing packet from that interface.
3.Now I have forward the same packet (sk_buff) to the another interface.
4.So I am changing the "dev" member of sk_buf with the output interface.It is not crashing but after some time the system is going down. No packet is coming.have checked in /var/log/syslog
Yes, you have repeatedly described the scenario. But again, if this is code that YOU WROTE, how is anyone else anywhere else, going to have 'known issues' with it?
Again: you wrote the code, so it's up to you to debug it.
Yes, you have repeatedly described the scenario. But again, if this is code that YOU WROTE, how is anyone else anywhere else, going to have 'known issues' with it?
Again: you wrote the code, so it's up to you to debug it.
sure. Thanks for your kind response. I have solved the problem.Thank you!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.