Page MenuHomeFreeBSD

Implement the NVME_GET_NSID and NVME_PASSTHROUGH_CMD ioctls
ClosedPublic

Authored by imp on Apr 30 2020, 12:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 18 2024, 4:39 PM
Unknown Object (File)
Dec 23 2023, 1:10 AM
Unknown Object (File)
Nov 5 2023, 2:06 PM
Unknown Object (File)
Oct 4 2023, 1:03 PM
Unknown Object (File)
Dec 12 2022, 10:58 PM
Subscribers

Details

Reviewers
chs
chuck
rpokala
Group Reviewers
cam
Summary

Return the nvmeX device associated with the ndaX device.

Add the nvmeX device to the XPT_PATH_INQ nvme specific
information. while one could figure this out by looking up the
domain:bus:slot:function, it's a lot easier to have the SIM set it
directly since the sim knows this.

Implement the NVME_GET_NSID and NVME_PASSTHROUGH_CMD ioctls

With these two ioctls implemented in the nda driver, nvmecontrol now
works with nda just like it does with nvd. It eliminates the need to
jump through odd hoops to get this data.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30804
Build 28527: arc lint + arc unit

Event Timeline

imp requested review of this revision.Apr 30 2020, 12:29 AM
sys/cam/cam_ccb.h
1037

Gratuitous newline?

sys/cam/nvme/nvme_da.c
418

You should also handle CAM_DIR_NONE commands, such as FLUSH.

sys/cam/cam_ccb.h
1037

This is stray and will be removed.

sys/cam/nvme/nvme_da.c
418

The pt interface doesn't really allow for that. It says this request is a read or not. And not implies write.

sys/cam/cam_ccb.h
1037

yup.... I'll remove it in a followup commit now that I pushed the wrong branch. Doh!

Doh! I pushed the wrong branch :(. So I'll fix things in a followup. I *THINK* I got this mostly right since I didn't need to add any new 'reach over' pointers...

Add comments that cperciva noticed on IRC.

sys/cam/nvme/nvme_da.c
405

this should be dp->d_maxsize, which is often MAXPHYS, but isn't aways.

430

We need to release ccb here to not leak it.

445

This lock is likely bogus. We need to return with it unlocked. Other paths lock after the unmap, but then unlock again before returning. this was copied from the scsi_pass, but that is unnecessary in this case. We don't need need to hold it to release the ccb.

sys/cam/nvme/nvme_da.c
397

Does this assignment need a le32toh() ?

027d061296cc9 / r360483 landed this

sys/cam/nvme/nvme_da.c
397

Pathinq returns host order.

This revision is now accepted and ready to land.Jul 13 2021, 6:33 PM

027d061296cc9 landed this 15 months ago. Closing.