amzn / amzn-drivers

Official AWS drivers repository for Elastic Network Adapter (ENA) and Elastic Fabric Adapter (EFA)
456 stars 176 forks source link

[Bug]: does not compile with 6.11-rc6 (kernel_ethtool_ts_info issue) #321

Closed JonKohler closed 1 month ago

JonKohler commented 1 month ago

Preliminary Actions

Driver Type

Linux kernel driver for Elastic Network Adapter (ENA)

Driver Tag/Commit

ena_linux_2.12.3

Custom Code

No

OS Platform and Distribution

Linux 6.11-rc6 (431c1646e1f8) - https://github.com/torvalds/linux/tree/v6.11-rc6

Bug description

ENA out of tree driver 2.12.3 does not compile with latest mainline, 6.11-rc6

Note: This is slightly different than https://github.com/amzn/amzn-drivers/issues/313 (which I also hit).

This breakage appears to be from https://github.com/torvalds/linux/commit/2111375b85ad173d58e7b8604246a3de60950ac8 and series https://lore.kernel.org/all/20240709-feature_ptp_netnext-v17-0-b5317f50df2a@bootlin.com/

Reproduction steps

1. Pull latest rc tag from Linux tree (https://github.com/torvalds/linux/tree/v6.11-rc6)
2. Try to compile with 2.12.3
3. Watch it go kaboom with wanton abandon

Expected Behavior

It compiles

Actual Behavior

It does not compile

Additional Data

Using mockbuild environment with el8 based userspace, and distro compiler (GCC 8.5 distro managed)

Relevant log output

[ena] + cd amzn-drivers-ena_linux_2.12.3
[ena] + ./kernel/linux/ena/configure.sh --kernel-dir /usr/src/kernels/6.11.0-11.0s999c999.dirtyr5.el8.x86_64
[ena] Trying to intercept CC arguments
[ena] Detected compiler:  gcc
[ena] Managed to intercept CC arguments
[ena] ### Detection of the available kernel API ###
[ena] ### Detection completed ###
[ena] ++ pwd
[ena] + make -j96 -C /usr/src/kernels/6.11.0-11.0s999c999.dirtyr5.el8.x86_64 M=/builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena CONFIG_ENA=m modules
[ena] make: Entering directory '/usr/src/kernels/6.11.0-11.0s999c999.dirtyr5.el8.x86_64'
[ena]   CC [M]  /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/ena_netdev.o
[ena]   CC [M]  /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/ena_ethtool.o
[ena]   CC [M]  /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/ena_lpc.o
[ena]   CC [M]  /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/ena_phc.o
[ena]   CC [M]  /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/ena_xdp.o
[ena]   CC [M]  /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/dim.o
[ena]   CC [M]  /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/net_dim.o
[ena]   CC [M]  /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/../common/ena_com//ena_com.o
[ena]   CC [M]  /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/../common/ena_com//ena_eth_com.o
[ena]   CC [M]  /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/ena_sysfs.o
[ena] /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/ena_ethtool.c:1439:18: error: initialization of 'int (*)(struct net_device *, struct kernel_ethtool_ts_info *)' from incompatible pointer type 'int (*)(struct net_device *, struct ethtool_ts_info *)' [-Werror=incompatible-pointer-types]
[ena]   .get_ts_info  = ena_get_ts_info,
[ena]                   ^~~~~~~~~~~~~~~
[ena] compilation terminated due to -Wfatal-errors.
[ena] cc1: all warnings being treated as errors
[ena] make[2]: *** [scripts/Makefile.build:244: /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/ena_ethtool.o] Error 1
[ena] make[2]: *** Waiting for unfinished jobs....
[ena] /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/ena_xdp.c: In function 'ena_xdp_rx_skb_zc':
[ena] /builddir/build/BUILD/amzn-drivers-ena_linux_2.12.3/kernel/linux/ena/ena_xdp.c:749:8: error: implicit declaration of function '__napi_alloc_skb'; did you mean 'napi_alloc_skb'? [-Werror=implicit-function-declaration]
[ena]   skb = __napi_alloc_skb(rx_ring->napi,
[ena]         ^~~~~~~~~~~~~~~~
[ena]         napi_alloc_skb
[ena] compilation terminated due to -Wfatal-errors.
[ena] cc1: all warnings being treated as errors

Contact Details

jon@nutanix.com

davidarinzon commented 1 month ago

Hi @JonKohler

Thanks for reporting the issue. We are aware of this failure and it will be fixed in one of the upcoming releases. Let us know if you would like to have a temporary patch for this in the meanwhile.

JonKohler commented 1 month ago

Thanks! @davidarinzon I wouldn't turn down a temp patch just to unblock a larger qual effort, to get some early smoke testing done on mainline for the larger platform this particular kernel will service.

JonKohler commented 1 month ago

This was fixed in 2.13.0 with commit https://github.com/amzn/amzn-drivers/commit/ecc94583fd8d59f6393ac3866e4f039d59fea4e9, and I was able to successfully compile against 6.11.0-rc6