[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 09/10] hw/nvme: add reservation protocal command
From: |
Klaus Jensen |
Subject: |
Re: [PATCH v9 09/10] hw/nvme: add reservation protocal command |
Date: |
Fri, 26 Jul 2024 08:25:12 +0200 |
On Jul 25 19:42, 卢长奇 wrote:
> Hi,
>
> ```
> 2685 nvme_status->regctl_ds[i].cntlid = nvme_ctrl(req)->cntlid;
> 2686 nvme_status->regctl_ds[i].rkey = keys_info->keys[i];
> 2687 nvme_status->regctl_ds[i].rcsts = keys_info->keys[i] ==
> 2688 reservation->key ? 1 : 0;
> 2689 /* hostid is not supported currently */
> 2670 memset(&nvme_status->regctl_ds[i].hostid, 0, 8);
> ```
>
> Klaus, I think hostid(2685) is stored locally like cntlid, i
> can get cntlid by nvme_ctrl(req)->cntlid, but I can't
> find a good way to get the host ID(2670). So I add a comment
> "/* hostid is not supported currently */". Could you give me
> some advices?
>
The Host Identifier is just a 64 or 128 bit value that the host can set
with Set Feature. So, it is fine (and normal) that the value is
initially zero, but the host should be able to set it on controllers
with Set Feature to indicate if a controller belongs to the same host or
not.
> And using spdk as target will not fail, but it will show 0 at hostid
> at present.
Host Identifier 0 is a valid value when used with reservations; 0
indicates that the host associated with the controller is not associated
with any other controllers in the subsystem. So if two controllers have
Host Identifier set to 0, that implicitly mean they are associated with
two different hosts.
> The relevant tests in qemu are as follows,
>
> ```
> root@node1:~# nvme resv-report /dev/nvme0n1
> NVME Reservation Report success
>
> NVME Reservation status:
>
> gen : 1
> regctl : 1
> rtype : 0
> ptpls : 0
> regctl[0] :
> cntlid : 0
> rcsts : 0
> hostid : 0
> rkey : 6
> ```
I was hoping for an example on how to setup some simple iscsi stuff so I
could test the feature.
signature.asc
Description: PGP signature
- [PATCH v9 03/10] scsi/constant: add persistent reservation in/out protocol constants, (continued)
- [PATCH v9 03/10] scsi/constant: add persistent reservation in/out protocol constants, Changqi Lu, 2024/07/11
- [PATCH v9 04/10] scsi/util: add helper functions for persistent reservation types conversion, Changqi Lu, 2024/07/11
- [PATCH v9 05/10] hw/scsi: add persistent reservation in/out api for scsi device, Changqi Lu, 2024/07/11
- [PATCH v9 07/10] hw/nvme: add helper functions for converting reservation types, Changqi Lu, 2024/07/11
- [PATCH v9 06/10] block/nvme: add reservation command protocol constants, Changqi Lu, 2024/07/11
- [PATCH v9 08/10] hw/nvme: enable ONCS and rescap function, Changqi Lu, 2024/07/11
- [PATCH v9 09/10] hw/nvme: add reservation protocal command, Changqi Lu, 2024/07/11
[PATCH v9 10/10] block/iscsi: add persistent reservation in/out driver, Changqi Lu, 2024/07/11