qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: 卢长奇 <luchangqi.123@bytedance.com>
Cc: Klaus Jensen <k.jensen@samsung.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org, kwolf@redhat.com,
	hreitz@redhat.com, stefanha@redhat.com, fam@euphon.net,
	ronniesahlberg@gmail.com, pbonzini@redhat.com, pl@dlhnet.de,
	kbusch@kernel.org, foss@defmacro.it, philmd@linaro.org,
	pizhenwei@bytedance.com
Subject: Re: Ping: Re: [PATCH v9 09/10] hw/nvme: add reservation protocal command
Date: Sun, 18 Aug 2024 18:57:40 +0200	[thread overview]
Message-ID: <ZsIoBLfd40_QL9zk@cormorant.local> (raw)
In-Reply-To: <CAO5cSZDgv0V=bJx2Bj6p-Bx+1_2E4QcMrq2fSSdgoU_BtPLkrg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3588 bytes --]

On Aug  6 04:56, 卢长奇 wrote:
> Hi;
> 
> Klaus, Does the test method in the above email work properly?
> 

I assume it will; I was on conference and was catching up all of last
week.

I'll take action on this this week.

> On 2024/7/26 17:53, 卢长奇 wrote:
> > Hi;
> >
> > You can test it in spdk.
> > First start spdk and execute the following command.
> >
> > ```
> > dd if=/dev/zero of=test.img bs=1G count=10
> > RPC=/root/source/spdk/spdk/scripts/rpc.py
> > FILE=/root/test.img
> >
> > $RPC bdev_aio_create $FILE aio0 512
> > $RPC iscsi_create_portal_group 1 127.0.0.1:3260
> > $RPC iscsi_create_initiator_group 2 ANY ANY
> > $RPC iscsi_create_target_node target0 target0_alias aio0:0 1:2 64 -d
> > ```
> >
> > Then start qemu and mount an nvme disk.
> > Execute the following test command.
> > ```
> > #reporter
> > nvme resv-report /dev/nvme0n1
> > #register
> > nvme resv-register /dev/nvme0n1 --nrkey 3 --rrega 0
> > #unregister
> > nvme resv-register /dev/nvme0n1 --crkey 3 --rrega 1
> > # register replace
> > nvme resv-register /dev/nvme0n1 --crkey 3 --nrkey 5 --rrega 2
> > #release
> > nvme resv-release /dev/nvme0n1 --crkey 5 --rtype 1 --rrela 0
> > #clear
> > nvme resv-release /dev/nvme0n1 --crkey 5 --rtype 1 --rrela 1
> > #reserve
> > nvme resv-acquire /dev/nvme0n1 --crkey 3 --rtype 1 --racqa 0
> > #premmpt
> > nvme resv-acquire /dev/nvme0n1 --crkey 6 --prkey 3 --rtype 1 --racqa 1
> > ```
> >
> >
> >
> > On 2024/7/26 14:25, Klaus Jensen wrote:
> >> 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.

-- 
One of us - No more doubt, silence or taboo about mental illness.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-08-18 16:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-12  2:36 [PATCH v9 00/10] Support persistent reservation operations Changqi Lu
2024-07-12  2:36 ` [PATCH v9 01/10] block: add persistent reservation in/out api Changqi Lu
2024-07-12  2:36 ` [PATCH v9 02/10] block/raw: add persistent reservation in/out driver Changqi Lu
2024-07-12  2:36 ` [PATCH v9 03/10] scsi/constant: add persistent reservation in/out protocol constants Changqi Lu
2024-07-12  2:36 ` [PATCH v9 04/10] scsi/util: add helper functions for persistent reservation types conversion Changqi Lu
2024-07-12  2:36 ` [PATCH v9 05/10] hw/scsi: add persistent reservation in/out api for scsi device Changqi Lu
2024-07-12  2:36 ` [PATCH v9 06/10] block/nvme: add reservation command protocol constants Changqi Lu
2024-07-12  2:36 ` [PATCH v9 07/10] hw/nvme: add helper functions for converting reservation types Changqi Lu
2024-07-12  2:36 ` [PATCH v9 08/10] hw/nvme: enable ONCS and rescap function Changqi Lu
2024-07-12  2:36 ` [PATCH v9 09/10] hw/nvme: add reservation protocal command Changqi Lu
2024-07-15 10:09   ` Klaus Jensen
2024-07-17  9:04     ` 卢长奇
     [not found]     ` <58383d65-83df-4527-81e4-b4d12c409b22@bytedance.com>
2024-07-26  2:42       ` 卢长奇
2024-07-26  6:25         ` Klaus Jensen
2024-07-26  9:54           ` [External] " 卢长奇
2024-08-28  6:05             ` Klaus Jensen
     [not found]           ` <3a799eb6-3350-4b35-8e75-68d9020443cb@bytedance.com>
2024-08-06  2:56             ` Ping: " 卢长奇
2024-08-18 16:57               ` Klaus Jensen [this message]
2024-08-28  6:10   ` Klaus Jensen
2024-08-28  6:27     ` [External] " 卢长奇
2024-08-28  6:51   ` Klaus Jensen
2024-08-28  7:20     ` [External] " 卢长奇
2024-08-28  7:27       ` Klaus Jensen
2024-07-12  2:36 ` [PATCH v9 10/10] block/iscsi: add persistent reservation in/out driver Changqi Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZsIoBLfd40_QL9zk@cormorant.local \
    --to=its@irrelevant.dk \
    --cc=fam@euphon.net \
    --cc=foss@defmacro.it \
    --cc=hreitz@redhat.com \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=kwolf@redhat.com \
    --cc=luchangqi.123@bytedance.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pizhenwei@bytedance.com \
    --cc=pl@dlhnet.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).