Message ID | 20201202062227.9826-1-chaitanya.kulkarni@wdc.com (mailing list archive) |
---|---|
Headers | show |
Series | nvmet: add ZBD backend support | expand |
Unless I'm missing something this fails to advertise multiple command support in the CAP property, as well as the enablement in the CC property. How does the host manage to even use this?
On 12/2/20 01:20, Christoph Hellwig wrote: > Unless I'm missing something this fails to advertise multiple command > support in the CAP property, as well as the enablement in the CC > property. How does the host manage to even use this? > Yes, it is because host side doesn't check for the controller cap property it only checks for the ns->head->ids.csi == NVME_CSI_ZNS that is set from the ns-desclist call, so this series got awaywithout cap/cc and CSI target side support. I think something like following (totally untested) will help to avoid the scenarios like this for ZNS drives so we can rejects the buggy controllers early to make sure we are spec compliant :- # git diff# git diff diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index d9b152bae19d..7b196299c9b7 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2166,6 +2166,11 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id) nvme_set_queue_limits(ns->ctrl, ns->queue); if (ns->head->ids.csi == NVME_CSI_ZNS) { + if (!(NVME_CAP_CSS(ns->ctrl->cap) & NVME_CAP_CSS_CSI)) { + pr_err("zns ns found with ctrl support for CSI"); + goto out_unfreeze; + } + ret = nvme_update_zone_info(ns, lbaf); if (ret) goto out_unfreeze;
On Thu, Dec 10, 2020 at 03:07:32AM +0000, Chaitanya Kulkarni wrote: > I think something like following (totally untested) will help to avoid the > scenarios like this for ZNS drives so we can rejects the buggy controllers > early to make sure we are spec compliant :- > > # git diff# git diff > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > index d9b152bae19d..7b196299c9b7 100644 > --- a/drivers/nvme/host/core.c > +++ b/drivers/nvme/host/core.c > @@ -2166,6 +2166,11 @@ static int nvme_update_ns_info(struct nvme_ns > *ns, struct nvme_id_ns *id) > nvme_set_queue_limits(ns->ctrl, ns->queue); > > if (ns->head->ids.csi == NVME_CSI_ZNS) { > + if (!(NVME_CAP_CSS(ns->ctrl->cap) & NVME_CAP_CSS_CSI)) { > + pr_err("zns ns found with ctrl support for CSI"); > + goto out_unfreeze; > + } I think you want to use nvme_multi_css() for the 'if()' check, but otherwise this looks like a valid sanity check.