-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel panic on FreeBSD-CURRENT with loopback #322
Comments
It is probably unrelated to the bug, but I see from the log you are not using the latest code. Please pull the latest HEAD. |
Done, but installworld fails at the moment for me. I'll try again tomorrow. |
Here is the console output from today's -CURRENT:
|
Netmap code in HEAD is slightly behind the github master, so you should update it.
|
Are there any instructions on how to compile FreeBSD with a newer netmap from this repo? Also, are you committing the above fix to -CURRENT? |
Just copy the content of sys/dev/netmap and sys/net/netmap from the git repo to the corresponding directories in the freebsd source tree (usually /usr/src/sys/dev/netmap and /usr/src/sys/net/netmap), and recompile FreeBSD following the instructions from the manual. I'm not a FreeBSD committer, but I've informed one of the committer about this patch. I will also forward this to freebsd-net. |
Why not set a dummy if_start method instead. Saves code in the fast-path. |
Yes, I agree that would be the best choice. |
Loopback is not an ethernet interface, is netmap supposed to work with non-ethernet interfaces? |
Netmap works on any software or hardware interface, by means of the "emulated netmap adapter". |
Some interfaces may behave as ethernet device, but other doesn't. Loopback interface has not if_transmit or if_start method, frames that are passed trough loopback interface are not ethernet frames, they are not started with ether_header. So, the question is still the same, is netmap supposed to work with such mbufs? |
Yes, I agree. My point was avoiding the crash, and not about supporting loopback interface in netmap. |
For FreeBSD you can check that ifp->if_type == IFT_ETHER. |
FWIW, netmap works fine over loopback on Linux. And being able to test apps written against the netmap API over loopback is invaluable during development. I have no opinion whether netmap should support any of the other pseudo interfaces, but please don't prevent it from working over loopback. |
yet another option would be to implement a built-in netmap loopback device (e.g. "netmap:lo"), which can be implemented to be as fast as netmap pipes. |
About the crash and in this specific case I think the right fix would be add a dummy if_transmit() to avoid adding the packet to interface queue and the call to if_start(). |
The generic support in netmap send the packets using if_transmit() and the loopback do not support packets coming from if_transmit()/if_start(). This avoids the use of the loopback interface and the subsequent crash that happens when the application send packets to the loopback interface. Details in: luigirizzo/netmap#322 Reported by: Vincenzo Maffione <v.maffione@gmail.com> Sponsored by: Rubicon Communications, LLC (Netgate) git-svn-id: svn+ssh://svn.freebsd.org/base/head@321317 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The generic support in netmap send the packets using if_transmit() and the loopback do not support packets coming from if_transmit()/if_start(). This avoids the use of the loopback interface and the subsequent crash that happens when the application send packets to the loopback interface. Details in: luigirizzo/netmap#322 Reported by: Vincenzo Maffione <v.maffione@gmail.com> Sponsored by: Rubicon Communications, LLC (Netgate)
The generic support in netmap send the packets using if_transmit() and the loopback do not support packets coming from if_transmit()/if_start(). This avoids the use of the loopback interface and the subsequent crash that happens when the application send packets to the loopback interface. Details in: luigirizzo#322 Obtained from: FreeBSD
A fix was committed to FreeBSD to avoid the use of the loopback and thus, avoid the crash. |
I'm not a fan of this resolution, but so be it. For consistency, you probably also want to prevent it on Linux. |
@larseggert , why shouldn't you using a pair of pipes to achieve the same behaviour as a loopback device? If you are using two processes (e.g. one transmitting and one receiving), and so two nm_open()s, you can just open an end of a pipe in the first process and the other end in the other process. The pipe pair would basically behave as a loopback device. |
I use both - one process during unit testing, and two during other (manual) testing. In the latter case, how do I open pipes? |
For instance
and then whatever you write into pleft can be read from pright and the other way around. |
The generic support in netmap send the packets using if_transmit() and the loopback do not support packets coming from if_transmit()/if_start(). This avoids the use of the loopback interface and the subsequent crash that happens when the application send packets to the loopback interface. Details in: luigirizzo/netmap#322 Reported by: Vincenzo Maffione <v.maffione@gmail.com> Sponsored by: Rubicon Communications, LLC (Netgate) git-svn-id: svn+ssh://svn.freebsd.org/base/head@321317 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The generic support in netmap send the packets using if_transmit() and the loopback do not support packets coming from if_transmit()/if_start(). This avoids the use of the loopback interface and the subsequent crash that happens when the application send packets to the loopback interface. Details in: luigirizzo/netmap#322 Reported by: Vincenzo Maffione <v.maffione@gmail.com> Sponsored by: Rubicon Communications, LLC (Netgate) git-svn-id: https://svn.freebsd.org/base/head@321317 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The generic support in netmap send the packets using if_transmit() and the loopback do not support packets coming from if_transmit()/if_start(). This avoids the use of the loopback interface and the subsequent crash that happens when the application send packets to the loopback interface. Details in: #322 Obtained from: FreeBSD
The generic support in netmap send the packets using if_transmit() and the loopback do not support packets coming from if_transmit()/if_start(). This avoids the use of the loopback interface and the subsequent crash that happens when the application send packets to the loopback interface. Details in: luigirizzo/netmap#322 Reported by: Vincenzo Maffione <v.maffione@gmail.com> Sponsored by: Rubicon Communications, LLC (Netgate)
Trying to use netmap over loopback crashes the kernel under FreeBSD-CURRENT. Here is the console log:
The text was updated successfully, but these errors were encountered: