[PATCH v14 2/2] nvmet: support reservation feature

Chaitanya Kulkarni chaitanyak at nvidia.com
Sun Oct 13 23:05:29 PDT 2024


On 10/10/24 19:26, Guixin Liu wrote:
> This patch implements the reservation feature, including:
>    1. reservation register(register, unregister and replace).
>    2. reservation acquire(acquire, preempt, preempt and abort).
>    3. reservation release(release and clear).
>    4. reservation report.
>    5. set feature and get feature of reservation notify mask.
>    6. get log page of reservation event.
>
> Not supported:
>    1. persistent reservation through power loss.
>
> Test cases:
>    Use nvme-cli and fio to test all implemented sub features:
>    1. use nvme resv-register to register host a registrant or
>       unregister or replace a new key.
>    2. use nvme resv-acquire to set host to the holder, and use fio
>       to send read and write io in all reservation type. And also
>       test preempt and "preempt and abort".
>    3. use nvme resv-report to show all registrants and reservation
>       status.
>    4. use nvme resv-release to release all registrants.
>    5. use nvme get-log to get events generated by the preceding
>       operations.
>
> In addition, make reservation configurable, one can set ns to
> support reservation before enable ns. The default of resv_enable
> is false.
>
> Signed-off-by: Guixin Liu<kanie at linux.alibaba.com>

Looks good.

Tested-by: Chaitanya Kulkarni<kch at nvidia.com>
Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>

-ck

blktests (master) # ./check nvme
nvme/002 (tr=loop) (create many subsystems and test discovery) [passed]
     runtime  29.316s  ...  28.922s
nvme/003 (tr=loop) (test if we're sending keep-alives to a discovery 
controller) [passed]
     runtime  11.222s  ...  11.247s
nvme/004 (tr=loop) (test nvme and nvmet UUID NS descriptors) [passed]
     runtime  0.717s  ...  0.712s
nvme/005 (tr=loop) (reset local loopback target) [passed]
     runtime  1.287s  ...  1.258s
nvme/006 (tr=loop bd=device) (create an NVMeOF target) [passed]
     runtime  0.077s  ...  0.073s
nvme/006 (tr=loop bd=file) (create an NVMeOF target) [passed]
     runtime  0.049s  ...  0.048s
nvme/008 (tr=loop bd=device) (create an NVMeOF host) [passed]
     runtime  0.746s  ...  0.709s
nvme/008 (tr=loop bd=file) (create an NVMeOF host) [passed]
     runtime  0.682s  ...  0.701s
nvme/010 (tr=loop bd=device) (run data verification fio job) [passed]
     runtime  17.291s  ...  48.777s
nvme/010 (tr=loop bd=file) (run data verification fio job) [passed]
     runtime  32.528s  ...  109.749s
nvme/012 (tr=loop bd=device) (run mkfs and data verification fio) [passed]
     runtime  18.424s  ...  41.073s
nvme/012 (tr=loop bd=file) (run mkfs and data verification fio) [passed]
     runtime  38.336s  ...  90.011s
nvme/014 (tr=loop bd=device) (flush a command from host) [passed]
     runtime  6.030s  ...  7.619s
nvme/014 (tr=loop bd=file) (flush a command from host) [passed]
     runtime  4.471s  ...  6.199s
nvme/016 (tr=loop) (create/delete many NVMeOF block device-backed ns and 
test discovery) [passed]
     runtime  19.666s  ...  19.725s
nvme/017 (tr=loop) (create/delete many file-ns and test discovery) [passed]
     runtime  20.157s  ...  19.392s
nvme/018 (tr=loop) (unit test NVMe-oF out of range access on a file 
backend) [passed]
     runtime  0.703s  ...  0.684s
nvme/019 (tr=loop bd=device) (test NVMe DSM Discard command) [passed]
     runtime  0.715s  ...  0.685s
nvme/019 (tr=loop bd=file) (test NVMe DSM Discard command) [passed]
     runtime  0.688s  ...  0.679s
nvme/021 (tr=loop bd=device) (test NVMe list command) [passed]
     runtime  0.728s  ...  0.699s
nvme/021 (tr=loop bd=file) (test NVMe list command) [passed]
     runtime  0.692s  ...  0.687s
nvme/022 (tr=loop bd=device) (test NVMe reset command) [passed]
     runtime  1.272s  ...  1.260s
nvme/022 (tr=loop bd=file) (test NVMe reset command) [passed]
     runtime  1.267s  ...  1.250s
nvme/023 (tr=loop bd=device) (test NVMe smart-log command) [passed]
     runtime  0.722s  ...  0.686s
nvme/023 (tr=loop bd=file) (test NVMe smart-log command) [passed]
     runtime  0.702s  ...  0.671s
nvme/025 (tr=loop bd=device) (test NVMe effects-log) [passed]
     runtime  0.548s  ...  0.692s
nvme/025 (tr=loop bd=file) (test NVMe effects-log) [passed]
     runtime  0.694s  ...  0.681s
nvme/026 (tr=loop bd=device) (test NVMe ns-descs) [passed]
     runtime  0.717s  ...  0.675s
nvme/026 (tr=loop bd=file) (test NVMe ns-descs) [passed]
     runtime  0.703s  ...  0.666s
nvme/027 (tr=loop bd=device) (test NVMe ns-rescan command) [passed]
     runtime  0.748s  ...  0.728s
nvme/027 (tr=loop bd=file) (test NVMe ns-rescan command) [passed]
     runtime  0.724s  ...  0.705s
nvme/028 (tr=loop bd=device) (test NVMe list-subsys) [passed]
     runtime  0.733s  ...  0.683s
nvme/028 (tr=loop bd=file) (test NVMe list-subsys) [passed]
     runtime  0.699s  ...  0.675s
nvme/029 (tr=loop) (test userspace IO via nvme-cli read/write interface) 
[passed]
     runtime  0.808s  ...  0.807s
nvme/030 (tr=loop) (ensure the discovery generation counter is updated 
appropriately) [passed]
     runtime  0.299s  ...  0.317s
nvme/031 (tr=loop) (test deletion of NVMeOF controllers immediately 
after setup) [passed]
     runtime  6.820s  ...  6.698s
nvme/038 (tr=loop) (test deletion of NVMeOF subsystem without enabling) 
[passed]
     runtime  0.012s  ...  0.012s
nvme/040 (tr=loop) (test nvme fabrics controller reset/disconnect 
operation during I/O) [passed]
     runtime  7.129s  ...  7.542s
nvme/041 (tr=loop) (Create authenticated connections) [passed]
     runtime  2.070s  ...  2.019s
nvme/042 (tr=loop) (Test dhchap key types for authenticated connections) 
[passed]
     runtime  6.337s  ...  6.198s
nvme/043 (tr=loop) (Test hash and DH group variations for authenticated 
connections) [passed]
     runtime  25.100s  ...  24.496s
nvme/044 (tr=loop) (Test bi-directional authentication) [passed]
     runtime  4.452s  ...  4.387s
nvme/045 (tr=loop) (Test re-authentication) [passed]
     runtime  1.678s  ...  1.817s
common/rc: line 213: 0vme: value too great for base (error token is "0vme")
nvme/048 (tr=loop) (Test queue count changes on reconnect)   [not run]
     nvme_trtype=loop is not supported in this test
nvme/051 (tr=loop) (test nvmet concurrent ns enable/disable) [passed]
     runtime  2.238s  ...  2.306s
nvme/052 (tr=loop) (Test file-ns creation/deletion under one subsystem) 
[passed]
     runtime  20.621s  ...  5.493s
nvme/054 (Test the NVMe reservation feature) [passed]
     runtime  0.739s  ...  0.724s
blktests (master) # nvme_trtype=tcp ./check nvme
nvme/002 (tr=tcp) (create many subsystems and test discovery) [not run]
     nvme_trtype=tcp is not supported in this test
nvme/003 (tr=tcp) (test if we're sending keep-alives to a discovery 
controller) [passed]
     runtime  11.262s  ...  11.241s
nvme/004 (tr=tcp) (test nvme and nvmet UUID NS descriptors) [passed]
     runtime  0.261s  ...  0.179s
nvme/005 (tr=tcp) (reset local loopback target) [passed]
     runtime  0.311s  ...  0.244s
nvme/006 (tr=tcp bd=device) (create an NVMeOF target) [passed]
     runtime  0.090s  ...  0.069s
nvme/006 (tr=tcp bd=file) (create an NVMeOF target) [passed]
     runtime  0.072s  ...  0.051s
nvme/008 (tr=tcp bd=device) (create an NVMeOF host) [passed]
     runtime  0.259s  ...  0.194s
nvme/008 (tr=tcp bd=file) (create an NVMeOF host) [passed]
     runtime  0.192s  ...  0.181s
nvme/010 (tr=tcp bd=device) (run data verification fio job) [passed]
     runtime  62.326s  ...  53.529s
nvme/010 (tr=tcp bd=file) (run data verification fio job) [passed]
     runtime  95.985s  ...  106.414s
nvme/012 (tr=tcp bd=device) (run mkfs and data verification fio) [passed]
     runtime  63.920s  ...  53.094s
nvme/012 (tr=tcp bd=file) (run mkfs and data verification fio) [passed]
     runtime  105.927s  ...  83.156s
nvme/014 (tr=tcp bd=device) (flush a command from host) [passed]
     runtime  8.228s  ...  6.341s
nvme/014 (tr=tcp bd=file) (flush a command from host) [passed]
     runtime  6.434s  ...  5.502s
nvme/016 (tr=tcp) (create/delete many NVMeOF block device-backed ns and 
test discovery) [not run]
     nvme_trtype=tcp is not supported in this test
nvme/017 (tr=tcp) (create/delete many file-ns and test discovery) [not run]
     nvme_trtype=tcp is not supported in this test
nvme/018 (tr=tcp) (unit test NVMe-oF out of range access on a file 
backend) [passed]
     runtime  0.213s  ...  0.202s
nvme/019 (tr=tcp bd=device) (test NVMe DSM Discard command) [passed]
     runtime  0.250s  ...  0.170s
nvme/019 (tr=tcp bd=file) (test NVMe DSM Discard command) [passed]
     runtime  0.210s  ...  0.168s
nvme/021 (tr=tcp bd=device) (test NVMe list command) [passed]
     runtime  0.246s  ...  0.215s
nvme/021 (tr=tcp bd=file) (test NVMe list command) [passed]
     runtime  0.204s  ...  0.160s
nvme/022 (tr=tcp bd=device) (test NVMe reset command) [passed]
     runtime  0.320s  ...  0.213s
nvme/022 (tr=tcp bd=file) (test NVMe reset command) [passed]
     runtime  0.293s  ...  0.208s
nvme/023 (tr=tcp bd=device) (test NVMe smart-log command) [passed]
     runtime  0.236s  ...  0.180s
nvme/023 (tr=tcp bd=file) (test NVMe smart-log command) [passed]
     runtime  0.224s  ...  0.175s
nvme/025 (tr=tcp bd=device) (test NVMe effects-log) [passed]
     runtime  0.254s  ...  0.184s
nvme/025 (tr=tcp bd=file) (test NVMe effects-log) [passed]
     runtime  0.225s  ...  0.168s
nvme/026 (tr=tcp bd=device) (test NVMe ns-descs) [passed]
     runtime  0.239s  ...  0.159s
nvme/026 (tr=tcp bd=file) (test NVMe ns-descs) [passed]
     runtime  0.230s  ...  0.157s
nvme/027 (tr=tcp bd=device) (test NVMe ns-rescan command) [passed]
     runtime  0.277s  ...  0.195s
nvme/027 (tr=tcp bd=file) (test NVMe ns-rescan command) [passed]
     runtime  0.260s  ...  0.195s
nvme/028 (tr=tcp bd=device) (test NVMe list-subsys) [passed]
     runtime  0.246s  ...  0.176s
nvme/028 (tr=tcp bd=file) (test NVMe list-subsys) [passed]
     runtime  0.232s  ...  0.160s
nvme/029 (tr=tcp) (test userspace IO via nvme-cli read/write interface) 
[passed]
     runtime  0.406s  ...  0.293s
nvme/030 (tr=tcp) (ensure the discovery generation counter is updated 
appropriately) [passed]
     runtime  0.169s  ...  0.135s
nvme/031 (tr=tcp) (test deletion of NVMeOF controllers immediately after 
setup) [passed]
     runtime  2.121s  ...  1.639s
nvme/038 (tr=tcp) (test deletion of NVMeOF subsystem without enabling) 
[passed]
     runtime  0.022s  ...  0.015s
nvme/040 (tr=tcp) (test nvme fabrics controller reset/disconnect 
operation during I/O) [passed]
     runtime  6.289s  ...  6.239s
nvme/041 (tr=tcp) (Create authenticated connections) [passed]
     runtime  1.710s  ...  1.542s
nvme/042 (tr=tcp) (Test dhchap key types for authenticated connections) 
[passed]
     runtime  3.992s  ...  2.755s
nvme/043 (tr=tcp) (Test hash and DH group variations for authenticated 
connections) [passed]
     runtime  19.801s  ...  17.088s
nvme/044 (tr=tcp) (Test bi-directional authentication) [passed]
     runtime  3.609s  ...  3.385s
nvme/045 (tr=tcp) (Test re-authentication) [passed]
     runtime  1.440s  ...  1.230s
common/rc: line 213: 0vme: value too great for base (error token is "0vme")
nvme/048 (tr=tcp) (Test queue count changes on reconnect) [passed]
     runtime  6.308s  ...  5.221s
nvme/051 (tr=tcp) (test nvmet concurrent ns enable/disable) [passed]
     runtime    ...  2.589s
nvme/052 (tr=tcp) (Test file-ns creation/deletion under one subsystem) 
[not run]
     runtime  2.234s  ...
     nvme_trtype=tcp is not supported in this test
nvme/054 (Test the NVMe reservation feature) [passed]
     runtime  0.724s  ...  0.511s
blktests (master) #




More information about the Linux-nvme mailing list