-
Notifications
You must be signed in to change notification settings - Fork 73
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
rtl8169: Kernel panic on FreeBSD 14 when loading if_re kernel module #131
Comments
UPD: Still happening on FreeBSD 14.1
|
Seems related https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275920 |
I just stumbled upon the same issue and reported it up stream: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284283 |
As a workaround, load the module through |
@clausecker FreeBSD guest networking stutter is likely fixed by 6093bc1, but Judging the relevant FreeBSD bug tickets, kldload crash is kernel module initialization order issue, and the fact that |
Thank you for looking into this! I did not expect an interrupt handling issue. The kernel panic is not that critical of a problem as there is an easy workaround. What is more confusing is why the driver doesn't attach automatically on boot—maybe a problem with the device tasting? |
To be fair, rtl8169 is not the only device which has a FreeBSD driver but not probed on boot automatically. RVVM has an IDE ATA controller, which is attached via |
Any reason why you went for IDE over AHCI? |
It was very long ago when RVVM didn't even have PCI, so @cerg2010cerg2010 implemented fdt-based ATA PIO over MMIO and it was the only disk controller RVVM had back then. |
Makes sense. I guess ATA on a non-x86 device is just rare and poorly supported. AHCI may work a lot better. |
I think it is a non-issue anymore now that we have NVMe. It is possible that someone contributes it, though. |
@clausecker I tried to pass my host Realtek NIC via VFIO, and FreeBSD guest still doesn't recognize the card on boot and crashes on To pass a host device, Linux + root access is needed on the host. Note that I had to use ACS override patch to overcome IOMMU limitation, which has potential to allow VM escape. rvvm ... -nonet -vfio_pci 09:00.0 <- put your host card PCI address here Boot & crash log
|
With the |
I've tested the current version with your Realtek patches, and it seems to perform better. However, something is still wrong and some times connections just won't get established at all. Perhaps there is still something missing in the emulated device. |
It might be related to |
@LekKit Please consider just using libslirp instead of hand rolling userspace networking. That library solves all the various edge cases. |
RVVM userland networking was supposed to be superior to SLIRP in terms of performance (uses epoll/kqueue, multi-queue planned), portability, and being able to work under seccomp/pledge. It is also supposed to work in Emscripten at some point. I will likely introduce SLIRP as a runtime option after some internal refactoring, but |
I welcome your desire for faster user space networking. I hope it's going to work out. Maybe it would be better to integrate this effort into the existing slirp codebase? Or at least, make it a standalone library? |
SLIRP afaik is an older version of FreeBSD networking stack, ported into userspace. RVVM
I am not sure if it's needed (At least at this point). |
Some fixes made to rtl8169 in 9d8ee02. I also added a link to piece of documentation the FreeBSD folks supposedly base their driver on. Made a very primitive network performance test with a FreeBSD 15-CURRENT guest using netcat (duh): # RX to guest - Scored >=40M (~320 Mbit) on my machine
# On host
dd if=/dev/zero bs=1M status=progress | nc -l 12345
# In guest:
nc -N [HOST IP] 12345 | dd of=/dev/null bs=1M status=progress # TX from guest - Scored >=15M (~120 Mbit) on my machine
# On host
nc -l 12345 | dd of=/dev/null bs=1M status=progress
# In guest:
dd if=/dev/zero bs=1M status=progress | nc -N [HOST IP] 12345 I have not observed any stutter or failed connections yet. Though, those results seem at least 3x worse than with a Linux guest (And even weirder that TX is so much slower), but seem okay for some basic use. It would be also nice if FreeBSD supported full RISC-V AIA (IMSIC+APLIC) as MSI-X interrupts could be used instead which are more optimal than legacy INTx too. |
Thank you for looking into this. I'll restart my builds soon and will let you know if this changed anything about the problems I had observed. |
If any networking issues still presist, please also share an image or software/script which would reliably reproduce them. It would simplify fixing this a lot. |
Steps to reproduce
root
:root
# kldload if_re
Panic backtrace
Workarounds
if_re_load="YES"
into/boot/loader.conf
and reboot instead of akldload
The text was updated successfully, but these errors were encountered: