The smartpqi(4) driver previously did not log device addition, removal, or controller events to the kernel message buffer, and the hw.smartpqi.debug_level tunable could only be configured at boot time via loader.conf. This matched neither the behavior of the older ciss(4) driver nor user expectations for a production storage driver. This change adds: - A read-write dev.smartpqi.<unit>.debug_level sysctl for modifying the debug level at runtime without a reboot. - device_printf calls for device additions, device removals, and controller-raised events (hotplug, hardware, physical/logical device, AIO state/config changes) so state transitions always appear in dmesg regardless of the debug level. - DBG_DISC logging for discovery state transitions (DEVICE_NOT_FOUND, DEVICE_CHANGED, DEVICE_IN_REMOVE), gated by the discovery debug flag. - Spelling corrections in user-visible strings and comments. - Updated man page documenting the new sysctl and logging behavior. Reported as FreeBSD Bugzilla 294161.
Details
Details
Build verification:
- make buildkernel KERNCONF=GENERIC — clean build with no new warnings
- make -C sys/modules/smartpqi — module builds cleanly
Sysctl runtime debug_level: - Load driver, verify sysctl dev.smartpqi.0.debug_level exists and reads default value 0x60
- sysctl dev.smartpqi.0.debug_level=0xff — confirm it accepts the new value
- sysctl dev.smartpqi.0.debug_level=0x60 — confirm reset works
- Verify debug output appears in dmesg after enabling higher levels during device activity
Device add/remove logging (default debug_level 0x60): - Hot-remove a physical disk — verify "device removed: vendor=... model=... B:T:L type=physical" appears in dmesg
- Hot-insert the disk — verify "device added: vendor=... model=..." appears in dmesg
- Create/delete a logical drive via arcconf — verify messages with type=logical
Event logging: - Hot-plug a disk — verify "event: hotplug (type=0x1)" appears in dmesg
- Create/delete a logical drive — verify "event: logical device (type=0x5)"
- Verify all six event types (hotplug, hardware, physical device, logical device, AIO state change, AIO config change) render with human-readable names
Discovery state logging (debug_level 0x70 = WARN|ERROR|DISC): - Hot-plug a disk — verify [DISC] messages for "new device found" and state transitions
- Hot-remove — verify "device in removal ... scheduling rescan" message
- Reset level to default — confirm [DISC] messages stop
Regression: - Run sustained block I/O (dd or fio) during hotplug tests — no panics or hangs
- Verify existing sysctl-based tunables (stream_disable, queue_depth, etc.) still function
- Man page renders correctly: man 4 smartpqi — new DEBUGGING section and SEE ALSO additions visible
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Although I don't acces to such a controller, aber the actual bits described in the manpage which you can set at runtime?