libnvme: Export controller SGL support in nvme_ctrlr_stat.

libnvme has routines to convert SGL requests into PRP ones,
but they can only go so far, so some requests are truly
SGL-only.
This commit is contained in:
Augustin Cavalier 2020-04-23 01:01:11 -04:00
parent b36c8cff54
commit b0460580c5
2 changed files with 10 additions and 0 deletions

View File

@ -286,6 +286,8 @@ int nvme_ctrlr_stat(struct nvme_ctrlr *ctrlr, struct nvme_ctrlr_stat *cstat)
/* Maximum transfer size */
cstat->max_xfer_size = ctrlr->max_xfer_size;
cstat->sgl_supported = (ctrlr->flags & NVME_CTRLR_SGL_SUPPORTED);
memcpy(&cstat->features, &ctrlr->feature_supported,
sizeof(ctrlr->feature_supported));
memcpy(&cstat->log_pages, &ctrlr->log_page_supported,

View File

@ -301,6 +301,14 @@ struct nvme_ctrlr_stat {
*/
bool log_pages[256];
/**
* Whether SGL is supported by the controller.
*
* Note that this does not mean all SGL requests will fail;
* many are convertible into standard (PRP) requests by libnvme.
*/
bool sgl_supported;
/**
* All the features supported.
*/