mbox series

[v6,00/10] Support persistent reservation operations

Message ID 20240613071327.2498953-1-luchangqi.123@bytedance.com (mailing list archive)
Headers show
Series Support persistent reservation operations | expand

Message

Changqi Lu June 13, 2024, 7:13 a.m. UTC
Hi,

patch v6 has been modified.

v5->v6:
- Add relevant comments in the io layer.

v4->v5:
- Fixed a memory leak bug at hw/nvme/ctrl.c.

v3->v4:
- At the nvme layer, the two patches of enabling the ONCS
  function and enabling rescap are combined into one.
- At the nvme layer, add helper functions for pr capacity
  conversion between the block layer and the nvme layer.

v2->v3:
In v2 Persist Through Power Loss(PTPL) is enable default.
In v3 PTPL is supported, which is passed as a parameter.

v1->v2:
- Add sg_persist --report-capabilities for SCSI protocol and enable
  oncs and rescap for NVMe protocol.
- Add persistent reservation capabilities constants and helper functions for
  SCSI and NVMe protocol.
- Add comments for necessary APIs.

v1:
- Add seven APIs about persistent reservation command for block layer.
  These APIs including reading keys, reading reservations, registering,
  reserving, releasing, clearing and preempting.
- Add the necessary pr-related operation APIs for both the
  SCSI protocol and NVMe protocol at the device layer.
- Add scsi driver at the driver layer to verify the functions

Changqi Lu (10):
  block: add persistent reservation in/out api
  block/raw: add persistent reservation in/out driver
  scsi/constant: add persistent reservation in/out protocol constants
  scsi/util: add helper functions for persistent reservation types
    conversion
  hw/scsi: add persistent reservation in/out api for scsi device
  block/nvme: add reservation command protocol constants
  hw/nvme: add helper functions for converting reservation types
  hw/nvme: enable ONCS and rescap function
  hw/nvme: add reservation protocal command
  block/iscsi: add persistent reservation in/out driver

 block/block-backend.c             | 403 +++++++++++++++++++++++++++
 block/io.c                        | 163 +++++++++++
 block/iscsi.c                     | 443 ++++++++++++++++++++++++++++++
 block/raw-format.c                |  56 ++++
 hw/nvme/ctrl.c                    | 326 +++++++++++++++++++++-
 hw/nvme/ns.c                      |   5 +
 hw/nvme/nvme.h                    |  84 ++++++
 hw/scsi/scsi-disk.c               | 352 ++++++++++++++++++++++++
 include/block/block-common.h      |  40 +++
 include/block/block-io.h          |  20 ++
 include/block/block_int-common.h  |  84 ++++++
 include/block/nvme.h              |  98 +++++++
 include/scsi/constants.h          |  52 ++++
 include/scsi/utils.h              |   8 +
 include/sysemu/block-backend-io.h |  24 ++
 scsi/utils.c                      |  81 ++++++
 16 files changed, 2237 insertions(+), 2 deletions(-)

Comments

Changqi Lu June 19, 2024, 2:49 a.m. UTC | #1
Hi,

Klaus, the pr related operations of the
nvme layer are almost ready.

Stefan, the block layer has been modified
according to your comments.

Please help review the code again. Thanks!

On 2024/6/13 15:13, Changqi Lu wrote:
> Hi,
>
> patch v6 has been modified.
>
> v5->v6:
> - Add relevant comments in the io layer.
>
> v4->v5:
> - Fixed a memory leak bug at hw/nvme/ctrl.c.
>
> v3->v4:
> - At the nvme layer, the two patches of enabling the ONCS
> function and enabling rescap are combined into one.
> - At the nvme layer, add helper functions for pr capacity
> conversion between the block layer and the nvme layer.
>
> v2->v3:
> In v2 Persist Through Power Loss(PTPL) is enable default.
> In v3 PTPL is supported, which is passed as a parameter.
>
> v1->v2:
> - Add sg_persist --report-capabilities for SCSI protocol and enable
> oncs and rescap for NVMe protocol.
> - Add persistent reservation capabilities constants and helper functions
for
> SCSI and NVMe protocol.
> - Add comments for necessary APIs.
>
> v1:
> - Add seven APIs about persistent reservation command for block layer.
> These APIs including reading keys, reading reservations, registering,
> reserving, releasing, clearing and preempting.
> - Add the necessary pr-related operation APIs for both the
> SCSI protocol and NVMe protocol at the device layer.
> - Add scsi driver at the driver layer to verify the functions
>
> Changqi Lu (10):
> block: add persistent reservation in/out api
> block/raw: add persistent reservation in/out driver
> scsi/constant: add persistent reservation in/out protocol constants
> scsi/util: add helper functions for persistent reservation types
> conversion
> hw/scsi: add persistent reservation in/out api for scsi device
> block/nvme: add reservation command protocol constants
> hw/nvme: add helper functions for converting reservation types
> hw/nvme: enable ONCS and rescap function
> hw/nvme: add reservation protocal command
> block/iscsi: add persistent reservation in/out driver
>
> block/block-backend.c | 403 +++++++++++++++++++++++++++
> block/io.c | 163 +++++++++++
> block/iscsi.c | 443 ++++++++++++++++++++++++++++++
> block/raw-format.c | 56 ++++
> hw/nvme/ctrl.c | 326 +++++++++++++++++++++-
> hw/nvme/ns.c | 5 +
> hw/nvme/nvme.h | 84 ++++++
> hw/scsi/scsi-disk.c | 352 ++++++++++++++++++++++++
> include/block/block-common.h | 40 +++
> include/block/block-io.h | 20 ++
> include/block/block_int-common.h | 84 ++++++
> include/block/nvme.h | 98 +++++++
> include/scsi/constants.h | 52 ++++
> include/scsi/utils.h | 8 +
> include/sysemu/block-backend-io.h | 24 ++
> scsi/utils.c | 81 ++++++
> 16 files changed, 2237 insertions(+), 2 deletions(-)
>
Changqi Lu June 26, 2024, 11:39 a.m. UTC | #2
Hi,

Could everyone please review this series?

On 2024/6/19 10:49, 卢长奇 wrote:
> Hi,
>
> Klaus, the pr related operations of the
> nvme layer are almost ready.
>
> Stefan, the block layer has been modified
> according to your comments.
>
> Please help review the code again. Thanks!
>
> On 2024/6/13 15:13, Changqi Lu wrote:
>> Hi,
>>
>> patch v6 has been modified.
>>
>> v5->v6:
>> - Add relevant comments in the io layer.
>>
>> v4->v5:
>> - Fixed a memory leak bug at hw/nvme/ctrl.c.
>>
>> v3->v4:
>> - At the nvme layer, the two patches of enabling the ONCS
>> function and enabling rescap are combined into one.
>> - At the nvme layer, add helper functions for pr capacity
>> conversion between the block layer and the nvme layer.
>>
>> v2->v3:
>> In v2 Persist Through Power Loss(PTPL) is enable default.
>> In v3 PTPL is supported, which is passed as a parameter.
>>
>> v1->v2:
>> - Add sg_persist --report-capabilities for SCSI protocol and enable
>> oncs and rescap for NVMe protocol.
>> - Add persistent reservation capabilities constants and helper functions
for
>> SCSI and NVMe protocol.
>> - Add comments for necessary APIs.
>>
>> v1:
>> - Add seven APIs about persistent reservation command for block layer.
>> These APIs including reading keys, reading reservations, registering,
>> reserving, releasing, clearing and preempting.
>> - Add the necessary pr-related operation APIs for both the
>> SCSI protocol and NVMe protocol at the device layer.
>> - Add scsi driver at the driver layer to verify the functions
>>
>> Changqi Lu (10):
>> block: add persistent reservation in/out api
>> block/raw: add persistent reservation in/out driver
>> scsi/constant: add persistent reservation in/out protocol constants
>> scsi/util: add helper functions for persistent reservation types
>> conversion
>> hw/scsi: add persistent reservation in/out api for scsi device
>> block/nvme: add reservation command protocol constants
>> hw/nvme: add helper functions for converting reservation types
>> hw/nvme: enable ONCS and rescap function
>> hw/nvme: add reservation protocal command
>> block/iscsi: add persistent reservation in/out driver
>>
>> block/block-backend.c | 403 +++++++++++++++++++++++++++
>> block/io.c | 163 +++++++++++
>> block/iscsi.c | 443 ++++++++++++++++++++++++++++++
>> block/raw-format.c | 56 ++++
>> hw/nvme/ctrl.c | 326 +++++++++++++++++++++-
>> hw/nvme/ns.c | 5 +
>> hw/nvme/nvme.h | 84 ++++++
>> hw/scsi/scsi-disk.c | 352 ++++++++++++++++++++++++
>> include/block/block-common.h | 40 +++
>> include/block/block-io.h | 20 ++
>> include/block/block_int-common.h | 84 ++++++
>> include/block/nvme.h | 98 +++++++
>> include/scsi/constants.h | 52 ++++
>> include/scsi/utils.h | 8 +
>> include/sysemu/block-backend-io.h | 24 ++
>> scsi/utils.c | 81 ++++++
>> 16 files changed, 2237 insertions(+), 2 deletions(-)
>>
Changqi Lu June 27, 2024, 2:54 a.m. UTC | #3
Hi,

@Stefan, many thanks to you for reviewing the code.
@Klaus, the block layer code has been reviewed by Stefan.
Please help review the nvme layer code.
@Paolo, Please help review the scsi layer code and iscsi
driver code.
Thank you!


On 2024/6/13 15:13, Changqi Lu wrote:
> Hi,
>
> patch v6 has been modified.
>
> v5->v6:
> - Add relevant comments in the io layer.
>
> v4->v5:
> - Fixed a memory leak bug at hw/nvme/ctrl.c.
>
> v3->v4:
> - At the nvme layer, the two patches of enabling the ONCS
> function and enabling rescap are combined into one.
> - At the nvme layer, add helper functions for pr capacity
> conversion between the block layer and the nvme layer.
>
> v2->v3:
> In v2 Persist Through Power Loss(PTPL) is enable default.
> In v3 PTPL is supported, which is passed as a parameter.
>
> v1->v2:
> - Add sg_persist --report-capabilities for SCSI protocol and enable
> oncs and rescap for NVMe protocol.
> - Add persistent reservation capabilities constants and helper functions
for
> SCSI and NVMe protocol.
> - Add comments for necessary APIs.
>
> v1:
> - Add seven APIs about persistent reservation command for block layer.
> These APIs including reading keys, reading reservations, registering,
> reserving, releasing, clearing and preempting.
> - Add the necessary pr-related operation APIs for both the
> SCSI protocol and NVMe protocol at the device layer.
> - Add scsi driver at the driver layer to verify the functions
>
> Changqi Lu (10):
> block: add persistent reservation in/out api
> block/raw: add persistent reservation in/out driver
> scsi/constant: add persistent reservation in/out protocol constants
> scsi/util: add helper functions for persistent reservation types
> conversion
> hw/scsi: add persistent reservation in/out api for scsi device
> block/nvme: add reservation command protocol constants
> hw/nvme: add helper functions for converting reservation types
> hw/nvme: enable ONCS and rescap function
> hw/nvme: add reservation protocal command
> block/iscsi: add persistent reservation in/out driver
>
> block/block-backend.c | 403 +++++++++++++++++++++++++++
> block/io.c | 163 +++++++++++
> block/iscsi.c | 443 ++++++++++++++++++++++++++++++
> block/raw-format.c | 56 ++++
> hw/nvme/ctrl.c | 326 +++++++++++++++++++++-
> hw/nvme/ns.c | 5 +
> hw/nvme/nvme.h | 84 ++++++
> hw/scsi/scsi-disk.c | 352 ++++++++++++++++++++++++
> include/block/block-common.h | 40 +++
> include/block/block-io.h | 20 ++
> include/block/block_int-common.h | 84 ++++++
> include/block/nvme.h | 98 +++++++
> include/scsi/constants.h | 52 ++++
> include/scsi/utils.h | 8 +
> include/sysemu/block-backend-io.h | 24 ++
> scsi/utils.c | 81 ++++++
> 16 files changed, 2237 insertions(+), 2 deletions(-)
>
Changqi Lu July 4, 2024, 3:27 a.m. UTC | #4
Hi,

The block layer codes has been reviewed by Stefan.
Could you help me review the scsi and nvme layer codes.

On 2024/6/27 10:53, 卢长奇 wrote:
> the block layer code has been reviewed by Stefan.