Page MenuHomeFreeBSD

tests: Add a buf_ring test
AcceptedPublic

Authored by andrew on Jul 26 2024, 8:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 13, 6:27 AM
Unknown Object (File)
Tue, Sep 10, 5:33 PM
Unknown Object (File)
Sun, Sep 8, 5:11 PM
Unknown Object (File)
Sat, Sep 7, 4:23 AM
Unknown Object (File)
Sat, Aug 31, 4:58 AM
Unknown Object (File)
Aug 15 2024, 10:22 PM
Unknown Object (File)
Aug 5 2024, 7:01 AM
Unknown Object (File)
Aug 4 2024, 7:37 AM
Subscribers

Details

Summary

Add a simple test for sys/buf_ring.h. This enqueues and dequeues items
in the buf_ring to ensure the simple operations are correct.

There are no checks for multiple threads operating on buf_ring_enqueue
or buf_ring_dequeue_mc as they can be probabilistic and depend on the
architecture memory model.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59047
Build 55934: arc lint + arc unit

Event Timeline

tests/sys/sys/buf_ring_test.c
20

I understand why this is convenient (otherwise you need to buildworld to pick up the in-tree buf_ring.h header), but other tests in this directory don't behave like this. IMO it'd be better to be consistent.

28

Should we define these in buf_ring.h?

tests/sys/sys/buf_ring_test.c
28

We could. I put them here to allow for a non-trivial implementation.

Use #include <sys/buf_ring.h>

This revision is now accepted and ready to land.Mon, Aug 19, 4:05 PM