Page MenuHomeFreeBSD

Fix NVMe's use of XPT_GDEV_TYPE
ClosedPublic

Authored by chuck_tuffli.net on Apr 23 2017, 5:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 6:33 AM
Unknown Object (File)
Thu, Nov 21, 12:33 AM
Unknown Object (File)
Oct 21 2024, 1:50 PM
Unknown Object (File)
Oct 21 2024, 1:47 PM
Unknown Object (File)
Oct 12 2024, 12:23 PM
Unknown Object (File)
Oct 5 2024, 9:05 PM
Unknown Object (File)
Oct 3 2024, 12:12 AM
Unknown Object (File)
Oct 2 2024, 11:41 PM

Details

Summary

This patch changes the way XPT_GDEV_TYPE works for NVMe. The current ccb_getdev structure includes pointers to the NVMe Identify Controller and Namespace structures, but these are kernel virtual addresses which are not accessible from user space.

As an alternative, the patch removes these pointers from ccb_getdev and adds two new types to ccb_dev_advinfo to retrieve the Identify Controller (CDAI_TYPE_NVME_CNTRL) and Namespace (CDAI_TYPE_NVME_NS) data structures.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fixed white-space problem with cam_ccb.h

Please regenerate the diffs w/ proper context. See https://wiki.freebsd.org/action/show/Phabricator for details on how to do that.

Add full diff context per feedback.

sys/cam/nvme/nvme_da.c
704 ↗(On Diff #27697)

It appears that cgd is only used in this function for setting these two variables, and for some #if 0-ed out code later on. Since it's no longer used, can you remove it entirely?

sys/cam/nvme/nvme_da.c
704 ↗(On Diff #27697)

If it weren't for the ifdef'd out quirk code, I would have taken it out. Can we let @imp make the call?

Remove it. If we need it again, it can be added back.

chuck_tuffli.net marked 2 inline comments as done.

Removed ccb_getdev references and ifdef'd out quirk code in ndaregister

LGTM, but @imp should have the final say.

This revision is now accepted and ready to land.Apr 26 2017, 10:17 PM

Except for padding.

sys/cam/cam_ccb.h
363–364 ↗(On Diff #27767)

should we replace this with void *padding[2]; instead?

sys/cam/cam_ccb.h
363–364 ↗(On Diff #27767)

Works for me. I will plan on this unless someone has an objection.

This revision was automatically updated to reflect the committed changes.