Page MenuHomeFreeBSD

device: add generic named per-device property
Needs ReviewPublic

Authored by kib on Sun, Sep 8, 5:52 AM.
Tags
None
Referenced Files
F95863304: D46605.diff
Sun, Sep 22, 8:44 PM
Unknown Object (File)
Thu, Sep 19, 2:32 AM
Unknown Object (File)
Wed, Sep 18, 3:58 PM
Unknown Object (File)
Wed, Sep 18, 9:53 AM
Unknown Object (File)
Wed, Sep 18, 9:35 AM
Unknown Object (File)
Tue, Sep 17, 7:17 PM
Unknown Object (File)
Tue, Sep 17, 5:21 PM
Unknown Object (File)
Sat, Sep 14, 9:46 PM
Subscribers

Details

Reviewers
jhb
imp
Summary
The KPI allows to store arbitrary data within struct device, retrieve it
back by name, and update the value.  The data is automatically destroyed
on the device deletion.  Also, the user can request to clear the named
property from all devices.

My need for this interface is due to IOMMU needing to save some
indicator on device, which must survive the re-creation of the domain
context.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Sun, Sep 8, 5:52 AM

'man osd' won't help?

osd was my initial thought when I realized that I need this. But looking closely at interface, and realizing that I need to modify osd.h just to add my new osd type made me much less enthusiastic.

Also, osd would need too much rituals to be used: slots are identified by ints, while I can name them directly by iommu devunit name, etc, the overhead of osd is by order higher both in locking and in memory use. My code also has a way to conveniently destroy properties on either device or consumer destruction.