-
Notifications
You must be signed in to change notification settings - Fork 176
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
[Bug]: ptp_clock_info in ena 2.13 is missing .adjfine #322
Comments
Thank you for raising this issue, @gemorin We will resolve it in the next driver release. |
Commit [1] introduced the adjfine() hook for PTP clocks. Patchset [2] represents a transition from the adjfreq() hook to the adjfine() hook, which included a conversion of all the drivers adjfreq() to adjfine(). As a result, in pathset [2], there's an implicit assumption that all drivers implement adjfine(), without a check of whether the hook has been added. However, our driver doesn't implement adjfine(), and PHC wasn't part of the kernel during the above mentioned effort, leaving this support missing. This results in an assertion error, which was reported in [3]. This commit adds the adjfine() hook. [1]: torvalds/linux@d8d2635 [2]: https://lore.kernel.org/netdev/[email protected]/ [3]: #322 Signed-off-by: David Arinzon <[email protected]>
Hi @gemorin The issue has been resolved in https://github.com/amzn/amzn-drivers/releases/tag/ena_linux_2.13.1 |
|
Thanks for raising this, can you please share more information? Which distribution are you using? |
I'm on Rocky Linux 5.14.0-503.15.1.el9_5.x86_64 make -C /lib/modules/5.14.0-503.15.1.el9_5.x86_64/build M=/usr/src/amzn-drivers-2.13.1/kernel/linux/ena modules
make[1]: Entering directory '/usr/src/kernels/5.14.0-503.15.1.el9_5.x86_64'
CC [M] /usr/src/amzn-drivers-2.13.1/kernel/linux/ena/ena_netdev.o
CC [M] /usr/src/amzn-drivers-2.13.1/kernel/linux/ena/ena_ethtool.o
CC [M] /usr/src/amzn-drivers-2.13.1/kernel/linux/ena/ena_lpc.o
CC [M] /usr/src/amzn-drivers-2.13.1/kernel/linux/ena/ena_phc.o
/usr/src/amzn-drivers-2.13.1/kernel/linux/ena/ena_phc.c:121:10: error: ‘struct ptp_clock_info’ has no member named ‘adjfreq’
121 | .adjfreq = ena_phc_adjfreq,
| ^~~~~~~
compilation terminated due to -Wfatal-errors.
make[2]: *** [scripts/Makefile.build:249: /usr/src/amzn-drivers-2.13.1/kernel/linux/ena/ena_phc.o] Error 1
make[1]: *** [Makefile:1944: /usr/src/amzn-drivers-2.13.1/kernel/linux/ena] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.14.0-503.15.1.el9_5.x86_64'
make: *** [Makefile:98: ena.ko] Error 2 grep -ri adjfreq
ena_phc.c:#ifdef ENA_PHC_SUPPORT_ADJFREQ
ena_phc.c:static int ena_phc_adjfreq(struct ptp_clock_info *clock_info, s32 ppb)
ena_phc.c:#endif /* ENA_PHC_SUPPORT_ADJFREQ */
ena_phc.c:#ifdef ENA_PHC_SUPPORT_ADJFREQ
ena_phc.c: .adjfreq = ena_phc_adjfreq,
ena_phc.c:#endif /* ENA_PHC_SUPPORT_ADJFREQ */
kcompat.h:#define ENA_PHC_SUPPORT_ADJFREQ
kcompat.h:#endif /* ENA_PHC_SUPPORT_ADJFREQ */ |
Thank you for raising this @Ichimikichiki Please accept this temporary patch and let us know if it resolves the issue for you. 0001-linux-ena-Patch-Resolve-compilation-issue-with-adjfr.patch |
Ah legend! Thanks yeah that's resolved it. Thanks for your fast response! |
Preliminary Actions
Driver Type
Linux kernel driver for Elastic Network Adapter (ENA)
Driver Tag/Commit
ena 2.13.0
Custom Code
No
OS Platform and Distribution
Linux 6.2+ with ena.phc_enable=1
Bug description
Starting from Linux 6.2 (commit 75ab70ec5cef),
.adjfine
(introduced in 4.10) is required instruct ptp_clock_info
and will trigger a NULL pointer dereference in (at least)ptp_clock_adjtime()
testing this change:
Reproduction steps
Expected Behavior
not crash
Actual Behavior
crash :-)
Additional Data
No response
Relevant log output
Contact Details
[email protected]
The text was updated successfully, but these errors were encountered: