asterisk / dahdi-linux

This is the official dahdi-linux repository. All issues and PR should be raised here.
GNU General Public License v2.0
49 stars 71 forks source link

Can't compile with latest CentOS Kernel 4.18.0-490 - netif_napi_add issue #19

Open dbray925 opened 1 year ago

dbray925 commented 1 year ago

OS: CentOS Kernel: 4.18.0-490 Version: 3.2.0

Issue: /usr/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp/base.c: In function ‘wctc4xxp_net_register’: /usr/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp/base.c:697:54: error: macro "netif_napi_add" passed 4 arguments, but takes just 3 netif_napi_add(netdev, &wc->napi, &wctc4xxp_poll, 64); ^ /usr/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp/base.c:697:2: error: ‘netif_napi_add’ undeclared (first use in this function); did you mean ‘netif_napi_del’? netif_napi_add(netdev, &wc->napi, &wctc4xxp_poll, 64); ^~~~~~ netif_napi_del /usr/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp/base.c:697:2: note: each undeclared identifier is reported only once for each function it appears in At top level: /usr/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp/base.c:583:1: warning: ‘wctc4xxp_poll’ defined but not used [-Wunused-function] wctc4xxp_poll(struct napi_struct *napi, int budget) ^~~~~ make[4]: [scripts/Makefile.build:318: /usr/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp/base.o] Error 1 make[3]: [scripts/Makefile.build:558: /usr/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp] Error 2 make[2]: [Makefile:1616: module/usr/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi] Error 2 make[2]: Leaving directory '/usr/src/kernels/4.18.0-490.el8.x86_64' make[1]: [Makefile:74: modules] Error 2 make[1]: Leaving directory '/usr/src/dahdi-linux-complete-3.2.0+3.2.0/linux' make: *** [Makefile:9: all] Error 2

dbray925 commented 1 year ago

Work around is to install older kernel:

sudo dnf install -y kernel-4.18.0-408.el8.x86_64.rpm kernel-devel-4.18.0-448.el8.x86_64 kernel-headers-4.18.0-448.el8.x86_64 sudo reboot

sudo dnf -y remove kernel-tools-4.18.0-490.el8.x86_64 kernel-modules-4.18.0-490.el8.x86_64 kernel-tools-libs-4.18.0-490.el8.x86_64 kernel-4.18.0-490.el8.x86_64 kernel-core-4.18.0-490.el8.x86_64 kernel-devel-4.18.0-490.el8.x86_64

sudo vim /etc/dnf/dnf.conf exclude=asterisk kernel*

InterLinked1 commented 1 year ago

netif_napi_add

Thanks for reporting this. DAHDI is currently broken on newer kernels due to Sangoma's incompetence at maintaining it. I suggest you file a complaint with Sangoma sales and technical support about this. You're not going to get any official help here.

You could also try installing DAHDI using PhreakScript[1], which has a ton of compiler fixes that don't exist upstream. I'm not sure if this one is present though yet; if not, we'll try to get that fixed.

[1] https://github.com/InterLinked1/phreakscript

laf0rge commented 1 year ago

You also might want to give https://gitea.osmocom.org/retronetworking/dahdi-linux a try. It is known (and continuously verified to build against) kernel v4.19. As your target (v4.18) is not far from it, so you might be lucky.

InterLinked1 commented 1 year ago

@push143smart This issue was resolved by merge of a759a578277bde98eba7ef4bf86bdf819a900de9 and can be closed

wadester commented 1 year ago

a759a57 seems to only fix for version 6 kernels, not 4.18.0-xxx on RHEL 8.8/AlmaLinux/RockyLinux. Add #define netif_napi_add netif_napi_add_weight to kernel.h without the ifdef.

InterLinked1 commented 1 month ago

a759a57 seems to only fix for version 6 kernels, not 4.18.0-xxx on RHEL 8.8/AlmaLinux/RockyLinux. Add #define netif_napi_add netif_napi_add_weight to kernel.h without the ifdef.

@wadester I think for RHEL it was finally addressed in https://github.com/asterisk/dahdi-linux/commit/08fda500eda8893fddb269e07e3b1eaafd0a684b, in which case this issue is fully addressed and can be closed.