diff mbox series

[6/9] nvmet: add cns-cs-ns in id-ctrl for ZNS bdev

Message ID 20201126024043.3392-7-chaitanya.kulkarni@wdc.com (mailing list archive)
State New, archived
Headers show
Series nvmet: add genblk ZBD backend | expand

Commit Message

Chaitanya Kulkarni Nov. 26, 2020, 2:40 a.m. UTC
Update the nvmet_execute_identify() such that it can now handle
NVME_ID_CNS_CS_NS when identify.cis is set to ZNS. This allows
host to identify the ns with ZNS capabilities.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/nvme/target/admin-cmd.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Damien Le Moal Nov. 26, 2020, 8:40 a.m. UTC | #1
On 2020/11/26 11:42, Chaitanya Kulkarni wrote:
> Update the nvmet_execute_identify() such that it can now handle
> NVME_ID_CNS_CS_NS when identify.cis is set to ZNS. This allows
> host to identify the ns with ZNS capabilities.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  drivers/nvme/target/admin-cmd.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
> index e7d2b96cda6b..cd368cbe3855 100644
> --- a/drivers/nvme/target/admin-cmd.c
> +++ b/drivers/nvme/target/admin-cmd.c
> @@ -648,6 +648,10 @@ static void nvmet_execute_identify(struct nvmet_req *req)
>  	switch (req->cmd->identify.cns) {
>  	case NVME_ID_CNS_NS:
>  		return nvmet_execute_identify_ns(req);
> +	case NVME_ID_CNS_CS_NS:
> +		if (req->cmd->identify.csi == NVME_CSI_ZNS)
> +			return nvmet_execute_identify_cns_cs_ns(req);
> +		break;
>  	case NVME_ID_CNS_CTRL:
>  		return nvmet_execute_identify_ctrl(req);
>  	case NVME_ID_CNS_CS_CTRL:
> 

Same patch as patch 5 ? Bug ?
Damien Le Moal Nov. 30, 2020, 12:21 a.m. UTC | #2
On 2020/11/28 9:13, Chaitanya Kulkarni wrote:
> On 11/26/20 00:40, Damien Le Moal wrote:
>>> diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
>>> index e7d2b96cda6b..cd368cbe3855 100644
>>> --- a/drivers/nvme/target/admin-cmd.c
>>> +++ b/drivers/nvme/target/admin-cmd.c
>>> @@ -648,6 +648,10 @@ static void nvmet_execute_identify(struct nvmet_req *req)
>>>  	switch (req->cmd->identify.cns) {
>>>  	case NVME_ID_CNS_NS:
>>>  		return nvmet_execute_identify_ns(req);
>>> +	case NVME_ID_CNS_CS_NS:
>>> +		if (req->cmd->identify.csi == NVME_CSI_ZNS)
>>> +			return nvmet_execute_identify_cns_cs_ns(req);
>>> +		break;
>>>  	case NVME_ID_CNS_CTRL:
>>>  		return nvmet_execute_identify_ctrl(req);
>>>  	case NVME_ID_CNS_CS_CTRL:
>>>
>> Same patch as patch 5 ? Bug ?
> 
> Yes, but right now there are no ns-type than ZNS that we support.
> Can you please explain I think I didn't understand what bug you are
> referring to.

Patch 5 and 6 in the series you posted look identical to me. It looks like the
same patch was sent twice with a different number. Unless I missed some subtle
difference between them ?
diff mbox series

Patch

diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index e7d2b96cda6b..cd368cbe3855 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -648,6 +648,10 @@  static void nvmet_execute_identify(struct nvmet_req *req)
 	switch (req->cmd->identify.cns) {
 	case NVME_ID_CNS_NS:
 		return nvmet_execute_identify_ns(req);
+	case NVME_ID_CNS_CS_NS:
+		if (req->cmd->identify.csi == NVME_CSI_ZNS)
+			return nvmet_execute_identify_cns_cs_ns(req);
+		break;
 	case NVME_ID_CNS_CTRL:
 		return nvmet_execute_identify_ctrl(req);
 	case NVME_ID_CNS_CS_CTRL: