Created attachment 225085 [details] patch for the sys/dev/alc driver [alc] [PATCH] add support for Mikrotik 10/25G NIC The new Mikrotik 10/25G NIC is mostly compatible with AR8151 hardware, with few exceptions: * card supports only 32bit DMA operations * card does not support write-one-to-clear semantics for interrupt status register * MDIO operations can take longer to complete This patch adds support for Mikrotik 10/25G NIC to the alc driver while maintaining support for all earlier HW. The patch was tested with FreeBSD main branch as of commit f4b38c360e63a6e66245efedbd6c070f9c0aee55 This was tested on Intel i7-4790K system with Mikrotik 10/25G NIC. This was tested on Intel i7-4790K system with RB44Ge (AR8151 based 4-port NIC) to verify backwards compatibility.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=77b637338a3656d4ccedb9798a3f98ac283962f4 commit 77b637338a3656d4ccedb9798a3f98ac283962f4 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-05-19 22:14:18 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-05-19 22:30:25 +0000 alc(4): add support for Mikrotik 10/25G NIC The new Mikrotik 10/25G NIC is mostly compatible with AR8151 hardware, with few exceptions: * card supports only 32bit DMA operations * card does not support write-one-to-clear semantics for interrupt status register * MDIO operations can take longer to complete This patch adds support for Mikrotik 10/25G NIC to the alc driver while maintaining support for all earlier HW. The patch was tested with FreeBSD main branch as of commit f4b38c360e63a6e66245efedbd6c070f9c0aee55 This was tested on Intel i7-4790K system with Mikrotik 10/25G NIC. This was tested on Intel i7-4790K system with RB44Ge (AR8151 based 4-port NIC) to verify backwards compatibility. PR: 256000 Submitted by: Gatis Peisenieks <gatis@mikrotik.com> MFC after: 1 week sys/dev/alc/if_alc.c | 16 ++++++++++++++-- sys/dev/alc/if_alcreg.h | 8 ++++++++ sys/dev/alc/if_alcvar.h | 3 ++- 3 files changed, 24 insertions(+), 3 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=00ecc359009e345f3abc666138792abd545e90f7 commit 00ecc359009e345f3abc666138792abd545e90f7 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-05-19 22:14:18 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-05-26 11:30:36 +0000 alc(4): add support for Mikrotik 10/25G NIC PR: 256000 (cherry picked from commit 77b637338a3656d4ccedb9798a3f98ac283962f4) sys/dev/alc/if_alc.c | 16 ++++++++++++++-- sys/dev/alc/if_alcreg.h | 8 ++++++++ sys/dev/alc/if_alcvar.h | 3 ++- 3 files changed, 24 insertions(+), 3 deletions(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=fcb09b40339d10b06e11863096bcc6d2576e807f commit fcb09b40339d10b06e11863096bcc6d2576e807f Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-05-19 22:14:18 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-05-26 12:06:35 +0000 alc(4): add support for Mikrotik 10/25G NIC PR: 256000 (cherry picked from commit 77b637338a3656d4ccedb9798a3f98ac283962f4) sys/dev/alc/if_alc.c | 16 ++++++++++++++-- sys/dev/alc/if_alcreg.h | 8 ++++++++ sys/dev/alc/if_alcvar.h | 3 ++- 3 files changed, 24 insertions(+), 3 deletions(-)
Just tried the card (running RouterOS v7.15.1) in FreeBSD 14.1/amd64. It gets detected as four if_alc(4) interfaces alc[0-3]. The moment I run `ifconfig alc0 up` one kernel thread spins at 100% CPU load and doesn't even stop spinning after detaching the driver from alc[0-3] with devctl.
Same issue here. I've tried with Opnsense 24.7.8 (FreeBSD 14.1-RELEASE-p6) and it act in a same way as crest@rlwinm.de reported.
I still have the card collecting dust and could put it into a physical lab machine. I suspect there is a difference between real AR8151 chips and what MikroTik implemented when it comes to clearing status registers. Do you happen to have a AR8151 based card to compare the device state?