Page MenuHomeFreeBSD

Add IOCTL to get device ID
AbandonedPublic

Authored by imp on Dec 12 2019, 11:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 7, 9:25 PM
Unknown Object (File)
Fri, Oct 10, 8:54 PM
Unknown Object (File)
Aug 26 2025, 3:45 PM
Unknown Object (File)
Aug 26 2025, 3:36 PM
Unknown Object (File)
Aug 26 2025, 1:29 PM
Unknown Object (File)
Aug 19 2025, 4:03 PM
Unknown Object (File)
Mar 13 2025, 5:52 AM
Unknown Object (File)
Sep 20 2024, 9:41 AM
Subscribers

Details

Reviewers
chuck
mav
Summary

Add NVME_PCI_ID to directly get the PCI vendor, device, subvendor and
subdevice. nvme-cli can use this ioctl to report additional
information about the drives. Adding an ioctl to get this data is
easier than the alternatives.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28113
Build 26252: arc lint + arc unit

Event Timeline

I haven't looked on it in Linux to compare, but I have no objections.

This revision is now accepted and ready to land.Dec 12 2019, 11:23 PM

While I don't have an issue with this change per se, if the goal is to support nvme-cli, I'd argue that it would be better to provide an emulated device node via the Linux compatibility layer. The main concern is nvme-cli assumes it operates under Linux which exposes NVMe devices to the system in a very different way to what FreeBSD does (e.g. device node naming differences, device nodes are block devices, etc). Thus to better support nvme-cli, there would probably be additional IOCTL's added here to support / work-around Linux-isms. And these additions would look odd as nothing in base would use them.

While I don't have an issue with this change per se, if the goal is to support nvme-cli, I'd argue that it would be better to provide an emulated device node via the Linux compatibility layer. The main concern is nvme-cli assumes it operates under Linux which exposes NVMe devices to the system in a very different way to what FreeBSD does (e.g. device node naming differences, device nodes are block devices, etc). Thus to better support nvme-cli, there would probably be additional IOCTL's added here to support / work-around Linux-isms. And these additions would look odd as nothing in base would use them.

I looked at going full support, and it would be a lot. The extra nodes, the different names aren't so bad, but it's the different semantics for similarly named nodes that was the deal killer. My nvme-cli port handles the differences a mix of stuff we do in the kernel and stuff we do in nvme-cli to handle the differences there. This is one of the differences I couldn't easily handle there.