There are a lot of articles about NVMe specification itself. I don’t want to repeat them.
Let’s set those document stuffs aside and get a glimpse of NVM Express Admin Command of Samsung 950 Pro.
0. How did I get packets
Firstly I used Perisoft Bus Hound Free Version to get the layer to analyze. And I merged some example bus filter drivers and analyzed real packets.
Unfortunately during final verification process there was an incident with RAID1, and all of the data about this has gone.
I can’t remember every details about this, what I only remember are the results.
Actually If you have a license of bus analyzer you don’t have to read this article. Bus analyzer will give you all of these and maybe more.
It’s better to use default driver(OS driver) than vendor specific driver.
By now(Nov 2015), there’s no official way to do NVMe Passthrough.
Samsung 950 Pro uses SCSI Security Protocol In/Out to implement NVMe Admin Command Passthrough.
You can use same command of SCSI. But there’re some subtle differences between them. Like difference of Model(If you use SCSI, You’ll get ‘NVMe Samsung SSD 950’, while NVMe returns ‘Samsung SSD 950 PRO XXXGB’).
Function code is 5. That’s all. If you need a guide to interpret them, take a look at NVM express 1.1.
3. Get Log Page (SMART)
Yes, I know. SCSI has equivalent command too. But SCSI command will only return Temperature. You’ll get frustrated about the useless result and look for NVMe way.
Function code is 6. If you are looking for SMART information for NVMe devices, Global Log Page is the page for you. NVM express 1.1 says Global Log Page is FFFFFFFFh. So put FFh at 4~7th byte and send the command to the device. And you’ll get the full version of the SMART information.
4. Full version source