Skip to content
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

build fails on Oracle Linux 9.4: error: implicit declaration of function ‘napi_reschedule’ #62

Open
danielnorberg opened this issue Oct 2, 2024 · 5 comments

Comments

@danielnorberg
Copy link

$ sudo rpm -i gve-1.4.3-1dkms.noarch.rpm
Loading new gve-1.4.3 DKMS files...
Deprecated feature: REMAKE_INITRD (/usr/src/gve-1.4.3/dkms.conf)
Building for 5.15.0-300.163.18.el9uek.x86_64 5.14.0-427.35.1.el9_4.cloud.1.0.x86_64
Building initial module for 5.15.0-300.163.18.el9uek.x86_64
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gve/1.4.3/source/dkms.conf)
Error! Bad return status for module build on kernel: 5.15.0-300.163.18.el9uek.x86_64 (x86_64)
Consult /var/lib/dkms/gve/1.4.3/build/make.log for more information.
warning: %post(gve-1.4.3-1dkms.noarch) scriptlet failed, exit status 10
$ cat /var/lib/dkms/gve/1.4.3/build/make.log
DKMS make.log for gve-1.4.3 for kernel 5.15.0-300.163.18.el9uek.x86_64 (x86_64)
Wed Oct  2 08:30:04 AM UTC 2024
make -C /lib/modules/5.15.0-300.163.18.el9uek.x86_64/build M=$PWD
make[1]: Entering directory '/usr/src/kernels/5.15.0-300.163.18.el9uek.x86_64'
  CC [M]  /var/lib/dkms/gve/1.4.3/build/gve_main.o
  CC [M]  /var/lib/dkms/gve/1.4.3/build/gve_tx.o
  CC [M]  /var/lib/dkms/gve/1.4.3/build/gve_tx_dqo.o
  CC [M]  /var/lib/dkms/gve/1.4.3/build/gve_rx.o
/var/lib/dkms/gve/1.4.3/build/gve_main.c: In function ‘gve_napi_poll’:
/var/lib/dkms/gve/1.4.3/build/gve_main.c:435:43: error: implicit declaration of function ‘napi_reschedule’; did you mean ‘napi_schedule’? [-Werror=implicit-function-declaration]
  435 |                         if (reschedule && napi_reschedule(napi))
      |                                           ^~~~~~~~~~~~~~~
      |                                           napi_schedule
  CC [M]  /var/lib/dkms/gve/1.4.3/build/gve_rx_dqo.o
  CC [M]  /var/lib/dkms/gve/1.4.3/build/gve_ethtool.o
  CC [M]  /var/lib/dkms/gve/1.4.3/build/gve_adminq.o
cc1: all warnings being treated as errors
make[2]: *** [scripts/Makefile.build:288: /var/lib/dkms/gve/1.4.3/build/gve_main.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1987: /var/lib/dkms/gve/1.4.3/build] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.15.0-300.163.18.el9uek.x86_64'
make: *** [Makefile:20: default] Error 2
@danielnorberg
Copy link
Author

danielnorberg commented Oct 2, 2024

Getting the same build error if building from the release tarball.

Changing napi_reschedule to napi_schedule (as per https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/#25535046) fixes the tarball build.

@danielnorberg
Copy link
Author

Ah but napi_schedule should already be used as RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,4).

$ cat /usr/include/linux/version.h
#define LINUX_VERSION_CODE 331264
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
#define LINUX_VERSION_MAJOR 5
#define LINUX_VERSION_PATCHLEVEL 14
#define LINUX_VERSION_SUBLEVEL 0
#define RHEL_MAJOR 9
#define RHEL_MINOR 4
#define RHEL_RELEASE_VERSION(a,b) (((a) << 8) + (b))
#define RHEL_RELEASE_CODE 2308
#define RHEL_RELEASE "427.35.1"

@danielnorberg danielnorberg changed the title dkms rpm fails to install on Oracle Linux 9.4: error: implicit declaration of function ‘napi_reschedule’ build fails on Oracle Linux 9.4: error: implicit declaration of function ‘napi_reschedule’ Oct 3, 2024
@danielnorberg
Copy link
Author

We ended up applying this patch to make it build on OL 9.4. The resulting module seems to work.

🙈

diff -Naru a/build/gve_ethtool.c b/build/gve_ethtool.c
--- a/build/gve_ethtool.c	2024-08-28 22:10:09.000000000 +0000
+++ b/build/gve_ethtool.c	2024-10-02 10:27:44.826795990 +0000
@@ -555,11 +555,6 @@

 static void gve_get_ringparam(struct net_device *netdev,
 			      struct ethtool_ringparam *cmd
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 7)
-			      ,
-			      struct kernel_ethtool_ringparam *kernel_cmd,
-			      struct netlink_ext_ack *extack
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 7) */
 			      )
 {
 	struct gve_priv *priv = netdev_priv(netdev);
@@ -628,11 +623,6 @@

 static int gve_set_ringparam(struct net_device *netdev,
 			     struct ethtool_ringparam *cmd
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 7)
-			     ,
-			     struct kernel_ethtool_ringparam *kernel_cmd,
-			     struct netlink_ext_ack *extack
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 7) */
 			     )
 {
 	struct gve_priv *priv = netdev_priv(netdev);
diff -Naru a/build/gve_linux_version.h b/build/gve_linux_version.h
--- a/build/gve_linux_version.h	2024-08-28 22:10:09.000000000 +0000
+++ b/build/gve_linux_version.h	2024-10-02 10:27:31.110280426 +0000
@@ -9,7 +9,7 @@

 #ifndef LINUX_VERSION_CODE
 #include "gve_linux_version.h"
-#include <linux/version.h>
+#include "/usr/include/linux/version.h"
 #else
 #define KERNEL_VERSION(a,b,c) ((((a) << 16) + (b) << 8) + (c))
 #endif
diff -Naru a/build/gve_main.c b/build/gve_main.c
--- a/build/gve_main.c	2024-08-28 22:10:09.000000000 +0000
+++ b/build/gve_main.c	2024-10-02 10:27:39.370193084 +0000
@@ -21,7 +21,6 @@
 #include <linux/timer.h>
 #include <linux/workqueue.h>
 #include <linux/utsname.h>
-#include <linux/version.h>
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0))
 #include <net/netdev_queues.h>
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)) */
diff -Naru a/build/gve_utils.c b/build/gve_utils.c
--- a/build/gve_utils.c	2024-08-28 22:10:09.000000000 +0000
+++ b/build/gve_utils.c	2024-10-02 10:27:49.301290392 +0000
@@ -114,11 +114,7 @@
 {
 	struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx];

-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,2) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8,8) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(9,0))
-	netif_napi_add(priv->dev, &block->napi, gve_poll);
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,2) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8,8) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(9,0)) */
 	netif_napi_add(priv->dev, &block->napi, gve_poll, NAPI_POLL_WEIGHT);
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,2) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8,8) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(9,0)) */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
 	napi_hash_add(&block->napi);
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) */

@ziweixiao
Copy link
Collaborator

Hi, is the issue getting resolved? I tried to install the v1.4.3 driver rpm package in the rhel-9 image(which is using 9.4 version too), and it works well. I wonder if there is anything different between the Oracle Linux 9.4 image with the rhel-9 image. Also we support to compile the GVE driver on all the supported images in GCP but looks like this Oracle Linux 9.4 image is not part of it?

$ sudo rpm -i gve-1.4.3-1dkms.noarch.rpm 
Loading new gve-1.4.3 DKMS files...
Deprecated feature: REMAKE_INITRD (/usr/src/gve-1.4.3/dkms.conf)
Building for 5.14.0-427.33.1.el9_4.x86_64 5.14.0-427.37.1.el9_4.x86_64
Module build for kernel 5.14.0-427.33.1.el9_4.x86_64 was skipped since the
kernel headers for this kernel do not seem to be installed.
Building initial module for 5.14.0-427.37.1.el9_4.x86_64
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gve/1.4.3/source/dkms.conf)
Done.
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gve/1.4.3/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gve/1.4.3/source/dkms.conf)

gve.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.14.0-427.37.1.el9_4.x86_64/extra/
Adding any weak-modules
depmod....

@danielnorberg
Copy link
Author

danielnorberg commented Oct 4, 2024

The big difference with Oracle Linux is that they have a different kernel, 5.15 with some Oracle maintained patches. https://github.com/oracle/linux-uek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants