Page MenuHomeFreeBSD

tests: Add a buf_ring test
ClosedPublic

Authored by andrew on Jul 26 2024, 8:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 30, 6:01 PM
Unknown Object (File)
Wed, Oct 30, 12:15 AM
Unknown Object (File)
Sun, Oct 20, 10:11 AM
Unknown Object (File)
Oct 2 2024, 10:31 PM
Unknown Object (File)
Sep 30 2024, 4:04 PM
Unknown Object (File)
Sep 24 2024, 5:07 PM
Unknown Object (File)
Sep 13 2024, 6:27 AM
Unknown Object (File)
Sep 10 2024, 5:33 PM
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 Not Applicable
Unit
Tests Not Applicable

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.Aug 19 2024, 4:05 PM
This revision was automatically updated to reflect the committed changes.