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)
Sat, Jun 29, 7:18 PM
Unknown Object (File)
May 22 2024, 3:11 AM
Unknown Object (File)
May 21 2024, 9:35 PM
Unknown Object (File)
May 21 2024, 9:34 PM
Unknown Object (File)
Dec 23 2023, 1:39 AM
Unknown Object (File)
Dec 2 2023, 11:50 PM
Unknown Object (File)
Nov 6 2023, 5:13 PM
Unknown Object (File)
Nov 5 2023, 7:28 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.