Page MenuHomeFreeBSD

linuxkpi: Add support for statically-allocated kfifo
ClosedPublic

Authored by dumbbell on Jan 4 2026, 10:28 AM.
Tags
None
Referenced Files
F167547502: D54497.id169006.diff
Sat, Aug 22, 3:01 PM
F167537909: D54497.diff
Sat, Aug 22, 1:53 PM
Unknown Object (File)
Sat, Aug 15, 6:30 AM
Unknown Object (File)
Thu, Aug 13, 11:52 PM
Unknown Object (File)
Sun, Aug 9, 12:58 AM
Unknown Object (File)
Sat, Aug 8, 3:48 AM
Unknown Object (File)
Fri, Aug 7, 10:30 PM
Unknown Object (File)
Mon, Aug 3, 7:36 AM
Subscribers

Details

Summary

The main difference with the dynamically allocated version is that the structure is initialized with DECLARE_KFIFO() which takes the number of items as an additional argument compared to DECLARE_KFIFO_PTR().

The declared structure is then initialized with INIT_KFIFO() which sets all fields to 0, except total which is computed from the size of the array passed to DECLARE_KFIFO().

The amdgpu DRM driver started to used this in Linux 6.10.

This is part of the update of DRM drivers to Linux 6.10.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz added a subscriber: bz.
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/kfifo.h
42

That's nitems(), could use it if you wanted.

This revision is now accepted and ready to land.Jan 4 2026, 9:20 PM

Thank you, I used nitems().