Page MenuHomeFreeBSD

LinuxKPI: extend kfifo to be usable by a driver
ClosedPublic

Authored by bz on Jul 16 2022, 12:40 AM.
Tags
None
Referenced Files
F163227009: D35829.id.diff
Tue, Jul 21, 6:00 AM
Unknown Object (File)
Sat, Jul 4, 3:58 PM
Unknown Object (File)
Fri, Jul 3, 1:24 PM
Unknown Object (File)
Jun 19 2026, 7:16 PM
Unknown Object (File)
Jun 10 2026, 6:55 AM
Unknown Object (File)
Jun 9 2026, 4:58 PM
Unknown Object (File)
Jun 9 2026, 11:46 AM
Unknown Object (File)
May 23 2026, 12:12 PM

Details

Summary

Implement some basic needs for an actual driver using kfifo.

MFC after: 2 weeks

Test Plan

I had this in user space initially and tested it and it seemed to
work as expected.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46453
Build 43342: arc lint + arc unit

Event Timeline

bz requested review of this revision.Jul 16 2022, 12:40 AM
sys/compat/linuxkpi/common/include/linux/kfifo.h
91

Is there a chance of counters wrapping around?

Where is first decremented?

sys/compat/linuxkpi/common/include/linux/kfifo.h
91

First is decremented right below there if it rolls over. It's a FIFO--first and last just move forward (or wrap around).

Now I see. Looks good to me.

This revision is now accepted and ready to land.Jul 17 2022, 6:15 PM

I've done a build against drm-kmod master but I'll wait to hear back from @manu or @wulf on whether it's okay for them too.

It builds for me on master, 5.10-lts and 5.4-lts branches

This revision was automatically updated to reflect the committed changes.