Page MenuHomeFreeBSD

LinuxKPI: Creating crc16.h for amdkfd support
Needs ReviewPublic

Authored by siri_racha.ca on Sat, Oct 3, 8:46 AM.
Referenced Files
F174581329: D60275.id188520.diff
Sun, Oct 4, 9:32 AM
F174566221: D60275.diff
Sun, Oct 4, 5:44 AM
F174547044: D60275.id188520.diff
Sun, Oct 4, 2:12 AM
F174541642: D60275.diff
Sun, Oct 4, 1:20 AM
Subscribers

Details

Reviewers
None
Group Reviewers
linuxkpi
Summary

Created & implemented crc16.h, there are some new functions which I could not
find already implemented in the FreeBSD base system

Test Plan

Ran a build test with no issues.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Created & implemented crc16.h, there are some new functions which I could not find already implemented in the FreeBSD base system

crc16() is implemented in sys/crc16.h
crc16_byte() is not used in drm-kmod and has been removed from Linux after v6.15

It looks all that`s needed is to change crc16() len parameter type from unsigned int to size_t in sys/sys/crc16.h and add #include <sys/crc16.h> line to linux/crc16.h

Created & implemented crc16.h, there are some new functions which I could not find already implemented in the FreeBSD base system

crc16() is implemented in sys/crc16.h
crc16_byte() is not used in drm-kmod and has been removed from Linux after v6.15

It looks all that`s needed is to change crc16() len parameter type from unsigned int to size_t in sys/sys/crc16.h and add #include <sys/crc16.h> line to linux/crc16.h

Sounds good, I did not know it got removed in v6.15, I was only looking at v6.12. I'll make the changes on my local machine and test to make sure it still works.

It looks all that`s needed is to change crc16() len parameter type from unsigned int to size_t in sys/sys/crc16.h and add #include <sys/crc16.h> line to linux/crc16.h

I have a small concern with this, firstly we'd be changing the KBI (I think) on systems where sizeof(unsigned int) != size_t. Which changes the behaviour, but otherwise it sounds good, and seems reasonable.
I'm not fully sure if this breaks KBI given that it's a inline'd function in both cases, let me know what you think. I'll increment __FreeBSD_version if it does break KBI.

I will make the change, run a few tests on my machine to make sure my drm-kmod fork compiles & revise the patch

Sorry, thank you!

firstly we'd be changing the KBI (I think) on systems where sizeof(unsigned int) != size_t.

crc16() is static inline. It should not have KBI unless maybe exotic cases like -O0 or execution via pointer.